|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -TESTS=${@:-"./*/**/*.js"} |
| 3 | +TESTS=${@:-"**/*.js"} |
4 | 4 | TIMEOUT=${TIMEOUT:-10000}
|
5 | 5 | PRELUDE=${PRELUDE:-script.js}
|
6 | 6 |
|
7 | 7 | export NODE_PATH=$PWD/node_modules
|
8 | 8 | npm run build262
|
9 |
| -if [ ! -d "test262" ]; then |
10 |
| - git clone --depth 1 https://github.com/tc39/test262.git |
11 |
| -else |
12 |
| - cd ./test262 |
13 |
| - git fetch origin |
14 |
| - git merge --ff-only origin/master |
15 |
| - cd .. |
16 |
| -fi |
17 | 9 |
|
18 | 10 | if [ "x$COVERAGE" = xyes ]; then
|
19 | 11 | nyc instrument "$PRELUDE" > script-instrumented.js
|
20 | 12 | PRELUDE=script-instrumented.js
|
21 |
| - TRANSFORMER_ARG="--transformer ./transform.test262.js" |
| 13 | + TRANSFORMER_ARG="--transformer ../../test/transform.test262.js" |
22 | 14 | fi
|
23 | 15 |
|
24 |
| -cd test/ |
| 16 | +pushd test262/test/ |
25 | 17 |
|
26 | 18 | if [ "$(uname)" = 'Darwin' ]; then
|
27 | 19 | threads=$(sysctl -n hw.logicalcpu)
|
|
30 | 22 | fi
|
31 | 23 | if [ $threads -gt 8 ]; then threads=8; fi
|
32 | 24 |
|
33 |
| -cp ./helpers/* ../test262/harness/ |
34 |
| - |
35 | 25 | test262-harness \
|
36 | 26 | -t $threads \
|
37 | 27 | -r json \
|
38 | 28 | --reporter-keys file,rawResult,result,scenario \
|
39 |
| - --test262Dir ../test262 \ |
40 |
| - --prelude "../$PRELUDE" \ |
| 29 | + --test262Dir .. \ |
| 30 | + --prelude "../../$PRELUDE" \ |
41 | 31 | --timeout "$TIMEOUT" \
|
42 |
| - --preprocessor ./preprocessor.test262.js \ |
| 32 | + --preprocessor ../../test/preprocessor.test262.js \ |
43 | 33 | $TRANSFORMER_ARG \
|
44 |
| - "$TESTS" \ |
45 |
| - | ./parseResults.js |
| 34 | + "*/Temporal/$TESTS" \ |
| 35 | + | ../../test/parseResults.js |
46 | 36 | RESULT=$?
|
47 | 37 |
|
48 |
| -cd .. |
| 38 | +popd |
49 | 39 |
|
50 | 40 | if [ "x$COVERAGE" = xyes ]; then
|
51 | 41 | nyc report -t coverage/tmp/transformer --reporter=text-lcov > coverage/test262.lcov
|
|
0 commit comments