summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/RunCTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/RunCTest.cmake')
-rw-r--r--Tests/RunCMake/RunCTest.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/RunCTest.cmake b/Tests/RunCMake/RunCTest.cmake
new file mode 100644
index 0000000..e94432b
--- /dev/null
+++ b/Tests/RunCMake/RunCTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+
+function(run_ctest CASE_NAME)
+ configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY)
+ configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY)
+ configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY)
+ run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake
+ -V
+ --output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log
+ ${ARGN}
+ )
+endfunction()