Skip to content
Merged
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
20 changes: 13 additions & 7 deletions run-test262.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,6 @@ int main(int argc, char **argv)
BOOL is_dir_list;
BOOL only_check_errors = FALSE;
const char *filename;
const char *config = NULL;
const char *ignore = "";
BOOL is_test262_harness = FALSE;
BOOL is_module = FALSE;
Expand All @@ -1996,6 +1995,18 @@ int main(int argc, char **argv)
setenv("TZ", "America/Los_Angeles", 1);
#endif

optind = 1;
while (optind < argc) {
char *arg = argv[optind];
if (*arg != '-')
break;
optind++;
if (strstr("-c -d -e -x -f -r -E -T", arg))
optind++;
if (strstr("-d -f", arg))
ignore = "testdir"; // run only the tests from -d or -f
}

/* cannot use getopt because we want to pass the command line to
the script */
optind = 1;
Expand All @@ -2020,16 +2031,14 @@ int main(int argc, char **argv)
} else if (str_equal(arg, "-v")) {
verbose++;
} else if (str_equal(arg, "-c")) {
config = get_opt_arg(arg, argv[optind++]);
load_config(get_opt_arg(arg, argv[optind++]), ignore);
} else if (str_equal(arg, "-d")) {
ignore = "testdir"; // don't run all tests, just the ones from -d
enumerate_tests(get_opt_arg(arg, argv[optind++]));
} else if (str_equal(arg, "-e")) {
error_filename = get_opt_arg(arg, argv[optind++]);
} else if (str_equal(arg, "-x")) {
namelist_load(&exclude_list, get_opt_arg(arg, argv[optind++]));
} else if (str_equal(arg, "-f")) {
ignore = "testdir"; // don't run all tests, just the one from -f
is_dir_list = FALSE;
} else if (str_equal(arg, "-r")) {
report_filename = get_opt_arg(arg, argv[optind++]);
Expand All @@ -2047,9 +2056,6 @@ int main(int argc, char **argv)
}
}

if (config)
load_config(config, ignore);

if (optind >= argc && !test_list.count)
help();

Expand Down