Skip to content

Commit e3bf223

Browse files
committed
Linux: improve command-line, allow recursive test directory and more than one test (eg wildcard + shell expansion)
1 parent fdc1b81 commit e3bf223

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
nRF52: Speed up bootloader, remove pauses on Pixl.js
4141
Pixl.js: fix self-test/terminal print - write to screen immediately after newline unless in IRQ
4242
Fix issue with iteration over arrays with negative entries (these should be converted to Strings)
43+
Linux: improve command-line, allow recursive test directory and more than one test (eg wildcard + shell expansion)
4344

4445
2v05 : Add Array.includes
4546
Fix (Number.toFixed) rounding, eg (1234.505).toFixed(2)

targets/linux/main.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ void show_help() {
324324
warning(" --test-all Run all tests (in 'tests' directory)");
325325
warning(" --test-dir dir Run all tests in directory 'dir'");
326326
warning(" --test test.js Run the supplied test");
327+
warning(" --test test.js Run the supplied test");
327328
warning(" --test-mem-all Run all Exhaustive Memory crash tests");
328329
warning(" --test-mem test.js Run the supplied Exhaustive Memory crash "
329330
"test");
@@ -392,9 +393,16 @@ int main(int argc, char **argv) {
392393
telnetEnabled = true;
393394
#endif
394395
} else if (!strcmp(a, "--test")) {
395-
if (i + 1 >= argc)
396+
bool ok;
397+
if (i + 1 >= argc) {
396398
fatal(1, "Expecting an extra arguments");
397-
bool ok = run_test(argv[i + 1]);
399+
} else if (i + 2 == argc) {
400+
ok = run_test(argv[i + 1]);
401+
} else {
402+
i++;
403+
while (i<argc) filelist_add(&test_files, argv[i++]);
404+
ok = run_test_list(&test_files);
405+
}
398406
exit(ok ? 0 : 1);
399407
} else if (!strcmp(a, "--test-dir")) {
400408
enumerate_tests(argv[i + 1]);

0 commit comments

Comments
 (0)