diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-07-08 13:06:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-07-08 13:06:53 (GMT) |
commit | 8adfa16e207f046b9ac825c4ec97c041ef4fe541 (patch) | |
tree | 9aa68507caf1f725b29e50c569da172a2ad9e1a3 /Tests/RunCMake | |
parent | cb0080d520d2521450cbb4ac8222b8381bedf3a8 (diff) | |
parent | c57695a2f4ad325346e33eee655b75c1716cf957 (diff) | |
download | CMake-8adfa16e207f046b9ac825c4ec97c041ef4fe541.zip CMake-8adfa16e207f046b9ac825c4ec97c041ef4fe541.tar.gz CMake-8adfa16e207f046b9ac825c4ec97c041ef4fe541.tar.bz2 |
Merge topic 'ctest-resource-spec-file-doc' into release-3.18
c57695a2f4 Help: Clarify search order for resource spec file
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4983
Diffstat (limited to 'Tests/RunCMake')
6 files changed, 26 insertions, 1 deletions
diff --git a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake index e9aa3a4..f5f0699 100644 --- a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake @@ -153,6 +153,7 @@ function(run_ctest_resource name parallel random extra) if(extra) run_ctest("${name}-ctest-s-res-variable" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTEST_RESOURCE_SPEC_SOURCE=VARIABLE" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}") run_ctest("${name}-ctest-s-res-cache" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTEST_RESOURCE_SPEC_SOURCE=CACHE" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}") + run_ctest("${name}-ctest-s-res-cmdline" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTEST_RESOURCE_SPEC_SOURCE=CMDLINE" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}" --resource-spec-file "${RunCMake_SOURCE_DIR}/resspec.json") endif() endfunction() diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cmdline-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cmdline-check.cmake new file mode 100644 index 0000000..ceda72e --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cmdline-check.cmake @@ -0,0 +1 @@ +verify_ctest_resources() diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-check.cmake new file mode 100644 index 0000000..321e9a2 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-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/notenough1-ctest-s-res-cmdline-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-stderr.txt new file mode 100644 index 0000000..c6f9cfc --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-stderr.txt @@ -0,0 +1,14 @@ +^Insufficient resources for test Test1: + + Test requested resources of type 'fluxcapacitors' in the following amounts: + 200 slots + but only the following units were available: + 'outatime': 121 slots + +Resource spec file: + + [^ +]*/Tests/RunCMake/CTestResourceAllocation/resspec.json +CMake Error at [^ +]*/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline/test\.cmake:[0-9]+ \(message\): + Tests did not pass$ diff --git a/Tests/RunCMake/CTestResourceAllocation/test.cmake.in b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in index 54eb4e9..9ad9ac8 100644 --- a/Tests/RunCMake/CTestResourceAllocation/test.cmake.in +++ b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in @@ -12,10 +12,15 @@ set(config_options "-DCTEST_RESOURCE_ALLOC_ENABLED=${CTEST_RESOURCE_ALLOC_ENABLED};-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" ) -if(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "ARG") +if(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "CMDLINE") + list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json") +elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "ARG") set(resspec RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json") + set(CTEST_RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/noexist.json") + list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json") elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "VARIABLE") set(CTEST_RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json") + list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json") elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "CACHE") list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/resspec.json") endif() |