forked from markasselin/PlusApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildAndTest.sh.in
69 lines (59 loc) · 1.49 KB
/
BuildAndTest.sh.in
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
#!/bin/bash
ORIGPATH=$PATH
DIRCMD=0
finish()
{
PATH=$ORIGPATH
}
buildFailed ()
{
echo "ERROR: Build failed..."
finish
exit $1
}
command=%0
test_mode=%1
shift
test_track=""
individual_test=""
while [ "${1:-}" != "" ]; do
case "$1" in
"--test")
shift
individial_test=$1
;;
"--track")
shift
test_track=track $1
;;
esac
shift
done
if [ "$test_mode" == "" ] || [ "$test_mode" == "-E" ]; then
"${CMAKE_COMMAND}" --build . --config Release
errorVal=$?
if [ "$?" == 1 ]; then
buildFailed $errorVal
fi
"${CMAKE_CTEST_COMMAND}" -C Release -D Experimental --output-on-failure $test_track
fi
if [ "$test_mode" == "-N" ]; then
# Clean before the nightly build to enforce all build warnings appear on all nightly dashboard submissions
"${CMAKE_COMMAND}" --build . --config Release --clean-first
"${CMAKE_CTEST_COMMAND}" -C Release -D Nightly $test_track
fi
if [ "$test_mode" == "-C" ]; then
"${CMAKE_COMMAND}" --build . --config Release
"${CMAKE_CTEST_COMMAND}" -C Release -D Continuous $test_track
# Wait for some time before continue to allow checking the results of the executions
sleep 15
fi
if [ "$test_mode" == "-I" ]; then
# Run individual tests with regexp search
# Display the list of tests
"${CMAKE_CTEST_COMMAND}" -C Release -R "%individial_test" -N
# Run selected tests
"${CMAKE_CTEST_COMMAND}" -C Release -R "%individial_test" -V
fi
finish
echo "DONE"