1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

ci: let travis build tests with both TEST_NODATA=0 and 1

This commit is contained in:
Anonymous Maarten 2017-10-31 05:13:24 +01:00 committed by Daniel Evans
parent adc8255d4b
commit 0078a5c9b5

View File

@ -4,7 +4,7 @@ set(TRAVIS "$ENV{TRAVIS}")
if(TRAVIS)
message("travis_script: Travis detected")
set(CTEST_SITE "Travis")
set(CTEST_SITE_BASE "Travis")
string(SUBSTRING "$ENV{TRAVIS_COMMIT}" 0 8 SHORT_COMMIT)
set(CTEST_BUILD_NAME "$ENV{TRAVIS_EVENT_TYPE}-$ENV{TRAVIS_REPO_SLUG}-$ENV{TRAVIS_BRANCH}-${SHORT_COMMIT}")
else()
@ -20,22 +20,51 @@ set(CTEST_BINARY_DIRECTORY "${BIN_DIR}")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
ctest_empty_binary_directory("${BIN_DIR}")
set(CTEST_SITE "${CTEST_SITE_BASE}-NODATA")
ctest_start("Continuous")
ctest_configure(
OPTIONS
"-DBUILD_VIEWER=1;-DBUILD_TESTS=1;-DTESTS_NODATA=1"
RETURN_VALUE
CONFIGURE_RESULT
CONFIGURE_RESULT_NODATA
)
ctest_build(
NUMBER_ERRORS BUILD_NB_ERRORS
NUMBER_WARNINGS BUILD_NB_WARNINGS
NUMBER_ERRORS BUILD_NB_ERRORS_NODATA
NUMBER_WARNINGS BUILD_NB_WARNINGS_NODATA
)
ctest_test(
RETURN_VALUE TEST_RESULT
)
if(TRAVIS)
ctest_submit(
RETURN_VALUE SUBMIT_RESULT
)
if(NOT SUBMIT_RESULT EQUAL "0")
message(WARNING "Submit failure detected!")
endif()
endif()
set(CTEST_SITE "${CTEST_SITE_BASE}-DATA")
ctest_start("Continuous")
ctest_configure(
OPTIONS
"-DBUILD_VIEWER=1;-DBUILD_TESTS=1;-DTESTS_NODATA=0"
RETURN_VALUE
CONFIGURE_RESULT_DATA
)
ctest_build(
NUMBER_ERRORS BUILD_NB_ERRORS_DATA
NUMBER_WARNINGS BUILD_NB_WARNINGS_DATA
)
math(EXPR CONFIGURE_RESULT "${CONFIGURE_RESULT_DATA}+${CONFIGURE_RESULT_NODATA}")
math(EXPR BUILD_NB_ERRORS "${BUILD_NB_ERRORS_DATA}+${BUILD_NB_ERRORS_NODATA}")
math(EXPR BUILD_NB_WARNINGS "${BUILD_NB_WARNINGS_DATA}+${BUILD_NB_WARNINGS_NODATA}")
file(REMOVE FATAL_ERROR)
if(NOT CONFIGURE_RESULT EQUAL "0")
message(WARNING "Configure error detected!")