forked from PlusToolkit/PlusApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildAndTest.sh.in
52 lines (43 loc) · 1.23 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
#!/bin/bash
ORIGPATH=$PATH
DIRCMD=0
# Prevent X server related test errors (vtkXOpenGLRenderWindow: bad X server connection)
export DISPLAY=:0
finish()
{
PATH=$ORIGPATH
}
buildFailed ()
{
echo "ERROR: Build failed..."
finish
exit $1
}
if [ "$1" == "" ] || [ "$1" == "-E" ]; then
"${CMAKE_COMMAND}" --build . --config Release
errorVal=$?
if [ "$?" == 1 ]; then
buildFailed $errorVal
fi
"${CMAKE_CTEST_COMMAND}" -C Release -D Experimental --output-on-failure
fi
if [ "$1" == "-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
fi
if [ "$1" == "-C" ]; then
"${CMAKE_COMMAND}" --build . --config Release
"${CMAKE_CTEST_COMMAND}" -C Release -D Continuous
# Wait for some time before continue to allow checking the results of the executions
sleep 15
fi
if [ "$1" == "-I" ]; then
# Run individual tests with regexp search
# Display the list of tests
"${CMAKE_CTEST_COMMAND}" -C Release -R "%2" -N
# Run selected tests
"${CMAKE_CTEST_COMMAND}" -C Release -R "%2" -V
fi
finish
echo "DONE"