mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Remove obsolete run-test262 style option
We always run the test262 suite in new-style mode.
This commit is contained in:
parent
3c3c487e11
commit
79eee54b22
2 changed files with 82 additions and 139 deletions
218
run-test262.c
218
run-test262.c
|
@ -76,7 +76,6 @@ enum test_mode_t {
|
||||||
} test_mode = TEST_DEFAULT_NOSTRICT;
|
} test_mode = TEST_DEFAULT_NOSTRICT;
|
||||||
int skip_async;
|
int skip_async;
|
||||||
int skip_module;
|
int skip_module;
|
||||||
int new_style;
|
|
||||||
int dump_memory;
|
int dump_memory;
|
||||||
int stats_count;
|
int stats_count;
|
||||||
JSMemoryUsage stats_all, stats_avg, stats_min, stats_max;
|
JSMemoryUsage stats_all, stats_avg, stats_min, stats_max;
|
||||||
|
@ -1130,10 +1129,6 @@ void load_config(const char *filename, const char *ignore)
|
||||||
printf("%s:%d: ignoring %s=%s\n", filename, lineno, p, q);
|
printf("%s:%d: ignoring %s=%s\n", filename, lineno, p, q);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (str_equal(p, "style")) {
|
|
||||||
new_style = str_equal(q, "new");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (str_equal(p, "testdir")) {
|
if (str_equal(p, "testdir")) {
|
||||||
char *testdir = compose_path(base_name, q);
|
char *testdir = compose_path(base_name, q);
|
||||||
enumerate_tests(testdir);
|
enumerate_tests(testdir);
|
||||||
|
@ -1754,136 +1749,90 @@ int run_test(const char *filename, int *msec)
|
||||||
|
|
||||||
harness = harness_dir;
|
harness = harness_dir;
|
||||||
|
|
||||||
if (new_style) {
|
if (!harness) {
|
||||||
if (!harness) {
|
p = strstr(filename, "test/");
|
||||||
p = strstr(filename, "test/");
|
if (p) {
|
||||||
if (p) {
|
snprintf(harnessbuf, sizeof(harnessbuf), "%.*s%s",
|
||||||
snprintf(harnessbuf, sizeof(harnessbuf), "%.*s%s",
|
(int)(p - filename), filename, "harness");
|
||||||
(int)(p - filename), filename, "harness");
|
|
||||||
}
|
|
||||||
harness = harnessbuf;
|
|
||||||
}
|
|
||||||
namelist_add(ip, NULL, "sta.js");
|
|
||||||
namelist_add(ip, NULL, "assert.js");
|
|
||||||
/* extract the YAML frontmatter */
|
|
||||||
desc = extract_desc(buf, '-');
|
|
||||||
if (desc) {
|
|
||||||
char *ifile, *option;
|
|
||||||
int state;
|
|
||||||
p = find_tag(desc, "includes:", &state);
|
|
||||||
if (p) {
|
|
||||||
while ((ifile = get_option(&p, &state)) != NULL) {
|
|
||||||
// skip unsupported harness files
|
|
||||||
if (find_word(harness_exclude, ifile)) {
|
|
||||||
skip |= 1;
|
|
||||||
} else {
|
|
||||||
namelist_add(ip, NULL, ifile);
|
|
||||||
}
|
|
||||||
free(ifile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p = find_tag(desc, "flags:", &state);
|
|
||||||
if (p) {
|
|
||||||
while ((option = get_option(&p, &state)) != NULL) {
|
|
||||||
if (str_equal(option, "noStrict") ||
|
|
||||||
str_equal(option, "raw")) {
|
|
||||||
is_nostrict = TRUE;
|
|
||||||
skip |= (test_mode == TEST_STRICT);
|
|
||||||
}
|
|
||||||
else if (str_equal(option, "onlyStrict")) {
|
|
||||||
is_onlystrict = TRUE;
|
|
||||||
skip |= (test_mode == TEST_NOSTRICT);
|
|
||||||
}
|
|
||||||
else if (str_equal(option, "async")) {
|
|
||||||
is_async = TRUE;
|
|
||||||
skip |= skip_async;
|
|
||||||
}
|
|
||||||
else if (str_equal(option, "module")) {
|
|
||||||
is_module = TRUE;
|
|
||||||
skip |= skip_module;
|
|
||||||
}
|
|
||||||
else if (str_equal(option, "CanBlockIsFalse")) {
|
|
||||||
can_block = FALSE;
|
|
||||||
}
|
|
||||||
free(option);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p = find_tag(desc, "negative:", &state);
|
|
||||||
if (p) {
|
|
||||||
/* XXX: should extract the phase */
|
|
||||||
char *q = find_tag(p, "type:", &state);
|
|
||||||
if (q) {
|
|
||||||
while (isspace((unsigned char)*q))
|
|
||||||
q++;
|
|
||||||
error_type = strdup_len(q, strcspn(q, " \n"));
|
|
||||||
}
|
|
||||||
is_negative = TRUE;
|
|
||||||
}
|
|
||||||
p = find_tag(desc, "features:", &state);
|
|
||||||
if (p) {
|
|
||||||
while ((option = get_option(&p, &state)) != NULL) {
|
|
||||||
if (find_word(harness_features, option)) {
|
|
||||||
/* feature is enabled */
|
|
||||||
} else if (find_word(harness_skip_features, option)) {
|
|
||||||
/* skip disabled feature */
|
|
||||||
skip |= 1;
|
|
||||||
} else {
|
|
||||||
/* feature is not listed: skip and warn */
|
|
||||||
printf("%s:%d: unknown feature: %s\n", filename, 1, option);
|
|
||||||
skip |= 1;
|
|
||||||
}
|
|
||||||
free(option);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free(desc);
|
|
||||||
}
|
|
||||||
if (is_async)
|
|
||||||
namelist_add(ip, NULL, "doneprintHandle.js");
|
|
||||||
} else {
|
|
||||||
char *ifile;
|
|
||||||
|
|
||||||
if (!harness) {
|
|
||||||
p = strstr(filename, "test/");
|
|
||||||
if (p) {
|
|
||||||
snprintf(harnessbuf, sizeof(harnessbuf), "%.*s%s",
|
|
||||||
(int)(p - filename), filename, "test/harness");
|
|
||||||
}
|
|
||||||
harness = harnessbuf;
|
|
||||||
}
|
|
||||||
|
|
||||||
namelist_add(ip, NULL, "sta.js");
|
|
||||||
|
|
||||||
/* include extra harness files */
|
|
||||||
for (p = buf; (p = strstr(p, "$INCLUDE(\"")) != NULL; p++) {
|
|
||||||
p += 10;
|
|
||||||
ifile = strdup_len(p, strcspn(p, "\""));
|
|
||||||
// skip unsupported harness files
|
|
||||||
if (find_word(harness_exclude, ifile)) {
|
|
||||||
skip |= 1;
|
|
||||||
} else {
|
|
||||||
namelist_add(ip, NULL, ifile);
|
|
||||||
}
|
|
||||||
free(ifile);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* locate the old style configuration comment */
|
|
||||||
desc = extract_desc(buf, '*');
|
|
||||||
if (desc) {
|
|
||||||
if (strstr(desc, "@noStrict")) {
|
|
||||||
is_nostrict = TRUE;
|
|
||||||
skip |= (test_mode == TEST_STRICT);
|
|
||||||
}
|
|
||||||
if (strstr(desc, "@onlyStrict")) {
|
|
||||||
is_onlystrict = TRUE;
|
|
||||||
skip |= (test_mode == TEST_NOSTRICT);
|
|
||||||
}
|
|
||||||
if (strstr(desc, "@negative")) {
|
|
||||||
/* XXX: should extract the regex to check error type */
|
|
||||||
is_negative = TRUE;
|
|
||||||
}
|
|
||||||
free(desc);
|
|
||||||
}
|
}
|
||||||
|
harness = harnessbuf;
|
||||||
}
|
}
|
||||||
|
namelist_add(ip, NULL, "sta.js");
|
||||||
|
namelist_add(ip, NULL, "assert.js");
|
||||||
|
/* extract the YAML frontmatter */
|
||||||
|
desc = extract_desc(buf, '-');
|
||||||
|
if (desc) {
|
||||||
|
char *ifile, *option;
|
||||||
|
int state;
|
||||||
|
p = find_tag(desc, "includes:", &state);
|
||||||
|
if (p) {
|
||||||
|
while ((ifile = get_option(&p, &state)) != NULL) {
|
||||||
|
// skip unsupported harness files
|
||||||
|
if (find_word(harness_exclude, ifile)) {
|
||||||
|
skip |= 1;
|
||||||
|
} else {
|
||||||
|
namelist_add(ip, NULL, ifile);
|
||||||
|
}
|
||||||
|
free(ifile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p = find_tag(desc, "flags:", &state);
|
||||||
|
if (p) {
|
||||||
|
while ((option = get_option(&p, &state)) != NULL) {
|
||||||
|
if (str_equal(option, "noStrict") ||
|
||||||
|
str_equal(option, "raw")) {
|
||||||
|
is_nostrict = TRUE;
|
||||||
|
skip |= (test_mode == TEST_STRICT);
|
||||||
|
}
|
||||||
|
else if (str_equal(option, "onlyStrict")) {
|
||||||
|
is_onlystrict = TRUE;
|
||||||
|
skip |= (test_mode == TEST_NOSTRICT);
|
||||||
|
}
|
||||||
|
else if (str_equal(option, "async")) {
|
||||||
|
is_async = TRUE;
|
||||||
|
skip |= skip_async;
|
||||||
|
}
|
||||||
|
else if (str_equal(option, "module")) {
|
||||||
|
is_module = TRUE;
|
||||||
|
skip |= skip_module;
|
||||||
|
}
|
||||||
|
else if (str_equal(option, "CanBlockIsFalse")) {
|
||||||
|
can_block = FALSE;
|
||||||
|
}
|
||||||
|
free(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p = find_tag(desc, "negative:", &state);
|
||||||
|
if (p) {
|
||||||
|
/* XXX: should extract the phase */
|
||||||
|
char *q = find_tag(p, "type:", &state);
|
||||||
|
if (q) {
|
||||||
|
while (isspace((unsigned char)*q))
|
||||||
|
q++;
|
||||||
|
error_type = strdup_len(q, strcspn(q, " \n"));
|
||||||
|
}
|
||||||
|
is_negative = TRUE;
|
||||||
|
}
|
||||||
|
p = find_tag(desc, "features:", &state);
|
||||||
|
if (p) {
|
||||||
|
while ((option = get_option(&p, &state)) != NULL) {
|
||||||
|
if (find_word(harness_features, option)) {
|
||||||
|
/* feature is enabled */
|
||||||
|
} else if (find_word(harness_skip_features, option)) {
|
||||||
|
/* skip disabled feature */
|
||||||
|
skip |= 1;
|
||||||
|
} else {
|
||||||
|
/* feature is not listed: skip and warn */
|
||||||
|
printf("%s:%d: unknown feature: %s\n", filename, 1, option);
|
||||||
|
skip |= 1;
|
||||||
|
}
|
||||||
|
free(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(desc);
|
||||||
|
}
|
||||||
|
if (is_async)
|
||||||
|
namelist_add(ip, NULL, "doneprintHandle.js");
|
||||||
|
|
||||||
use_strict = use_nostrict = 0;
|
use_strict = use_nostrict = 0;
|
||||||
/* XXX: should remove 'test_mode' or simplify it just to force
|
/* XXX: should remove 'test_mode' or simplify it just to force
|
||||||
|
@ -2086,7 +2035,6 @@ void help(void)
|
||||||
"-h help\n"
|
"-h help\n"
|
||||||
"-a run tests in strict and nostrict modes\n"
|
"-a run tests in strict and nostrict modes\n"
|
||||||
"-m print memory usage summary\n"
|
"-m print memory usage summary\n"
|
||||||
"-n use new style harness\n"
|
|
||||||
"-N run test prepared by test262-harness+eshost\n"
|
"-N run test prepared by test262-harness+eshost\n"
|
||||||
"-s run tests in strict mode, skip @nostrict tests\n"
|
"-s run tests in strict mode, skip @nostrict tests\n"
|
||||||
"-E only run tests from the error file\n"
|
"-E only run tests from the error file\n"
|
||||||
|
@ -2159,8 +2107,6 @@ int main(int argc, char **argv)
|
||||||
help();
|
help();
|
||||||
} else if (str_equal(arg, "-m")) {
|
} else if (str_equal(arg, "-m")) {
|
||||||
dump_memory++;
|
dump_memory++;
|
||||||
} else if (str_equal(arg, "-n")) {
|
|
||||||
new_style++;
|
|
||||||
} else if (str_equal(arg, "-s")) {
|
} else if (str_equal(arg, "-s")) {
|
||||||
test_mode = TEST_STRICT;
|
test_mode = TEST_STRICT;
|
||||||
} else if (str_equal(arg, "-a")) {
|
} else if (str_equal(arg, "-a")) {
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
[config]
|
[config]
|
||||||
# general settings for test262 ES6 version
|
# general settings for test262 ES6 version
|
||||||
|
|
||||||
# framework style: old, new
|
|
||||||
style=new
|
|
||||||
|
|
||||||
# handle tests tagged as [noStrict]: yes, no, skip
|
# handle tests tagged as [noStrict]: yes, no, skip
|
||||||
nostrict=yes
|
nostrict=yes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue