summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/AddRunCMakeTest.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-03-07 19:05:25 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-03-07 19:30:29 (GMT)
commitf1aedf22402bfef66c4e83265f5d52b7c3d4b015 (patch)
tree563e7023281e3458532a4f3d8286143957de8618 /Tests/RunCMake/AddRunCMakeTest.cmake
parent3d6075da4df6a4f93a835e446c2bbf29488f50bd (diff)
downloadCMake-f1aedf22402bfef66c4e83265f5d52b7c3d4b015.zip
CMake-f1aedf22402bfef66c4e83265f5d52b7c3d4b015.tar.gz
CMake-f1aedf22402bfef66c4e83265f5d52b7c3d4b015.tar.bz2
Tests/RunCMake: Add script to auto-generate RunCMake test suite stub
Diffstat (limited to 'Tests/RunCMake/AddRunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/AddRunCMakeTest.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/AddRunCMakeTest.cmake b/Tests/RunCMake/AddRunCMakeTest.cmake
new file mode 100644
index 0000000..c0c3bba
--- /dev/null
+++ b/Tests/RunCMake/AddRunCMakeTest.cmake
@@ -0,0 +1,10 @@
+if(NOT DEFINED RunCMake_TEST_SUITE)
+ message("Usage: ${CMAKE_COMMAND} -DRunCMake_TEST_SUITE=<test name> -P Tests/RunCMake/AddRunCMakeTestSuite.cmake")
+else()
+ include("Source/CMakeVersion.cmake")
+ set(RunCMake_TEST_DIR "Tests/RunCMake/${RunCMake_TEST_SUITE}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_DIR}")
+ file(WRITE "${RunCMake_TEST_DIR}/CMakeLists.txt" "cmake_minimum_required(VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR})\nproject(\${RunCMake_TEST} NONE)\ninclude(\${RunCMake_TEST}.cmake)\n")
+ file(WRITE "${RunCMake_TEST_DIR}/RunCMakeTest.cmake" "include(RunCMake)\n\n# Write your test cases below, like so:\n#\n# run_cmake(TestCaseName)\n")
+ file(APPEND "Tests/RunCMake/CMakeLists.txt" "add_RunCMake_test(${RunCMake_TEST_SUITE})\n")
+endif()