summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CommandLine
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CommandLine')
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/debug-trycompile.cmake5
-rw-r--r--Tests/RunCMake/CommandLine/trycompile-clean.cmake8
3 files changed, 14 insertions, 1 deletions
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 7da0f8d..1b5a1d6 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -978,6 +978,8 @@ set(RunCMake_TEST_OPTIONS --debug-trycompile)
run_cmake(debug-trycompile)
unset(RunCMake_TEST_OPTIONS)
+run_cmake(trycompile-clean)
+
function(run_cmake_depends)
set(RunCMake_TEST_SOURCE_DIR "${RunCMake_SOURCE_DIR}/cmake_depends")
set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/cmake_depends-build")
diff --git a/Tests/RunCMake/CommandLine/debug-trycompile.cmake b/Tests/RunCMake/CommandLine/debug-trycompile.cmake
index a3835a7..9619ba8 100644
--- a/Tests/RunCMake/CommandLine/debug-trycompile.cmake
+++ b/Tests/RunCMake/CommandLine/debug-trycompile.cmake
@@ -1,5 +1,8 @@
enable_language(C)
+
# Look for a source tree left by enable_language internal checks.
-if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp/CMakeLists.txt)
+set(scratch ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeScratch)
+file(GLOB_RECURSE remnants ${scratch}/TryCompile-*/CMakeLists.txt)
+if(NOT remnants)
message(FATAL_ERROR "--debug-trycompile should leave the source behind")
endif()
diff --git a/Tests/RunCMake/CommandLine/trycompile-clean.cmake b/Tests/RunCMake/CommandLine/trycompile-clean.cmake
new file mode 100644
index 0000000..11ec2b9
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trycompile-clean.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+
+# Look for a source tree left by enable_language internal checks.
+set(scratch ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeScratch)
+file(GLOB_RECURSE remnants ${scratch}/TryCompile-*/*)
+if(remnants)
+ message(FATAL_ERROR "try_compile should not leave artifacts behind")
+endif()