diff options
author | Brad King <brad.king@kitware.com> | 2009-12-17 20:14:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-12-17 20:14:14 (GMT) |
commit | 6c9f678098ff40a994529d81ab81936bff891ee1 (patch) | |
tree | 294bd5595bbe1403a1b02558e493900cb74e5177 /Tests/CMakeLists.txt | |
parent | 23c28adbf9742475bc41dcb81395286afc96a057 (diff) | |
download | CMake-6c9f678098ff40a994529d81ab81936bff891ee1.zip CMake-6c9f678098ff40a994529d81ab81936bff891ee1.tar.gz CMake-6c9f678098ff40a994529d81ab81936bff891ee1.tar.bz2 |
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.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 10 |
1 files 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. |