Skip to content
Permalink
Browse files

Travis: Fail on warnings and improve cdash integration

  • Loading branch information
m-kuhn committed Jun 15, 2015
1 parent c590e1e commit 95974e8734ba921daba02149b9c4d10467ea817d
Showing with 44 additions and 16 deletions.
  1. +44 −16 qgis-test-travis.ctest
@@ -17,33 +17,61 @@ SET (CTEST_BUILD_CONFIGURATION "Release")


SET (INITIAL_CACHE "
BUILDNAME:STRING=${CTEST_BUILD_NAME}
SITE:STRING=${CTEST_SITE}
CTEST_USE_LAUNCHERS:BOOL=ON
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
${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)
IF(NOT ${BUILDRES} EQUAL 0)
ctest_submit ()
MESSAGE( FATAL_ERROR "Build failed." )
ENDIF(NOT ${BUILDRES} EQUAL 0)
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 ()
MESSAGE( FATAL_ERROR "Test failed." )
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)
# CDash on OTB requires the date to be set for the search to work and that's the timezone this requires
SET(ENV{TZ} "UTC-6")
EXECUTE_PROCESS(COMMAND date +%Y-%m-%d OUTPUT_VARIABLE CDASH_DATE)
MESSAGE("Test results submitted to\n http://dash.orfeo-toolbox.org/queryTests.php?project=QGIS&date=${CDASH_DATE}&filtercount=1&field1=buildname/string&compare1=63&value1=$ENV{TRAVIS_COMMIT}" )
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}" )

0 comments on commit 95974e8

Please sign in to comment.
You can’t perform that action at this time.