Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore testdir config when -d or -f is passed #145

Merged
merged 1 commit into from
Nov 26, 2023
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
15 changes: 13 additions & 2 deletions run-test262.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ void update_exclude_dirs(void)
lp->count = count;
}

void load_config(const char *filename)
void load_config(const char *filename, const char *ignore)
{
char buf[1024];
FILE *f;
Expand Down Expand Up @@ -966,6 +966,10 @@ void load_config(const char *filename)
printf("%s:%d: syntax error\n", filename, lineno);
continue;
}
if (strstr(ignore, p)) {
printf("%s:%d: ignoring %s=%s\n", filename, lineno, p, q);
continue;
}
if (str_equal(p, "style")) {
new_style = str_equal(q, "new");
continue;
Expand Down Expand Up @@ -1981,6 +1985,8 @@ 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 Down Expand Up @@ -2014,14 +2020,16 @@ int main(int argc, char **argv)
} else if (str_equal(arg, "-v")) {
verbose++;
} else if (str_equal(arg, "-c")) {
load_config(get_opt_arg(arg, argv[optind++]));
config = get_opt_arg(arg, argv[optind++]);
} 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 @@ -2039,6 +2047,9 @@ int main(int argc, char **argv)
}
}

if (config)
load_config(config, ignore);

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

Expand Down