Skip to content

Add dir exclude override to run-test262.c #892

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

Merged
merged 1 commit into from
Feb 6, 2025
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
21 changes: 13 additions & 8 deletions run-test262.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,9 @@ void update_exclude_dirs(void)
namelist_t *lp = &test_list;
namelist_t *ep = &exclude_list;
namelist_t *dp = &exclude_dir_list;
char *name;
char *name, *path;
int i, j, count;
size_t include, exclude;

/* split directpries from exclude_list */
for (count = i = 0; i < ep->count; i++) {
Expand All @@ -1082,15 +1083,19 @@ void update_exclude_dirs(void)
/* filter out excluded directories */
for (count = i = 0; i < lp->count; i++) {
name = lp->array[i];
include = exclude = 0;
for (j = 0; j < dp->count; j++) {
if (has_prefix(name, dp->array[j])) {
test_excluded++;
free(name);
name = NULL;
break;
}
path = dp->array[j];
if (has_prefix(name, path))
exclude = strlen(path);
if (*path == '!' && has_prefix(name, &path[1]))
include = strlen(&path[1]);
}
if (name) {
// most specific include/exclude wins
if (exclude > include) {
test_excluded++;
free(name);
} else {
lp->array[count++] = name;
}
}
Expand Down