diff options
author | Julien Jomier <julien.jomier@kitware.com> | 2019-12-03 10:23:02 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-12-09 18:10:59 (GMT) |
commit | e6f758be6dcd11e901ed86f56c4fdd7e7cb86cca (patch) | |
tree | 3fec0870009c86bacbc37e170465f7565cba61bc /Tests | |
parent | c57bcf3b3025875dfbfd1d1f6eca1291abf4d2f7 (diff) | |
download | CMake-e6f758be6dcd11e901ed86f56c4fdd7e7cb86cca.zip CMake-e6f758be6dcd11e901ed86f56c4fdd7e7cb86cca.tar.gz CMake-e6f758be6dcd11e901ed86f56c4fdd7e7cb86cca.tar.bz2 |
ctest: Populate CTEST_CONFIGURATION_TYPE from the -C command line when set
Diffstat (limited to 'Tests')
4 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in b/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in new file mode 100644 index 0000000..5437800 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.1) +project(CTestCommandLine@CASE_NAME@ NONE) +include(CTest) +add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version) diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 0953504..b2de596 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -1,4 +1,6 @@ include(RunCMake) +include(RunCTest) + set(RunCMake_TEST_TIMEOUT 60) unset(ENV{CTEST_PARALLEL_LEVEL}) @@ -311,3 +313,6 @@ function(run_ShowOnly) run_cmake_command(show-only_json-v1 ${CMAKE_CTEST_COMMAND} --show-only=json-v1) endfunction() run_ShowOnly() + +# Check the configuration type variable is passed +run_ctest(check-configuration-type) diff --git a/Tests/RunCMake/CTestCommandLine/check-configuration-type-stderr.txt b/Tests/RunCMake/CTestCommandLine/check-configuration-type-stderr.txt new file mode 100644 index 0000000..b2c1a45 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/check-configuration-type-stderr.txt @@ -0,0 +1,2 @@ +Command line CTEST_CONFIGURATION_TYPE=Debug +set CTEST_CONFIGURATION_TYPE=Release diff --git a/Tests/RunCMake/CTestCommandLine/test.cmake.in b/Tests/RunCMake/CTestCommandLine/test.cmake.in new file mode 100644 index 0000000..b82968a --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/test.cmake.in @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.1) + +set(CTEST_SITE "test-site") +set(CTEST_BUILD_NAME "test-build-name") +set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@") +set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build") +set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@") +set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") +set(CTEST_COMMAND "@CMAKE_CTEST_COMMAND@") + +if("@CASE_NAME@" MATCHES "^check-configuration-type") + message("Command line CTEST_CONFIGURATION_TYPE=" ${CTEST_CONFIGURATION_TYPE}) + set(CTEST_CONFIGURATION_TYPE "Release") + message("set CTEST_CONFIGURATION_TYPE=" ${CTEST_CONFIGURATION_TYPE}) + + ctest_start(Experimental) +endif() |