-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunTestsOld.sh
52 lines (42 loc) · 1.3 KB
/
runTestsOld.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
#!/bin/bash
# build all source and tests
javac -cp junit-4.12.jar account/*.java account/tests/*.java Parser.java
TESTS="Test2 Test10"
for t in $TESTS
do
echo "Running $t... "
for i in $(seq 1 $1)
do
echo -n "Execution $i: "
# start deadlock detection script
csh checkDeadlock.sh $t account/out/$t/$t-$i.txt &
# run test and append output to text file
java -cp junit-4.12.jar:hamcrest-core-1.3.jar:. org.junit.runner.JUnitCore account.tests.$t > account/out/$t/$t-$i.txt
# print status of each test
if (grep --quiet OK account/out/$t/$t-$i.txt) then
echo "Passed"
elif (grep --quiet deadlock account/out/$t/$t-$i.txt) then
echo -n "" # pkill will print "Killed" so we do nothing here
else
echo "Failed"
fi
pkill -KILL -f checkDeadlock.sh
done
echo "Done!"
done
# remove the old files so we don't confuse the parser
rm account/out/*/*-all.txt
# Combine all text files into one for the parser
for t in $TESTS
do
for i in $(seq 1 $i)
do
cat account/out/$t/$t-$i.txt >> account/out/$t/$t-all.txt
done
done
for t in $TESTS
do
echo "\n======$t======"
#parses the output and prints info to the terminal
java Parser account/out/$t/$t-all.txt $i
done