1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 11:52:40 +01:00

ctest: add experimental ctest script + rename ctest extensions to .ctest

This commit is contained in:
Anonymous Maarten 2017-10-27 18:32:21 +02:00 committed by Daniel Evans
parent 728ac58768
commit ed4509fffa
3 changed files with 44 additions and 1 deletions

View File

@ -25,7 +25,7 @@ addons:
git: git:
depth: 3 depth: 3
script: script:
- ctest -S cmake/ctest/travis_script.cmake -VV -DSRC_DIR=. -DBIN_DIR=build - ctest -S cmake/ctest/travis_script.ctest -VV -DSRC_DIR=. -DBIN_DIR=build
- if [ -f FATAL_ERROR ]; then printf "Fatal failure detected.\nExiting with non-zero result code.\n"; exit 1; fi - if [ -f FATAL_ERROR ]; then printf "Fatal failure detected.\nExiting with non-zero result code.\n"; exit 1; fi
notifications: notifications:
email: false email: false

View File

@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.2.2)
list(APPEND CMAKE_MODULE_PATH "${CTEST_SCRIPT_DIRECTORY}/../modules")
get_filename_component(SRC_DIR "${CTEST_SCRIPT_DIRECTORY}/../.." ABSOLUTE)
get_filename_component(BIN_DIR "${SRC_DIR}/build/experimental" ABSOLUTE)
set(CTEST_SOURCE_DIRECTORY "${SRC_DIR}")
set(CTEST_BINARY_DIRECTORY "${BIN_DIR}")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
ctest_empty_binary_directory("${BIN_DIR}")
set(CMAKE_BINARY_DIR "${BIN_DIR}")
set(CMAKE_CURRENT_BINARY_DIR "${BIN_DIR}")
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
string(SUBSTRING "${GIT_SHA1}" 0 8 SHORT_COMMIT)
set(CTEST_SITE "${CMAKE_SYSTEM_NAME}")
set(CTEST_BUILD_NAME "experimental_script-${SHORT_COMMIT}")
ctest_start("Experimental")
ctest_configure(
OPTIONS
"-DBUILD_VIEWER=1;-DBUILD_TESTS=1"
)
ctest_build()
ctest_test(
RETURN_VALUE TEST_RESULT
)
ctest_submit(
RETURN_VALUE SUBMIT_RESULT
)
message("Site: ${CTEST_SITE}")
message("Build Name: ${CTEST_BUILD_NAME}")
if(NOT SUBMIT_RESULT EQUAL "0")
message("Uploading results failed.")
message("Execute the next command to submit later.")
message("make -C \"CTEST_BINARY_DIRECTORY\" ExperimentalSubmit")
endif()