From 6c9f678098ff40a994529d81ab81936bff891ee1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 17 Dec 2009 15:14:14 -0500 Subject: Teach ADD_TEST_MACRO about test namespaces We teach ADD_TEST_MACRO to transform names of the form "Namespace.Name" to the directory "Namespace/Name" and the project name "Name". This will allow new tests to be better organized. --- Tests/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e64e6b5..0081a6e 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,16 +1,18 @@ # a macro for tests that have a simple format where the name matches the # directory and project MACRO(ADD_TEST_MACRO NAME COMMAND) + STRING(REPLACE "." "/" dir "${NAME}") + STRING(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") ADD_TEST(${NAME} ${CMAKE_CTEST_COMMAND} --build-and-test - "${CMake_SOURCE_DIR}/Tests/${NAME}" - "${CMake_BINARY_DIR}/Tests/${NAME}" + "${CMake_SOURCE_DIR}/Tests/${dir}" + "${CMake_BINARY_DIR}/Tests/${dir}" --build-two-config --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-project ${NAME} + --build-project ${proj} --test-command ${COMMAND}) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${NAME}") + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") ENDMACRO(ADD_TEST_MACRO) # Fake a user home directory to avoid polluting the real one. -- cgit v0.12