Tests: Move CTestTestConfigFileInBuildDir into RunCMake.ctest_start

Subsume the CTestTestConfigFileInBuildDir test cases into the
RunCMake.ctest_start test as new cases to avoid infrastructure
duplication.  This also avoids using REGEX_ESCAPE_STRING to try to
regex-match full paths.
This commit is contained in:
Brad King 2015-07-14 09:29:10 -04:00
parent c8f46af11b
commit 0699e0d3e4
8 changed files with 27 additions and 81 deletions

View File

@ -17,8 +17,6 @@ macro(ADD_TEST_MACRO NAME COMMAND)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
endmacro()
include(${CMAKE_CURRENT_SOURCE_DIR}/RegexEscapeString.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake)
# Fake a user home directory to avoid polluting the real one.
@ -2430,37 +2428,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set_tests_properties(CTestTestEmptyBinaryDirectory PROPERTIES
PASS_REGULAR_EXPRESSION "TEST_SUCCESS")
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake"
@ONLY ESCAPE_QUOTES)
add_test(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND}
-S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log"
)
REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_SOURCE_DIR "${CMake_SOURCE_DIR}")
set_tests_properties(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild
PASS_REGULAR_EXPRESSION
"Reading ctest configuration file: ${CTEST_TEST_ESCAPED_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake")
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake"
@ONLY ESCAPE_QUOTES)
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake"
"${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake"
@ONLY ESCAPE_QUOTES COPYONLY)
add_test(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND}
-S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log"
)
REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_BINARY_DIR "${CMake_BINARY_DIR}")
set_tests_properties(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild
REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake
PASS_REGULAR_EXPRESSION
"Reading ctest configuration file: ${CTEST_TEST_ESCAPED_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake")
# test coverage for mumps
# create a MumpsCoverage dir in the binary tree under Testing to
# avoid the .NoDartCoverage files in the cmake testing tree

View File

@ -1,3 +0,0 @@
cmake_minimum_required(VERSION 2.8)
project(CTestTestConfigFileInBuildDir)
include(CTest)

View File

@ -1,7 +0,0 @@
set(CTEST_PROJECT_NAME "CTestTestConfigFileInBuildDir")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
set(CTEST_DROP_SITE_CDASH TRUE)

View File

@ -1,19 +0,0 @@
cmake_minimum_required(VERSION 2.8)
# Settings:
set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
set(CTEST_SITE "@SITE@")
set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir1")
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1")
set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
CTEST_START(Experimental)
CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)

View File

@ -1,19 +0,0 @@
cmake_minimum_required(VERSION 2.8)
# Settings:
set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
set(CTEST_SITE "@SITE@")
set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir2")
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2")
set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
CTEST_START(Experimental)
CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)

View File

@ -0,0 +1,7 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/ConfigInBuild
Build directory: .*/Tests/RunCMake/ctest_start/ConfigInBuild-build
Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/ConfigInBuild-build/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use Experimental tag: [0-9-]+

View File

@ -0,0 +1,7 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/ConfigInSource
Build directory: .*/Tests/RunCMake/ctest_start/ConfigInSource-build
Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/ConfigInSource/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use Experimental tag: [0-9-]+

View File

@ -8,3 +8,16 @@ function(run_ctest_start CASE_NAME)
endfunction()
run_ctest_start(StartQuiet Experimental QUIET)
run_ctest_start(ConfigInSource Experimental)
function(run_ConfigInBuild)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ConfigInBuild-build)
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
${RunCMake_BINARY_DIR}/ConfigInBuild-build/CTestConfig.cmake @ONLY)
run_ctest_start(ConfigInBuild Experimental)
endfunction()
run_ConfigInBuild()