aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 00000000..4347a92d
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,20 @@
+# 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/${dir}"
+ "${CMAKE_BINARY_DIR}/tests/${dir}"
+ --build-two-config
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-project ${proj}
+ ${${NAME}_EXTRA_OPTIONS}
+ --test-command ${COMMAND} ${ARGN})
+# list(APPEND TEST_BUILD_DIRS "${CMAKE_BINARY_DIR}/tests/${dir}")
+endmacro(ADD_TEST_MACRO)
+
+
+add_test_macro(ExecuteAllModules ExecuteAllModules)