-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgis-test-travis.ctest
77 lines (69 loc) · 3.28 KB
/
qgis-test-travis.ctest
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
SET (CTEST_SOURCE_DIRECTORY $ENV{TRAVIS_BUILD_DIR})
SET (CTEST_BINARY_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}/build")
#SET (CTEST_SOURCE_DIRECTORY /usr/src/QGIS)
#SET (CTEST_BINARY_DIRECTORY /usr/src/qgis-build)
SET( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
SET (CTEST_CMAKE_COMMAND "cmake" )
SET (CTEST_BUILD_COMMAND "/usr/bin/make -j2 -i -k" )
SET (CTEST_SITE "travis-ci.org" )
IF ($ENV{TRAVIS_PULL_REQUEST} STREQUAL "false")
# No pull request
SET (CTEST_BUILD_NAME "$ENV{TRAVIS_BRANCH} ($ENV{TRAVIS_COMMIT})")
ELSE()
SET (CTEST_BUILD_NAME "PR: $ENV{TRAVIS_PULL_REQUEST} / $ENV{TRAVIS_BRANCH} ($ENV{TRAVIS_COMMIT})")
ENDIF()
SET (CTEST_BUILD_CONFIGURATION "Release")
SET (INITIAL_CACHE "
BUILDNAME:STRING=${CTEST_BUILD_NAME}
SITE:STRING=${CTEST_SITE}
CTEST_USE_LAUNCHERS:BOOL=ON
")
SET (CTEST_NOTES_FILES
${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}
${CTEST_BINARY_DIRECTORY}/CMakeCache.txt
)
IF(NOT WIN32)
STRING(ASCII 27 Esc)
SET(ColorReset "${Esc}[m")
SET(ColorBold "${Esc}[1m")
SET(Red "${Esc}[31m")
SET(Green "${Esc}[32m")
SET(Yellow "${Esc}[33m")
SET(Blue "${Esc}[34m")
SET(Magenta "${Esc}[35m")
SET(Cyan "${Esc}[36m")
SET(White "${Esc}[37m")
SET(BoldRed "${Esc}[1;31m")
SET(BoldGreen "${Esc}[1;32m")
SET(BoldYellow "${Esc}[1;33m")
SET(BoldBlue "${Esc}[1;34m")
SET(BoldMagenta "${Esc}[1;35m")
SET(BoldCyan "${Esc}[1;36m")
SET(BoldWhite "${Esc}[1;37m")
ENDIF(NOT WIN32)
# Requires a track on the CDash server
#ctest_start(Experimental TRACK Travis)
ctest_start(Experimental)
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE BUILDRES NUMBER_WARNINGS NUMWARN NUMBER_ERRORS NUMERR)
IF(NOT ${BUILDRES} EQUAL 0 OR NOT ${NUMERR} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("${Yellow}Test results submitted to${ColorReset}")
MESSAGE("${BoldYellow}http://dash.orfeo-toolbox.org/index.php?project=QGIS&filtercount=1&showfilters=1&field1=buildname/string&compare1=63&value1=$ENV{TRAVIS_COMMIT}${ColorReset}" )
MESSAGE( FATAL_ERROR "${Red}Build failed.${ColorReset}" )
ENDIF(NOT ${BUILDRES} EQUAL 0 OR NOT ${NUMERR} EQUAL 0)
IF(NOT ${NUMWARN} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("${Yellow}Test results submitted to${ColorReset}")
MESSAGE("${BoldYellow}http://dash.orfeo-toolbox.org/index.php?project=QGIS&filtercount=1&showfilters=1&field1=buildname/string&compare1=63&value1=$ENV{TRAVIS_COMMIT}${ColorReset}" )
MESSAGE( FATAL_ERROR "${Red}Build warnings found, aborting test.${ColorReset}" )
ENDIF(NOT ${NUMWARN} EQUAL 0)
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2 RETURN_VALUE TESTRES)
IF(NOT ${TESTRES} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("${Yellow}Test results submitted to${ColorReset}")
MESSAGE("${BoldYellow}http://dash.orfeo-toolbox.org/index.php?project=QGIS&filtercount=1&showfilters=1&field1=buildname/string&compare1=63&value1=$ENV{TRAVIS_COMMIT}${ColorReset}" )
MESSAGE( FATAL_ERROR "Tests failed" )
ENDIF(NOT ${TESTRES} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("${Green}Test results submitted to${ColorReset}")
MESSAGE("${BoldGreen}http://dash.orfeo-toolbox.org/index.php?project=QGIS&filtercount=1&showfilters=1&field1=buildname/string&compare1=63&value1=$ENV{TRAVIS_COMMIT}${ColorReset}" )