forked from tc39/proposal-temporal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci_codecov_test262.sh
executable file
·42 lines (32 loc) · 1.27 KB
/
ci_codecov_test262.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -ex
SHA_ARG=""
if [ -n "$HEAD_SHA" ]; then
SHA_ARG="-c $HEAD_SHA"
fi
npm run build262
export NODE_V8_COVERAGE=coverage/tmp/
rm -rf $NODE_V8_COVERAGE
# Run the tests in chunks, by subdirectory
# Works around memory leak with vm.Script and NODE_V8_COVERAGE
subdirs=$(find test262/test/*/Temporal/* -maxdepth 0 -type d -exec basename "{}" ";" | sort -u)
failed=0
node runtest262.mjs "*.js" || failed=1
# Tolerate absence (but not failures) of test files matching the following pattern
node runtest262.mjs "test262/test/built-ins/Date/*/toTemporalInstant/*.js" || [ $? = 66 ] || failed=1
for subdir in $subdirs; do
node runtest262.mjs "$subdir/**" || failed=1
done
node runtest262.mjs "test262/test/staging/Intl402/Temporal/**/*.js" || failed=1
node runtest262.mjs "test262/test/intl402/DateTimeFormat/**/*.js" || failed=1
node runtest262.mjs "test262/test/intl402/Intl/DateTimeFormat/**/*.js" || failed=1
node runtest262.mjs "test262/test/built-ins/Date/*/toLocale*String/*.js" || failed=1
c8 report --reporter=text-lcov --temp-directory=$NODE_V8_COVERAGE \
--exclude=polyfill/runtest262.mjs \
--exclude-after-remap > coverage/test262.lcov
codecov $SHA_ARG -f coverage/test262.lcov
rm -rf $NODE_V8_COVERAGE
if [ $failed -ne 0 ]; then
echo Some tests failed.
exit 1
fi