-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix
More file actions
executable file
·147 lines (128 loc) · 2.69 KB
/
matrix
File metadata and controls
executable file
·147 lines (128 loc) · 2.69 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#/bin/bash
shopt -s nullglob
# can't use -Wno_contracts to ignore overlapping domains
DIALYZER_OPTS=" -Wno_improper_lists"
# time limit and memory limit
function limitrun {
./timeout -t 10 -s 6000000 $@
}
function result {
R=$2
if [ $1 -eq 0 ]; then
echo "[O] $R"
elif [ $1 -eq 1 ]; then
echo "[X] $R"
elif [ $1 -eq 5 ]; then
echo "[-] $R"
elif [ $1 -eq 137 ]; then
echo "[M] $R"
elif [ $1 -eq 124 ]; then
echo "[T] $R"
else
echo "[!] $R"
fi
}
function fail {
R=$2
if [ $1 -eq 0 ]; then
echo "[X] $R"
elif [ $1 -eq 1 ]; then
echo "[O] $R"
elif [ $1 -eq 5 ]; then
echo "[-] $R"
elif [ $1 -eq 137 ]; then
echo "[M] $R"
elif [ $1 -eq 124 ]; then
echo "[T] $R"
else
echo "[!] $R"
fi
}
function exception {
echo "[!] $1"
}
function ety {
limitrun ./ety $1 > /dev/null 2> /dev/null
R2=$?
if [ $2 = "fail" ]; then
fail $R2 $1
else
result $R2 $1
fi
}
# PLT needs to be built before
# ./dialyzer --build_plt --apps erts kernel stdlib mnesia
#./dialyzer --src path/somefile.erl
function cdialyzer {
dialyzer $DIALYZER_OPTS --src $1 > /dev/null
R2=$?
# 2 is the error basically
# 1 something else is wrong
if [ $R2 = 2 ]; then
R2=1
elif [ $R2 = 1 ]; then
R2=2
fi
if [ $2 = "fail" ]; then
fail $R2 $1
else
result $R2 $1
fi
}
function gradualizer {
./gradualizer $1 > /dev/null 2> /dev/null
R=$?
if [ $2 = "fail" ]; then
fail $R $1
else
result $R $1
fi
}
function eqwalizer {
# strange exit code conventions
F=`basename $1`
F2=${F%.*}
T=$(mktemp)
Out=$(./elp eqwalize $F2 2> $T)
if (echo "$Out" | grep -vq "Exception"); then
if (echo "$Out" | grep -q "NO ERRORS"); then
R=0
else
R=1
fi
if [ $3=="fail" ]; then
fail $R $1
else
result $R $1
fi
else
exception $1
fi
}
#allModules=(cdialyzer gradualizer eqwalizer ety)
allModules=(cdialyzer gradualizer ety)
#allModules=(ety)
testSuites=(ety gradualizer)
echo ---
echo Testing features: ${allModules[@]}
echo ---
for checkerundertest in ${allModules[@]}; do
echo $checkerundertest
for suite in ${testSuites[@]}; do
for testcase in $suite-src/fail*/*.erl ; do
("$checkerundertest" "$testcase" fail) >> "f-$checkerundertest-$suite-fail"
tail -1 "f-$checkerundertest-$suite-fail"
done
done
for suite in ${testSuites[@]}; do
for testcase in $suite-src/pass*/*.erl ; do
("$checkerundertest" "$testcase" pass) >> "f-$checkerundertest-$suite-pass"
tail -1 "f-$checkerundertest-$suite-pass"
done
done
done
Name=$(date +"%S-%M-%H-%m-%d-%Y")
mkdir -p results/$Name
rm results/latest
ln -s $Name results/latest
mv f-* results/$Name