-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
executable file
·71 lines (57 loc) · 1.59 KB
/
Copy pathtest
File metadata and controls
executable file
·71 lines (57 loc) · 1.59 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
#! /bin/bash
#====================================================
# file: test.sh
#----------------------------------------------------
# - Test all examples for compilation and tests/
# By
#====================================================
Testfold="tests"
Outfold="witnesses"
Builder=./src/main.native
TestCounter=0
SuccesCounter=0
#==== printr : print succes or failure ====
function printr
{
if [[ $# -lt 0 ]];then
exit 1;
else
TestCounter=$((TestCounter+1))
if [[ $1 -ne $2 ]];then
echo -e "\033[1;31m[FAIL]\033[0m"
else
SuccesCounter=$((SuccesCounter+1))
echo -e "\033[1;33m[PASS]\033[0m"
fi
fi
}
#==== Normal Tests ====
StartTime=`date +%s`
echo ">> Testing Proof Algorithm <<"
for folder in ${Testfold}/*
do
# must be dir
if [ ! -d "$folder" ];then
continue
fi
name=${folder##*/}
printf "%s" "Testing :: $name "
output="${Outfold}/${name}.ml"
# test compilation and abort further tests if failed
#echo ${folder}/m1.ml ${folder}/m2.ml ${folder}/m1.trace ${folder}/m2.trace $output
BISECT_FILE=coverage/run $Builder ${folder}/m1.ml ${folder}/m2.ml ${folder}/m1.trace ${folder}/m2.trace $output
res=$?
printr $res 0
done
#==== Final Result ====
echo -e "\n== FINAL RESULT =="
FAIL=0
printf "%s" " "
if [[ $SuccesCounter -ne $TestCounter ]];then
echo -ne "\033[1;31m[$SuccesCounter]\033[0m"
FAIL=1
else
echo -ne "\033[1;33m[$SuccesCounter]\033[0m"
fi
echo -e " of \033[1;33m[$TestCounter]\033[0m Tests in $(expr `date +%s` - $StartTime)(s)"
exit $FAIL