-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtry_all_tests.sh
65 lines (59 loc) · 1.76 KB
/
try_all_tests.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
#
# This script tries to run as many individual tests as possible, reporting
# those which succeed for both YKD_SERIALISE_COMPILATION=0 and
# YKD_SERIALISE_COMPILATION=1.
#
# You can use the output to adjust which tests run in `.buildbot.sh`.
#
# As soon as `all.lua` runs, we can just run that and delete this script.
#
# Note that many tests require setup code in `all.lua` to generate some files
# for the tests to run properly. So some tests will be failing due to that.
set -e
if [ $(uname) != "Linux" ]; then
# Due to descrepancies of the exit status of `timeout`.
echo "this script only runs on linux"
exit 1
fi
SECS=120
LUA=src/lua
OK=""
FAIL=""
for tst in tests/*.lua; do
btst=$(basename ${tst})
echo -n "> $tst(YKD_SERIALISE_COMPILATION=0)..."
exstatus=0
YKD_SERIALISE_COMPILATION=0 timeout -s9 ${SECS}s ${LUA} ${tst} \
>/dev/null 2>&1 || exstatus=$?
if [ ${exstatus} -eq 0 ]; then
# Try test again with JIT compilation on the main thread. Only if this
# also succeeds do we classify the test as "OK".
echo "OK"
echo -n "> $tst(YKD_SERIALISE_COMPILATION=1)..."
exstatus=0
YKD_SERIALISE_COMPILATION=1 timeout -s9 ${SECS}s ${LUA} ${tst} \
>/dev/null 2>&1 || exstatus=$?
if [ ${exstatus} -eq 0 ]; then
echo "OK"
OK="${OK} ${btst}"
else
if [ ${exstatus} -eq 137 ]; then
echo "TIMEOUT"
else
echo "FAIL"
fi
FAIL="${FAIL} ${btst}"
fi
else
if [ ${exstatus} -eq 137 ]; then
echo "TIMEOUT"
else
echo "FAIL"
fi
FAIL="${FAIL} ${btst}"
fi
done
echo "\n---"
echo "OK: ${OK}"
echo "FAIL: ${FAIL}"