-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·42 lines (38 loc) · 841 Bytes
/
run_tests.sh
File metadata and controls
executable file
·42 lines (38 loc) · 841 Bytes
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
#/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
NOCOLOR='\033[0m'
for TESTFILE in ./tests/*.fab
do
echo -n Compiling test ${TESTFILE}...
bin/Compiler ${TESTFILE} &> ./output/test_output_compilation.txt
if [ $? -eq 0 ]
then
printf "${GREEN}SUCCESS${NOCOLOR} "
else
printf "${RED}FAILED!${NOCOLOR}\n"
cat ./output/test_output_compilation.txt
exit
fi
echo -n Running...
output/out &> ./output/test_output_run.txt
if [ $? -eq 0 ]
then
printf "${GREEN}SUCCESS${NOCOLOR}\n"
else
printf "${RED}FAILED!${NOCOLOR}\n"
cat ./output/test_output_run.txt
exit
fi
done
for ERRORTESTFILE in ./errortests/*.fab
do
echo -n Compiling error test ${ERRORTESTFILE}...
bin/Compiler ${ERRORTESTFILE} &> /dev/null
if [ $? -ne 0 ]
then
printf "${GREEN}SUCCESS${NOCOLOR}\n"
else
printf "${RED}FAILED!${NOCOLOR}\n"
fi
done