summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-08-10 14:02:36 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-08-10 21:36:14 (GMT)
commit753999d4db842a73727f7efb68ce1b6406b5913b (patch)
tree766935e2181329e796b2c97763c49bf5384b12e5 /Tests/RunCMake
parent5ed03aa07a831cc51fefaddac2316d24a62d3137 (diff)
downloadCMake-753999d4db842a73727f7efb68ce1b6406b5913b.zip
CMake-753999d4db842a73727f7efb68ce1b6406b5913b.tar.gz
CMake-753999d4db842a73727f7efb68ce1b6406b5913b.tar.bz2
set_property(TEST): Add DIRECTORY option
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/set_property/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/set_property/TEST-invalid-result.txt1
-rw-r--r--Tests/RunCMake/set_property/TEST-invalid-stderr.txt11
-rw-r--r--Tests/RunCMake/set_property/TEST-invalid.cmake4
-rw-r--r--Tests/RunCMake/set_property/TEST-subdir1/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/set_property/TEST-subdir2/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/set_property/TEST.cmake9
7 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake
index 692c6b9..1a5498d 100644
--- a/Tests/RunCMake/set_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake
@@ -10,6 +10,12 @@ run_cmake(LINK_DIRECTORIES)
run_cmake(LINK_LIBRARIES)
run_cmake(SOURCES)
run_cmake(SOURCE_FILE)
+run_cmake(TEST-invalid)
run_cmake(TYPE)
run_cmake(USER_PROP)
run_cmake(USER_PROP_INHERITED)
+
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/TEST-build")
+run_cmake(TEST)
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake_command(TEST-test ${CMAKE_CTEST_COMMAND} -C Debug)
diff --git a/Tests/RunCMake/set_property/TEST-invalid-result.txt b/Tests/RunCMake/set_property/TEST-invalid-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/set_property/TEST-invalid-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/set_property/TEST-invalid-stderr.txt b/Tests/RunCMake/set_property/TEST-invalid-stderr.txt
new file mode 100644
index 0000000..c0a40d6
--- /dev/null
+++ b/Tests/RunCMake/set_property/TEST-invalid-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Error at TEST-invalid\.cmake:[0-9]+ \(set_property\):
+ set_property called with incorrect number of arguments no value provided to
+ the DIRECTORY option
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Error at TEST-invalid\.cmake:[0-9]+ \(set_property\):
+ set_property given non-existent DIRECTORY nonexistent
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/set_property/TEST-invalid.cmake b/Tests/RunCMake/set_property/TEST-invalid.cmake
new file mode 100644
index 0000000..6828c96
--- /dev/null
+++ b/Tests/RunCMake/set_property/TEST-invalid.cmake
@@ -0,0 +1,4 @@
+enable_testing()
+
+set_property(TEST t DIRECTORY PROPERTY PASS_REGULAR_EXPRESSION "Invalid")
+set_property(TEST t DIRECTORY nonexistent PROPERTY PASS_REGULAR_EXPRESSION "Invalid")
diff --git a/Tests/RunCMake/set_property/TEST-subdir1/CMakeLists.txt b/Tests/RunCMake/set_property/TEST-subdir1/CMakeLists.txt
new file mode 100644
index 0000000..b1fad66
--- /dev/null
+++ b/Tests/RunCMake/set_property/TEST-subdir1/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_test(NAME t COMMAND ${CMAKE_COMMAND} -E echo "Subdirectory")
+add_test(NAME t2 COMMAND ${CMAKE_COMMAND} -E echo "Subdirectory")
+add_test(NAME t3 COMMAND ${CMAKE_COMMAND} -E echo "Subdirectory")
diff --git a/Tests/RunCMake/set_property/TEST-subdir2/CMakeLists.txt b/Tests/RunCMake/set_property/TEST-subdir2/CMakeLists.txt
new file mode 100644
index 0000000..8621b00
--- /dev/null
+++ b/Tests/RunCMake/set_property/TEST-subdir2/CMakeLists.txt
@@ -0,0 +1 @@
+set_property(TEST t3 DIRECTORY ../TEST-subdir1 PROPERTY PASS_REGULAR_EXPRESSION "Subdirectory")
diff --git a/Tests/RunCMake/set_property/TEST.cmake b/Tests/RunCMake/set_property/TEST.cmake
new file mode 100644
index 0000000..7ef5aa3
--- /dev/null
+++ b/Tests/RunCMake/set_property/TEST.cmake
@@ -0,0 +1,9 @@
+enable_testing()
+
+add_test(NAME t COMMAND ${CMAKE_COMMAND} -E echo "Top directory")
+add_subdirectory(TEST-subdir1)
+add_subdirectory(TEST-subdir2)
+
+set_property(TEST t PROPERTY PASS_REGULAR_EXPRESSION "Top directory")
+set_property(TEST t DIRECTORY TEST-subdir1 PROPERTY PASS_REGULAR_EXPRESSION "Subdirectory")
+set_property(TEST t2 DIRECTORY "${CMAKE_BINARY_DIR}/TEST-subdir1" PROPERTY PASS_REGULAR_EXPRESSION "Subdirectory")