-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests.sh
52 lines (39 loc) · 1.21 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
#!/bin/bash
array=($(ls testcases))
fname="results"
resultsdir="testResults/"
myresultsdir="myResults/"
fext=".txt"
difftext="diff"
maxtest=36
diffdir="diffOutputs/"
rm myResults/*
rm diffOutputs/*
mkdir myResults &> /dev/null
mkdir diffOutputs &> /dev/null
count=0
for i in "${array[@]}"
do
:
test="$(cut -d'.' -f1 <<< $i)"
echo -n "Running $test ....................... "
make $test &> /dev/null
eval $test &> $myresultsdir$test$fname$fext
diffresults="$(diff $resultsdir$test$fext $myresultsdir$test$fname$fext)"
diffsize=${#diffresults}
if [ $test == "test03" ] || [ $test == "test04" ] || [ $test == "test10" ] || [ $test == "test13" ] || [ $test == "test14" ] || [ $test == "test15" ] || [ $test == "test16" ] || [ $test == "test23" ] || [ $test == "test24" ]; then
echo "CHECK DIFF"
diff $resultsdir$test$fext $myresultsdir$test$fname$fext &> $diffdir$test$difftext$fext
elif [ $diffsize -gt 0 ]; then
echo "FAILED"
diff $resultsdir$test$fext $myresultsdir$test$fname$fext &> $diffdir$test$difftext$fext
else
echo "SUCCEEDED"
fi
if [ $count -gt $(expr $maxtest - 1) ]
then
break
fi
count=$(expr $count + 1)
done
make clean &> /dev/null