diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-22 19:23:55 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-25 16:08:27 (GMT) |
commit | a64ba0235fbacfe58751c222997bdd74cf973359 (patch) | |
tree | d22567be61596c1b0aa44e82436217609b160c75 /Tests | |
parent | f9f294f5faf980aa39721e4deb465b2e9dbbbd9a (diff) | |
download | CMake-a64ba0235fbacfe58751c222997bdd74cf973359.zip CMake-a64ba0235fbacfe58751c222997bdd74cf973359.tar.gz CMake-a64ba0235fbacfe58751c222997bdd74cf973359.tar.bz2 |
CTest: Clarify that resource requirements can be split
Add a note to the documentation to clarify this, and add test cases
to ensure it.
Fixes: #19987
Diffstat (limited to 'Tests')
9 files changed, 25 insertions, 2 deletions
diff --git a/Tests/CMakeLib/testCTestResourceGroups.cxx b/Tests/CMakeLib/testCTestResourceGroups.cxx index 5fd7d4a..c3532a6 100644 --- a/Tests/CMakeLib/testCTestResourceGroups.cxx +++ b/Tests/CMakeLib/testCTestResourceGroups.cxx @@ -74,6 +74,9 @@ static const std::vector<ExpectedParseResult> expectedResults{ { "1,threads:1,", true, { { { "threads", 1, 1 } }, } }, + { "threads:1,threads:1", true, { + { { "threads", 1, 1 }, { "threads", 1, 1 } }, + } }, { "threads:1;;threads:2", true, { { { "threads", 1, 1 } }, { { "threads", 2, 1 } }, diff --git a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake index d52a63e..8584786 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 0000000..ed5b251 --- /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 2908812..f820c37 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 d7600c8..5b81776 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 0000000..321e9a2 --- /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 0000000..b57e2de --- /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 0000000..82dfdef --- /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 0000000..ddf3a9c --- /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() |