-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_all_tests.sh
executable file
·48 lines (41 loc) · 999 Bytes
/
run_all_tests.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
#!/bin/bash
if [[ $1 == "runcmake" ]]; then
mkdir -p cmake-build-debug-no-boost
pushd cmake-build-debug-no-boost
cmake .. -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" -DBUILD_TESTS=Y
make -j8 all
if [[ $? != 0 ]]; then
echo "Make failed"
cd ..
exit 1;
fi
fi
if [[ $1 == "runcmakeboost" ]]; then
mkdir -p cmake-build-debug-with-boost
pushd cmake-build-debug-with-boost
cmake .. -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" -DBUILD_TESTS=Y -DUSEBOOST_MPP=Y
make -j8 all
if [[ $? != 0 ]]; then
echo "Make failed"
cd ..
exit 1;
fi
fi
tests="$(cmake --build . --target help | grep -o -E "[a-zA-Z]*_tst")"
for testexecutable in ${tests}; do
testfolder=${testexecutable%"_tst"}
testpath=./src/${testfolder}/tst/${testexecutable}
if [[ ${testexecutable} == "cookieclicker_tst" ]]; then
continue
fi
echo "Running test: ${testpath}"
./${testpath}
if [[ $? != 0 ]]; then
popd
exit 1;
fi
echo
done
popd
#make checkstyle;
cd ..