summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorWilliam Sciaroni <William.Sciaroni@ngc.com>2023-11-08 16:05:22 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-10 18:19:11 (GMT)
commit5e0c1777a3153fd9b3c1f98e1a584a4525da6141 (patch)
tree1ed15898abd7a04658574ae92108d864f2e887cb /Tests
parenteaa00d4dfa5ea7e611fc447d986bb10c41c7b0e1 (diff)
downloadCMake-5e0c1777a3153fd9b3c1f98e1a584a4525da6141.zip
CMake-5e0c1777a3153fd9b3c1f98e1a584a4525da6141.tar.gz
CMake-5e0c1777a3153fd9b3c1f98e1a584a4525da6141.tar.bz2
Optionally make `test` target depend on `all`
Fixes: #8774
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake2
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake3
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake2
4 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake
index 9c58bae..6a74f57 100644
--- a/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake
@@ -15,3 +15,5 @@ function(run_BuiltinTarget case target)
endfunction()
run_BuiltinTarget(TestDependsAll-Default test)
+run_BuiltinTarget(TestDependsAll-No test)
+run_BuiltinTarget(TestDependsAll-Yes test)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake
new file mode 100644
index 0000000..50ec3b9
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake
@@ -0,0 +1,2 @@
+include(TestDependsAll-common.cmake)
+set(CMAKE_SKIP_TEST_ALL_DEPENDENCY ON)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake
new file mode 100644
index 0000000..ed175d4
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/custom-output.txt)
+ set(RunCMake_TEST_FAILED "Building 'test' target did not build 'all' target:\n ${RunCMake_TEST_BINARY_DIR}/custom-output.txt")
+endif()
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake
new file mode 100644
index 0000000..c35c98d
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake
@@ -0,0 +1,2 @@
+include(TestDependsAll-common.cmake)
+set(CMAKE_SKIP_TEST_ALL_DEPENDENCY OFF)