summaryrefslogtreecommitdiff
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-11-26 14:12:25 +0000
committerKitware Robot <kwrobot@kitware.com>2019-11-26 09:12:33 -0500
commitb1175431c385cb052769d4575576ebb19b6e594b (patch)
tree5a5e9801c4829f97ee53a61d99c865c61399ef3d /Tests/RunCMake
parent8db38cfe3386c463ef40af8520a5df329f9fd596 (diff)
parenta033bafbe01fcb4654f075955e0b3de7be81b0f7 (diff)
downloadcmake-b1175431c385cb052769d4575576ebb19b6e594b.tar.gz
Merge topic 'ctest-resource-fixes' into release-3.16
a033bafbe0 Help: Clarify how tests are run if no resource spec file is specified a64ba0235f CTest: Clarify that resource requirements can be split f9f294f5fa CTest: Add version field to resource spec file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4080
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/combine.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1.cmake2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2.cmake2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/resspec.json4
9 files changed, 26 insertions, 2 deletions
diff --git a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
index d52a63e425..8584786479 100644
--- a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
@@ -160,6 +160,8 @@ run_ctest_resource(checkfree1 2 0)
run_ctest_resource(checkfree2 1 0)
run_ctest_resource(notenough1 1 0)
run_ctest_resource(notenough2 1 0)
+run_ctest_resource(notenough3 1 0)
+run_ctest_resource(combine 1 0)
run_ctest_resource(ensure_parallel 2 0)
set(ENV{CTEST_RESOURCE_GROUP_COUNT} 2)
diff --git a/Tests/RunCMake/CTestResourceAllocation/combine.cmake b/Tests/RunCMake/CTestResourceAllocation/combine.cmake
new file mode 100644
index 0000000000..ed5b25109b
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/combine.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 0 "widgets:8,widgets:4")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake
index 2908812d36..f820c378cc 100644
--- a/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake
@@ -1,5 +1,5 @@
setup_resource_tests()
-add_resource_test(Test1 1 "fluxcapacitors:200")
+add_resource_test(Test1 0 "fluxcapacitors:200")
cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake
index d7600c8963..5b81776364 100644
--- a/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake
@@ -1,5 +1,5 @@
setup_resource_tests()
-add_resource_test(Test1 1 "terminators:2")
+add_resource_test(Test1 0 "terminators:2")
cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake
new file mode 100644
index 0000000000..321e9a2f87
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt
new file mode 100644
index 0000000000..b57e2deb77
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt
new file mode 100644
index 0000000000..82dfdefcfe
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt
@@ -0,0 +1,4 @@
+^Insufficient resources
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough3.cmake
new file mode 100644
index 0000000000..ddf3a9cd52
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 0 "widgets:12")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/resspec.json b/Tests/RunCMake/CTestResourceAllocation/resspec.json
index c67fcca1df..48321ec772 100644
--- a/Tests/RunCMake/CTestResourceAllocation/resspec.json
+++ b/Tests/RunCMake/CTestResourceAllocation/resspec.json
@@ -1,4 +1,8 @@
{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
"local": [
{
"widgets": [