summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-27 11:48:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-03-27 11:49:28 (GMT)
commitb9788dc5a361ad2887b4e8433fdb04dc0aebdcd1 (patch)
tree16e3adfdda4ad71fd8f64999cd6a10b9759a5d84 /Tests
parent82b0316e0a4e5e724770574ae374a9b3df11bccc (diff)
parent70c50aa23cc993a502cd3c87be8afb79d973b50e (diff)
downloadCMake-b9788dc5a361ad2887b4e8433fdb04dc0aebdcd1.zip
CMake-b9788dc5a361ad2887b4e8433fdb04dc0aebdcd1.tar.gz
CMake-b9788dc5a361ad2887b4e8433fdb04dc0aebdcd1.tar.bz2
Merge topic 'revert-CTestTestfile-removal-again'
70c50aa23c Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1887
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CTest/CTestTestfile.cmake.in1
-rw-r--r--Tests/RunCMake/CTest/NotOn-check.cmake8
-rw-r--r--Tests/RunCMake/CTest/NotOn.cmake3
-rw-r--r--Tests/RunCMake/CTest/RunCMakeTest.cmake2
4 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTest/CTestTestfile.cmake.in b/Tests/RunCMake/CTest/CTestTestfile.cmake.in
new file mode 100644
index 0000000..0763244
--- /dev/null
+++ b/Tests/RunCMake/CTest/CTestTestfile.cmake.in
@@ -0,0 +1 @@
+# Created manually
diff --git a/Tests/RunCMake/CTest/NotOn-check.cmake b/Tests/RunCMake/CTest/NotOn-check.cmake
new file mode 100644
index 0000000..b68218a
--- /dev/null
+++ b/Tests/RunCMake/CTest/NotOn-check.cmake
@@ -0,0 +1,8 @@
+set(f "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake")
+if(NOT EXISTS "${f}")
+ set(RunCMake_TEST_FAILED "File does not exist:\n ${f}")
+endif()
+file(READ ${f} content)
+if(NOT "${content}" MATCHES "^# Created manually")
+ set(RunCMake_TEST_FAILED "File:\n ${f}\nhas unexpected content:\n ${content}")
+endif()
diff --git a/Tests/RunCMake/CTest/NotOn.cmake b/Tests/RunCMake/CTest/NotOn.cmake
new file mode 100644
index 0000000..7fba019
--- /dev/null
+++ b/Tests/RunCMake/CTest/NotOn.cmake
@@ -0,0 +1,3 @@
+set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
+include(CTest)
+configure_file(CTestTestfile.cmake.in CTestTestfile.cmake)
diff --git a/Tests/RunCMake/CTest/RunCMakeTest.cmake b/Tests/RunCMake/CTest/RunCMakeTest.cmake
index a6f6842..1392240 100644
--- a/Tests/RunCMake/CTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTest/RunCMakeTest.cmake
@@ -3,3 +3,5 @@ include(RunCMake)
set(RunCMake_TEST_OPTIONS -DNoProject=1)
run_cmake(BeforeProject)
unset(RunCMake_TEST_OPTIONS)
+
+run_cmake(NotOn)