-
Notifications
You must be signed in to change notification settings - Fork 4
/
runTests.sh
executable file
·62 lines (53 loc) · 1.34 KB
/
runTests.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
#!/bin/bash
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
nocolor='\033[0m'
hadError=0
function runTestWithArgs
{
if [ "$2" != "" ]; then
withArguments=" with arguments $2"
else
withArguments=""
fi
printf "${yellow}TRYING${nocolor} test $1$withArguments\n"
bin/ptrs $2 tests/$1.ptrs
#printf "${yellow}TRYING${nocolor} test $1 without flow analysis\n"
#bin/ptrs --no-flow tests/$1.ptrs
local status=$?
if [ $status -ne 0 ]; then
printf "\n${red}ERROR${nocolor} running test $1$withArguments\n"
hadError=1
else
printf "\e[1A${green}SUCCESS${nocolor} running test $1$withArguments\n"
fi
}
function runTest
{
runTestWithArgs "$1"
runTestWithArgs "$1" -O0
runTestWithArgs "$1" -O1
runTestWithArgs "$1" -O2
runTestWithArgs "$1" --no-predictions
runTestWithArgs "$1" "--no-predictions -O0"
runTestWithArgs "$1" "--no-predictions -O1"
runTestWithArgs "$1" "--no-predictions -O2"
}
runTest runtime/interop "$1"
runTest runtime/pointer "$1"
runTest runtime/types "$1"
runTest runtime/conversion "$1"
runTest runtime/loops "$1"
runTest runtime/switch "$1"
#runTest runtime/trycatch TODO
runTest runtime/strformat "$1"
runTest runtime/struct "$1"
runTest runtime/map "$1"
runTest runtime/overload "$1"
runTest runtime/functions "$1"
runTest runtime/alignment "$1"
runTest runtime/operators "$1"
if [ $hadError -ne 0 ]; then
exit 1
fi