Revision 634f24b487c5e8036f1c1c977686b9d5eb41e6e8 authored by Juergen E. Fischer on 08 July 2016, 12:00:33 UTC, committed by Juergen E. Fischer on 08 July 2016, 12:00:33 UTC
1 parent 6f82713
qgis-test-travis.ctest
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)
# Create link to test results
# 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)
SET(RESULT_LINK "http://dash.orfeo-toolbox.org/index.php?project=QGIS&filtercount=1&showfilters=1&field1=buildname/string&compare1=63&value1=$ENV{TRAVIS_COMMIT}&date=${CDASH_DATE}")
EXECUTE_PROCESS(COMMAND curl --data-urlencode "url=${RESULT_LINK}" -s http://tinyurl.com/api-create.php
OUTPUT_VARIABLE SHORTURL)
IF(NOT ${BUILDRES} EQUAL 0 OR NOT ${NUMERR} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("")
MESSAGE(" ${Yellow}Test results submitted to${ColorReset}")
MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}")
MESSAGE("")
MESSAGE( FATAL_ERROR " ${Red}Build failed. Not running tests.${ColorReset}" )
MESSAGE("")
ENDIF(NOT ${BUILDRES} EQUAL 0 OR NOT ${NUMERR} EQUAL 0)
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2 RETURN_VALUE TESTRES)
IF(NOT ${NUMWARN} EQUAL 0 OR NOT ${TESTRES} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("")
MESSAGE(" ${Yellow}Test results submitted to${ColorReset}")
MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}" )
MESSAGE("")
MESSAGE( FATAL_ERROR " ${Red}Build warnings found, aborting test.${ColorReset}" )
IF(NOT ${TESTRES} EQUAL 0)
SET(TESTRES_MESSAGE " Tests failed.")
ENDIF(NOT ${TESTRES} EQUAL 0)
IF(NOT${NUMWARN} EQUAL 0)
SET(WARNING_MESSAGE " Build warnings found.")
ENDIF(NOT ${NUMWARN} EQUAL 0)
MESSAGE( FATAL_ERROR " ${TESTRES_MESSAGE} ${WARNING_MESSAGE}" )
ENDIF(NOT ${NUMWARN} EQUAL 0 OR NOT ${TESTRES} EQUAL 0)
MESSAGE("")
MESSAGE(" ${BoldGreen}Success${ColorReset}")
MESSAGE(" ${Green}All tests passed successfully.${ColorReset}")
MESSAGE("")
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...