-
Notifications
You must be signed in to change notification settings - Fork 0
/
testMyProject.sh
executable file
·79 lines (66 loc) · 1.9 KB
/
testMyProject.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
#!/usr/bin/env bash
# Author: Pavel Hrebicek (xhrebi04)
# Tests for FLP BKG-SIMPLIFY
RED='\033[0;31m'
GREEN='\033[0;32m'
YEL='\033[0;33m'
NC='\033[0m' # No Color
total=0
ok=0
## BAD GRAMMAR TESTS
## TEST01 - TEST 03
## TEST01 - bad nonterminal symbol
## TEST02 - bad terminal symbol
## TEST03 - bad startingnonterminal symbol
## OTHER BAD TESTS
## TEST 09 - starting symbol isnt in NtSet! Empty language.
echo "Starting testing..."
echo "***********************************************"
for (( i=1; i<=10; i++ ))
do
((total++))
# -i
./simplify-bkg -i tests/test0${i}.in > tests/test0${i}_i.temp
diff tests/test0${i}_i.temp tests/test0${i}_i.out
if [ "$?" == "0" ]
then
echo -e "[TEST 0$i] ./simplify-bkg -i tests/test0$i.in [${GREEN}OK${NC}]"
((ok++))
rm tests/test0${i}_i.temp
else
echo -e "[TEST 0$i] ./simplify-bkg -i tests/test0$i.in [${RED}BAD${NC}]"
fi
((total++))
# -1
./simplify-bkg -1 tests/test0${i}.in > tests/test0${i}_1.temp
diff tests/test0${i}_1.temp tests/test0${i}_1.out
if [ "$?" == "0" ]
then
echo -e "[TEST 0$i] ./simplify-bkg -1 tests/test0${i}.in [${GREEN}OK${NC}]"
((ok++))
rm tests/test0${i}_1.temp
else
echo -e "[TEST 0$i] ./simplify-bkg -1 tests/test0${i}.in [${RED}BAD${NC}]"
fi
((total++))
# -2
./simplify-bkg -2 tests/test0${i}.in > tests/test0${i}_2.temp
diff tests/test0${i}_2.temp tests/test0${i}_2.out
if [ "$?" == "0" ]
then
echo -e "[TEST 0$i] ./simplify-bkg -2 tests/test0${i}.in [${GREEN}OK${NC}]"
((ok++))
rm tests/test0${i}_2.temp
else
echo -e "[TEST 0$i] ./simplify-bkg -2 tests/test0${i}.in [${RED}BAD${NC}]"
fi
done
echo "***********************************************"
echo -e "FINISHED TESTING:"
echo -e "OK/TOTAL: ${ok}/${total}"
if [ "$ok" == "$total" ]
then
echo -e "[${GREEN}SUCCESSFULL${NC}]"
else
echo -e "[${RED}FAILED${NC}]"
fi