Skip to content

Commit 9975b56

Browse files
authored
Fix running just a single spec test via check.py spec --spec-test foo. NFC (#6580)
1 parent 1cc1501 commit 9975b56

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/test/shared.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def parse_args(args):
7979
help=('If specified, all unfreed (but still referenced) pointers at the'
8080
' end of execution are considered memory leaks. Default: disabled.'))
8181
parser.add_argument(
82-
'--spec-test', action='append', nargs='*', default=[], dest='spec_tests',
82+
'--spec-test', action='append', default=[], dest='spec_tests',
8383
help='Names specific spec tests to run.')
8484
parser.add_argument(
8585
'positional_args', metavar='TEST_SUITE', nargs='*',
@@ -159,7 +159,6 @@ def warn(text):
159159

160160
if not os.path.exists(options.out_dir):
161161
os.makedirs(options.out_dir)
162-
os.chdir(options.out_dir)
163162

164163

165164
# Finds the given executable 'program' in PATH.
@@ -384,10 +383,12 @@ def get_tests(test_dir, extensions=[], recursive=False):
384383
return sorted(tests)
385384

386385

387-
if not options.spec_tests:
388-
options.spec_tests = get_tests(get_test_dir('spec'), ['.wast'])
386+
if options.spec_tests:
387+
options.spec_tests = [os.path.abspath(t) for t in options.spec_tests]
389388
else:
390-
options.spec_tests = options.spec_tests[:]
389+
options.spec_tests = get_tests(get_test_dir('spec'), ['.wast'])
390+
391+
os.chdir(options.out_dir)
391392

392393
# 11/27/2019: We updated the spec test suite to upstream spec repo. For some
393394
# files that started failing after this update, we added the new files to this

0 commit comments

Comments
 (0)