-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRunAllTests.sh
More file actions
122 lines (99 loc) · 4.01 KB
/
RunAllTests.sh
File metadata and controls
122 lines (99 loc) · 4.01 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
#g++ main.cpp -o travis_gcc_cpp98
#./travis_gcc_cpp98
#cppcheck --quiet --error-exitcode=1 main.cpp
#TODO: this needs clearing up!! not a priority though...
#Set some text colours up - https://gist.github.com/vratiu/9780109
GREEN='\033[0;32m' # Green
YELLOW='\e[33m' # Yellow - seems more brown to me!
BLUE='\033[0;34m' # Blue
PURPLE='\033[0;35m' # Purple
NC='\033[0m' # No Color
echo "${PURPLE}==============================================================================="
echo "Building!${NC}"
# Stop execution on any error
set -e
cd src
make clean
make all
# Continue execution despite error
set +e
echo "${BLUE}==============================================================================="
echo "Running Smoke Tests${NC}"
echo "---------------------------------"
cd ../output
echo "---------------------------------"
echo "Checking TTYPE 0 (1 on 1) runs ok"
../release/stringmol 0 ../config/quick_test0.conf > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
sh ../util/rm_runfiles.sh
echo "---------------------------------"
echo "Checking TTYPE 1 (ALIFE XII) runs ok"
../release/stringmol 1 ../config/quick_test1.conf > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
sh ../util/rm_runfiles.sh
echo "---------------------------------"
echo "Checking TTYPE 8 (COMASS ALXII) runs ok"
../release/stringmol 8 ../config/quick_test8.conf > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
sh ../util/rm_runfiles.sh
echo "---------------------------------"
echo "Checking TTYPE 30 (Spatial_Stringmol.Run) runs ok"
../release/stringmol 30 ../config/quick_test33.conf > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
echo "---------------------------------"
echo "Checking TTYPE 33 (Spatial Stringmol) runs ok"
../release/stringmol 33 ../config/quick_test33.conf > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
echo "---------------------------------"
echo "Checking TTYPE 34 (Spatial Stringmol Ancestry) runs ok"
../release/stringmol 34 6 900 > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
echo "---------------------------------"
echo "Checking TTYPE 35 (Spatial Stringmol Log Pics) runs ok"
../release/stringmol 35 800 900 50 > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
echo "---------------------------------"
echo "Checking TTYPE 36 (Spatial Stringmol Community) runs ok"
../release/stringmol 36 ./out1_00950.conf > tmp_stdout.txt
echo "exit status is $?"
rm tmp_stdout.txt
echo "---------------------------------"
echo "Cleaning up TTYPE 33,34,35 & 36 output files"
sh ../util/rm_runfiles.sh
cd ../
echo "${PURPLE}===============================================================================${NC}"
echo "Checking with cppcheck"
cd src
# the --check-config argument seems to find standard library headers
#cppcheck --error-exitcode=1 --force --check-config --enable=all *.cpp
echo "----------------------------"
echo "Checking config with cppcheck"
cppcheck --error-exitcode=1 --force --check-config --suppress=missingIncludeSystem -i lodepng.* .
echo "----------------------------"
echo "Checking code with cppcheck"
cppcheck --error-exitcode=1 --force --enable=all --inline-suppr --suppress=missingIncludeSystem -i lodepng.* .
cd ../
echo ""
# NB: use "// cppcheck-suppress unusedFunction" before functions to suppress warnings
# //cppcheck-suppress invalidscanf_libc"
# unStop execution on any error
#unset -e TODO: this doesn't recognise the "-e" option
echo "${GREEN}===============================================================================${NC}"
echo "Running Catch.hpp Tests. Please Wait."
#g++ -Wall Shapes-Catch-Testing-Example/Source/Shapes-Catch-Testing-Example.cpp Shapes-Catch-Testing-Example/Source/Implementation/*.cpp -o main
#g++ -Wall Shapes-Catch-Testing-Example/Test/*.cpp Shapes-Catch-Testing-Example/Source/Implementation/*.cpp -o test
echo " compiling..."
cd tests
ls -ltrh
/bin/bash RunCatchTests.sh
#############
# todo: consider using cccc to get software metrics..
# todo: consider how to use valgrind within this