-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathci.sh
executable file
·86 lines (80 loc) · 2.34 KB
/
ci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
# Authors: Giovanni Camurati, Nassim Corteggiani
filter_reglist="a"
while getopts ":t:f:" opt; do
case $opt in
t)
test_name=$OPTARG
echo "test_name = $test_name"
;;
f)
filter_reglist=$OPTARG
echo "filter_reglist = $filter_reglist"
;;
\?)
echo "-$OPTARG does not exist"
exit 1
;;
:)
echo "-$OPTARG requires an argument"
exit 1
;;
esac
done
if [ -z "$test_name" ]
then
echo "--> $test_name.failed ci.sh wrong arguments"
echo "usage:"
echo "./ci.sh -t <test_name>"
exit 0
fi
# set dirs
tests=ci/tests/$test_name
results=ci/results/$test_name
# clean up
rm ci/$test_name.log
rm ci/$test_name.failed
rm ci/$test_name.failed_fracture
rm ci/$test_name.failed_klee
rm ci/$test_name.failed_comparison
rm ci/$test_name.passed
rm ci/$test_name.cpsr_not_implemented
rm ci/$test_name.failed_stack
#rm ci/$test_name.verif
rm -rf $results
mkdir $results
rm -rf klee*
# launch the verify script and dump results
./verify.py -c True \
-i $tests \
-o $results \
-f $filter_reglist \
| grep -E 'PASSED|test failed|fracture failed|klee failed|llvm-as' > ci/$test_name.log
if [ $? != 0 ]; then
printf "%s\n" "--> failed"
exit 1;
fi
printf "%s\n" "--> ok"
#while read -r line; do
# echo "SEED $i $line" >> ci/$test_name.log
#done < verif;
echo ""
echo "-----------------------------"
echo "-- Regression results -------"
echo "-----------------------------"
cat ci/$test_name.log | grep 'failed' > ci/$test_name.failed
cat ci/$test_name.log | grep 'PASSED' > ci/$test_name.passed
cat ci/$test_name.failed | grep 'fracture' > ci/$test_name.failed_fracture
cat ci/$test_name.failed | grep 'klee' > ci/$test_name.failed_klee
cat ci/$test_name.failed | grep 'llvm-as' > ci/$test_name.failed_llvm-as
cat ci/$test_name.failed | grep 'CPSR' > ci/$test_name.cpsr_not_implemented
cat ci/$test_name.failed | grep 'test failed' > ci/$test_name.failed_comparison
echo "$(wc -l ci/$test_name.passed)"
echo "$(wc -l ci/$test_name.failed)"
echo " $(wc -l ci/$test_name.failed_fracture)"
echo " $(wc -l ci/$test_name.failed_klee)"
echo " $(wc -l ci/$test_name.failed_llvm-as)"
#echo " $(wc -l ci/$test_name.cpsr_not_implemented)"
echo " $(wc -l ci/$test_name.failed_comparison)"
cat ci/$test_name.failed
exit $(wc -l ci/$test_name.failed)