-
Notifications
You must be signed in to change notification settings - Fork 32
/
BuildAndTest.sh.in
73 lines (63 loc) · 1.61 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
70
71
72
73
#!/bin/bash
ORIGPATH=$PATH
DIRCMD=0
finish()
{
PATH=$ORIGPATH
}
buildFailed ()
{
echo "ERROR: Build failed..."
finish
exit $1
}
command=$0
if [ "$1" == "-E" ] || [ "$1" == "-N" ] || [ "$1" == "-C" ] || [ "$1" == "-I" ]; then
test_mode=$1
shift
else
test_mode="-E"
fi
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"