Skip to content

Commit a7c7e2b

Browse files
Merge branch 'main' into main
2 parents 6075f9f + 4cab039 commit a7c7e2b

18 files changed

+42
-66
lines changed

test/atomic/test_wait_async.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
volatile int32_t addr = 0;
99

1010
void run_test() {
11-
emscripten_out("worker_main");
1211
#if __EMSCRIPTEN_WASM_WORKERS__
1312
emscripten_wasm_worker_sleep(1000 * 1000000ull); // Sleep one second.
1413
#else

test/atomic/test_wait_async.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Waiting for 0 milliseconds should return 'timed-out'
55
Waiting for >0 milliseconds should return 'ok' (but successfully time out in first call to asyncWaitFinished)
66
Waiting for infinitely long should return 'ok' (and return 'ok' in second call to asyncWaitFinished)
77
main: asyncWaitShouldTimeout
8-
worker_main
98
worker: addr = 1234
109
worker: notify async waiting main thread
1110
main: asyncWaitFinished

test/browser/async_bad_list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main() {
1717
Module.reported = true;
1818
console.log("reporting success");
1919
// manually REPORT_RESULT; we shouldn't call back into native code at this point
20-
await fetch("http://localhost:8888/report_result?0");
20+
await fetch("/report_result?0");
2121
window.close();
2222
}
2323
};

test/browser/async_returnvalue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main() {
3939
Module.reported = true;
4040
console.log("reporting success");
4141
// manually REPORT_RESULT; we shouldn't call back into native code at this point
42-
await fetch("http://localhost:8888/report_result?0");
42+
await fetch("/report_result?0");
4343
window.close();
4444
}
4545
};

test/browser/test_cwrap_early.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Module['preRun'] = () => {
99
console.log('onRuntimeInitialized');
1010
if (wrappedAdd(5, 6) != 11) throw '5 + 6 should be 11';
1111
// report success
12-
await fetch('http://localhost:8888/report_result?0');
12+
await fetch('/report_result?0');
1313
window.close();
1414
};
1515
};

test/browser_reporting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var captureStdio = false;
33

44
var hasModule = typeof Module === 'object' && Module;
55

6-
var reportingURL = 'http://localhost:8888';
6+
var reportingURL = '{{{REPORTING_URL}}}';
77

88
async function reportResultToServer(result) {
99
if (reportResultToServer.reported) {

test/canvas_style_proxy_shell.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153

154154
window.verifyCanvasStyle = async () => {
155155
var success = Module.canvas.style.cursor === 'pointer';
156-
await fetch('http://localhost:8888/report_result?' + (success ? 1 : 0));
156+
await fetch('/report_result?' + (success ? 1 : 0));
157157
window.close();
158158
}
159159

test/common.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,8 @@ class BrowserCore(RunnerCore):
23102310
# single test (hundreds of minutes)
23112311
MAX_UNRESPONSIVE_TESTS = 10
23122312
PORT = 8888
2313-
HARNESS_URL = 'http://localhost:%s/run_harness' % PORT
2313+
SERVER_URL = f'http://localhost:{PORT}'
2314+
HARNESS_URL = f'{SERVER_URL}/run_harness'
23142315
BROWSER_TIMEOUT = 60
23152316

23162317
unresponsive_tests = 0
@@ -2378,6 +2379,11 @@ def tearDownClass(cls):
23782379
def is_browser_test(self):
23792380
return True
23802381

2382+
def add_browser_reporting(self):
2383+
contents = read_file(test_file('browser_reporting.js'))
2384+
contents = contents.replace('{{{REPORTING_URL}}}', BrowserCore.SERVER_URL)
2385+
create_file('browser_reporting.js', contents)
2386+
23812387
def assert_out_queue_empty(self, who):
23822388
if not self.harness_out_queue.empty():
23832389
responses = []
@@ -2461,7 +2467,8 @@ def compile_btest(self, filename, cflags, reporting=Reporting.FULL):
24612467
# the header as there may be multiple files being compiled here).
24622468
if reporting != Reporting.NONE:
24632469
# For basic reporting we inject JS helper funtions to report result back to server.
2464-
cflags += ['--pre-js', test_file('browser_reporting.js')]
2470+
self.add_browser_reporting()
2471+
cflags += ['--pre-js', 'browser_reporting.js']
24652472
if reporting == Reporting.FULL:
24662473
# If C reporting (i.e. the REPORT_RESULT macro) is required we
24672474
# also include report_result.c and force-include report_result.h
@@ -2473,6 +2480,9 @@ def compile_btest(self, filename, cflags, reporting=Reporting.FULL):
24732480
if not os.path.exists(filename):
24742481
filename = test_file(filename)
24752482
self.run_process([compiler_for(filename), filename] + self.get_cflags() + cflags)
2483+
# Remove the file since some tests have assertions for how many files are in
2484+
# the output directory.
2485+
utils.delete_file('browser_reporting.js')
24762486

24772487
def btest_exit(self, filename, assert_returncode=0, *args, **kwargs):
24782488
"""Special case of `btest` that reports its result solely via exiting

test/custom_messages_proxy_shell.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
function sendResult(success) {
1717
if (window.sentTestResult) return;
1818
window.sentTestResult = true;
19-
fetch('http://localhost:8888/report_result?' + (success ? 1 : 0))
19+
fetch('/report_result?' + (success ? 1 : 0))
2020
.then(() => window.close());
2121
}
2222

test/emscripten_throw_number_pre.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
addEventListener('error', (event) => {
22
window.disableErrorReporting = true;
33
var result = event.error === 42 ? 0 : 1;
4-
fetch('http://localhost:8888/report_result?' + result);
4+
fetch('/report_result?' + result);
55
});

0 commit comments

Comments
 (0)