Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions run-test262.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,15 +1988,14 @@ int run_test(ThreadLocalStorage *tls, const char *filename, int *msec)

/* run a test when called by test262-harness+eshost */
int run_test262_harness_test(ThreadLocalStorage *tls, const char *filename,
bool is_module)
bool is_module, bool can_block)
{
JSRuntime *rt;
JSContext *ctx;
char *buf;
size_t buf_len;
int eval_flags, ret_code, ret;
JSValue res_val;
bool can_block;

outfile = stdout; /* for js_print_262 */

Expand All @@ -2013,7 +2012,6 @@ int run_test262_harness_test(ThreadLocalStorage *tls, const char *filename,
}
JS_SetRuntimeInfo(rt, filename);

can_block = true;
JS_SetCanBlock(rt, can_block);

/* loader for ES6 modules */
Expand Down Expand Up @@ -2136,7 +2134,8 @@ void help(void)
"-d dir run all test files in directory tree 'dir'\n"
"-e file load the known errors from 'file'\n"
"-f file execute single test from 'file'\n"
"-x file exclude tests listed in 'file'\n",
"-x file exclude tests listed in 'file'\n"
"--no-can-block set [[CanBlock]] to false (Atomics.wait will throw)\n",
JS_GetVersion());
exit(1);
}
Expand All @@ -2159,6 +2158,7 @@ int main(int argc, char **argv)
const char *ignore = "";
bool is_test262_harness = false;
bool is_module = false;
bool can_block = true;
bool enable_progress = true;

js_std_set_worker_new_context_func(JS_NewCustomContext);
Expand Down Expand Up @@ -2227,6 +2227,8 @@ int main(int argc, char **argv)
is_test262_harness = true;
} else if (str_equal(arg, "--module")) {
is_module = true;
} else if (str_equal(arg, "--no-can-block")) {
can_block = false;
} else {
fatal(1, "unknown option: %s", arg);
break;
Expand All @@ -2237,7 +2239,7 @@ int main(int argc, char **argv)
help();

if (is_test262_harness) {
return run_test262_harness_test(tls, argv[optind], is_module);
return run_test262_harness_test(tls, argv[optind], is_module, can_block);
}

nthreads = max_int(nthreads, 1);
Expand Down
Loading