blob: 924731b9bb312ba7b09a9c9ce76fa3c87b96d7c7 (
plain) (
blame)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
#!/bin/bash
########################################################################################################################
Red="\033[0;31m"
Green="\033[0;32m"
Lblue="\033[1;34m"
Orange="\033[0;33m"
Magenta="\033[1;35m"
NC="\033[0m"
REP_FILE="test/precommit.rep"
TIME=$(date +%Y-%m-%d:%H:%M:%S)
#how many relics to keep
RELIC_COUNT=10
########################################################################################################################
function RelicKeeper
{
cd ./reliquary/bruiser
RELIC_CNT=$(ls | gawk 'END{print NR}')
if (( $RELIC_CNT > $RELIC_COUNT )); then
rm "$(ls -t | tail -1)"
printf "${Orange}RelicKeeper removed the oldest bruiser relic.\n${NC}" | tee -a ../../test/precommit.rep
fi
cd ../m0
RELIC_CNT=$(ls | gawk 'END{print NR}')
if (( $RELIC_CNT > $RELIC_COUNT )); then
rm "$(ls -t | tail -1)"
printf "${Orange}RelicKeeper removed the oldest m0 relic.\n${NC}" | tee -a ../../test/precommit.rep
fi
cd ../safercpp
RELIC_CNT=$(ls | gawk 'END{print NR}')
if (( $RELIC_CNT > $RELIC_COUNT )); then
rm "$(ls -t | tail -1)"
printf "${Orange}RelicKeeper removed the oldest safercpp relic.\n${NC}" | tee -a ../../test/precommit.rep
fi
cd ../..
}
########################################################################################################################
#c++11#
printf "${Lblue}switching to mutator root...\n${NC}" | tee ../test/precommit.rep
cd ..
printf "${Lblue}running make clean...\n${NC}" | tee -a ./test/precommit.rep
"make" clean
printf "${Lblue}testing the build in C++11 mode...\n${NC}" | tee -a ./test/precommit.rep
"make" CXX=clang++ BIULD_MODE=COV_NO_CLANG -j2
echo ""
if [[ $? == 0 ]]; then
printf "${Green}mutator c++11 test build passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator c++11 test build failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running mutator-lvl0 on the tdd sources...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 smoke test on the tdds passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 smoke test on the tdds failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running c++11 mutator-lvl0 xml report schema test...\n${NC}" | tee -a ./test/precommit.rep
"./mutator.sh" -t mutator-lvl0 xsd
if [[ $? == 0 ]];then
printf "${Green}c++11 mutator-lvl0 xml report xsd passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}c++11 mutator-lvl0 xml report xsd failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Magenta}running c++11 mutagen xml report schema test...\n${NC}" | tee -a ./test/precommit.rep
"xmllint" --noout --schema ./samples/m0.xsd ./m0.xml
if [[ $? == 0 ]];then
printf "${Green}c++11 mutagen xml report xsd passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}c++11 mutagen xml report xsd failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running smoke tests on mutator-lvl0...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs3.h -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" -SysHeader=false -MainOnly=true ./test/testFuncs3.h -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 C++11 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 C++11 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running bruiser smoke tests...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre1.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre1.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++11 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++11 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre2.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre2.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++11 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++11 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/smoketest.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/smoketest.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++11 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++11 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running cpp smoke tests on mutator-lvl0...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 ./test/m0-cpp-smoke/m0-cpp-smoke.cpp\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" ./test/m0-cpp-smoke/m0-cpp-smoke.cpp --
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 C++11 cpp std headers smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 C++11 cpp std haders smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running make clean...\n${NC}" | tee -a ./test/precommit.rep
"make" clean
########################################################################################################################
#c++17#
printf "${Lblue}testing the build in C++1z mode...\n${NC}" | tee -a ./test/precommit.rep
"make" CXX=clang++ BUILD_MODE=COV_NO_CLANG_1Z -j2
echo ""
if [[ $? == 0 ]]; then
printf "${Green}mutator c++1z test build passed.\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}date and time of relic:.\n${NC}" | tee -a ./test/precommit.rep
echo $TIME | tee -a ./test/precommit.rep
"cp" ./mutator-lvl0 ./reliquary/m0/m0-$TIME
"cp" ./bruiser/bruiser ./reliquary/bruiser/bruiser-$TIME
"cp" ./safercpp/safercpp-arr ./reliquary/safercpp/safercpp-$TIME
RelicKeeper
source ./extra-tools/oracle.sh ./test/precommit.rep
else
printf "${Red}mutator c++1z test build failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running mutator-lvl0 on the tdd sources...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 smoke test on the tdds passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 smoke test on the tdds failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running c++1z mutator-lvl0 xml report schema test...\n${NC}" | tee -a ./test/precommit.rep
"./mutator.sh" -t mutator-lvl0 xsd
if [[ $? == 0 ]];then
printf "${Green}c++1z mutator-lvl0 xml report xsd passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}c++1z mutator-lvl0 xml report xsd failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Magenta}running c++1z mutagen xml report schema test...\n${NC}" | tee -a ./test/precommit.rep
"xmllint" --noout --schema ./samples/m0.xsd ./m0.xml
if [[ $? == 0 ]];then
printf "${Green}c++1z mutagen xml report xsd passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}c++1z mutagen xml report xsd failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running smoke tests on mutator-lvl0...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs3.h -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" -SysHeader=false -MainOnly=true ./test/testFuncs3.h -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 C++1z smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 C++1z smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running bruiser smoke tests...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre1.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre1.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++1z smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++1z smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre2.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre2.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++1z smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++1z smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/smoketest.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/smoketest.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++11 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++11 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running cpp smoke tests on mutator-lvl0...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 ./test/m0-cpp-smoke/m0-cpp-smoke.cpp\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" ./test/m0-cpp-smoke/m0-cpp-smoke.cpp --
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 C++1z cpp std headers smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 C++1z cpp std haders smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running make clean...\n${NC}" | tee -a ./test/precommit.rep
"make" clean
########################################################################################################################
#c++14#
printf "${Lblue}testing the build in C++14 mode...\n${NC}" | tee -a ./test/precommit.rep
"make" CXX=clang++ BUILD_MODE=COV_NO_CLANG_14 -j2
echo ""
if [[ $? == 0 ]]; then
printf "${Green}mutator c++14 test build passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator c++14 test build failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running mutator-lvl0 on the tdd sources...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 smoke test on the tdds passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 smoke test on the tdds failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running c++14 mutator-lvl0 xml report schema test...\n${NC}" | tee -a ./test/precommit.rep
"./mutator.sh" -t mutator-lvl0 xsd
if [[ $? == 0 ]];then
printf "${Green}c++14 mutator-lvl0 xml report xsd passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}c++14 mutator-lvl0 xml report xsd failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Magenta}running c++14 mutagen xml report schema test...\n${NC}" | tee -a ./test/precommit.rep
"xmllint" --noout --schema ./samples/m0.xsd ./m0.xml
if [[ $? == 0 ]];then
printf "${Green}c++14 mutagen xml report xsd passed.\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}c++14 mutagen xml report xsd failed.\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running smoke tests on mutator-lvl0...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs3.h -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" -SysHeader=false -MainOnly=true ./test/testFuncs3.h -- -std=c90 -I/lib/gcc/x86_64-redhat-linux/6.4.1/include -Wall > ./test/misra-log
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 C++14 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 C++14 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running bruiser smoke tests...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre1.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre1.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++14 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++14 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre2.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/pre2.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++14 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++14 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Orange}./bruiser/bruiser ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/smoketest.lua\n${NC}" | tee -a ./test/precommit.rep
"./bruiser/bruiser" ./test/bruisertest/test.cpp -lua ./bruiser/lua-scripts/smoketest.lua
if [[ $? == 0 ]]; then
printf "${Green}bruiser C++11 smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}bruiser C++11 smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}running cpp smoke tests on mutator-lvl0...\n${NC}" | tee -a ./test/precommit.rep
printf "${Orange}./mutator-lvl0 ./test/m0-cpp-smoke/m0-cpp-smoke.cpp\n${NC}" | tee -a ./test/precommit.rep
"./mutator-lvl0" ./test/m0-cpp-smoke/m0-cpp-smoke.cpp --
if [[ $? == 0 ]]; then
printf "${Green}mutator-lvl0 C++14 cpp std headers smoke test passed...\n${NC}" | tee -a ./test/precommit.rep
else
printf "${Red}mutator-lvl0 C++14 cpp std haders smoke test failed...\n${NC}" | tee -a ./test/precommit.rep
fi
printf "${Lblue}cleaning the objects and exexutables...\n${NC}" | tee -a ./test/precommit.rep
"make" clean
########################################################################################################################
cd daemon
printf "${Lblue}changing to the daemon directory\n${NC}" | tee -a ../test/precommit.rep
printf "${Lblue}cleaning all objects and executables\n${NC}" | tee -a ../test/precommit.rep
"make" clean
printf "${Lblue}testing mutatord's build...\n${NC}" | tee -a ../test/precommit.rep
"make" mutatord
if [[ $? == 0 ]]; then
printf "${Green}mutatord build test passed...\n${NC}" | tee -a ../test/precommit.rep
else
printf "${Red}mutatord build test failed...\n${NC}" | tee -a ../test/precommit.rep
fi
printf "${Lblue}testing mutatorclient's build...\n${NC}" | tee -a ../test/precommit.rep
"make" mutatorclient
if [[ $? == 0 ]]; then
printf "${Green}mutatorclient build test passed...\n${NC}" | tee -a ../test/precommit.rep
else
printf "${Red}mutatorclient build test failed...\n${NC}" | tee -a ../test/precommit.rep
fi
printf "${Lblue}testing mutatorserver's build...\n${NC}" | tee -a ../test/precommit.rep
"make" mutatorserver
if [[ $? == 0 ]]; then
printf "${Green}mutatorserver build test passed...\n${NC}" | tee -a ../test/precommit.rep
else
printf "${Red}mutatorserver build test failed...\n${NC}" | tee -a ../test/precommit.rep
fi
printf "${Lblue}cleaning the objects and exexutables...\n${NC}" | tee -a ../test/precommit.rep
"make" clean
printf "${Lblue}finished running all tests...\n${NC}" | tee -a ../test/precommit.rep
#tell me when youre done
echo -ne '\007' && echo "" && echo -ne '\007' && echo "" && echo -ne '\007'
printf "${Green}beep...\n${NC}"
|