diff --git a/run-test262.c b/run-test262.c index c94ffc8..cbc2eda 100644 --- a/run-test262.c +++ b/run-test262.c @@ -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; @@ -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; @@ -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++]); @@ -2047,9 +2056,6 @@ int main(int argc, char **argv) } } - if (config) - load_config(config, ignore); - if (optind >= argc && !test_list.count) help();