1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 11:22:45 +01:00
openrw/cmake/ctest/experimental_script.ctest
2018-01-08 22:52:48 +00:00

43 lines
1.4 KiB
Plaintext

cmake_minimum_required(VERSION 3.2.2)
get_filename_component(CTEST_SOURCE_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}/../.." ABSOLUTE)
get_filename_component(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build/experimental" ABSOLUTE)
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_COVERAGE_COMMAND "gcov")
if(EXISTS "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt")
ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")
endif()
include("${CTEST_SCRIPT_DIRECTORY}/../modules/GetGitRevisionDescription.cmake")
# get_git_head_revision expects CMAKE_CURRENT_BINARY_DIR to exist.
set(CMAKE_BINARY_DIR "${CTEST_BINARY_DIRECTORY}")
set(CMAKE_CURRENT_BINARY_DIR "${CTEST_BINARY_DIRECTORY}")
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;-DTEST_COVERAGE=1;-DRW_VERBOSE_DEBUG_MESSAGES=1;-DSEPARATE_TEST_SUITES=1;-DCHECK_INCLUDES=1"
)
ctest_build()
ctest_test()
ctest_coverage()
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()