Skip to content

Commit 7f7c19a

Browse files
12wrigjaptomato
authored andcommitted
Support both passing a testcase to npm run test262 as both an
environment variable (TESTS=) or as a parameter.
1 parent 12e4d52 commit 7f7c19a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test262.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
# Note that this script is only expected to be run via `npm run test262`, not by
33
# being manually executed.
44
set -e
5+
TESTS_FROM_ENV="$TESTS"
6+
TESTS="**/*.js"
7+
if [ $# -ne 0 ]; then
8+
TESTS="$@";
9+
elif [ ! -z "$TESTS_FROM_ENV" ]; then
10+
TESTS="$TESTS_FROM_ENV";
11+
fi
512

6-
TESTS=${TESTS:-"*/Temporal/**/*.js"}
713
TIMEOUT=${TIMEOUT:-10000}
814

915
if [ "$(uname)" = 'Darwin' ]; then
@@ -27,5 +33,5 @@ test262-harness \
2733
--prelude "../../dist/script.js" \
2834
--timeout "$TIMEOUT" \
2935
--preprocessor ../../test/preprocessor.test262.cjs \
30-
"$TESTS" \
36+
"*/Temporal/$TESTS" \
3137
| ../../test/parseResults.js

0 commit comments

Comments
 (0)