diff options
Diffstat (limited to 'Tests/RunCMake/CTestResourceAllocation')
39 files changed, 237 insertions, 4 deletions
diff --git a/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in b/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in index 9984421..7c08dcc 100644 --- a/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in +++ b/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in @@ -4,6 +4,8 @@ if(CASE_NAME MATCHES "^(.*)-ctest-s") set(projname "${CMAKE_MATCH_1}") project(${projname} NONE) include(CTest) - include("@RunCMake_SOURCE_DIR@/ResourceCommon.cmake") + if(NOT CASE_NAME MATCHES "^dynamic-resource-") + include("@RunCMake_SOURCE_DIR@/resource-common.cmake") + endif() include("@RunCMake_SOURCE_DIR@/${projname}.cmake") endif() diff --git a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake index f5f0699..42e13fc 100644 --- a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake @@ -179,3 +179,19 @@ run_ctest_resource(ensure_parallel 2 0 0) set(ENV{CTEST_RESOURCE_GROUP_COUNT} 2) run_ctest_resource(process_count 1 0 0) unset(ENV{CTEST_RESOURCE_GROUP_COUNT}) + +function(run_ctest_resource_dynamic name) + run_ctest("${name}-ctest-s" ${ARGN}) +endfunction() + +run_ctest_resource_dynamic(dynamic-resource -VV) +run_ctest_resource_dynamic(dynamic-resource-notenough) +run_ctest_resource_dynamic(dynamic-resource-nofile) +run_ctest_resource_dynamic(dynamic-resource-multiple-generators) +run_ctest_resource_dynamic(dynamic-resource-no-setup-fixture) +run_ctest_resource_dynamic(dynamic-resource-multiple-setup-fixtures) +run_ctest_resource_dynamic(dynamic-resource-no-required-fixture) +run_ctest_resource_dynamic(dynamic-resource-conflicting-spec -DCTEST_RESOURCE_SPEC_SOURCE=CACHE) +run_ctest_resource_dynamic(dynamic-resource-circular) +run_ctest_resource_dynamic(dynamic-resource-circular-no-required-fixtures) +run_ctest_resource_dynamic(dynamic-resource-relative-path) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-ctest-s-stderr.txt new file mode 100644 index 0000000..397ca38 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-ctest-s-stderr.txt @@ -0,0 +1,3 @@ +^Error: a cycle exists in the test dependency graph for the test "GenerateSpecFile"\. +Please fix the cycle and run ctest again. +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures-ctest-s-stderr.txt new file mode 100644 index 0000000..06ea90f --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures-ctest-s-stderr.txt @@ -0,0 +1,2 @@ +^All tests that have RESOURCE_GROUPS must include the resource spec generator fixture in their FIXTURES_REQUIRED +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures.cmake new file mode 100644 index 0000000..9accdf3 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures.cmake @@ -0,0 +1,11 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular.cmake new file mode 100644 index 0000000..4917e30 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular.cmake @@ -0,0 +1,12 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec-ctest-s-stderr.txt new file mode 100644 index 0000000..4e4c01c --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec-ctest-s-stderr.txt @@ -0,0 +1,2 @@ +^GENERATED_RESOURCE_SPEC_FILE test property cannot be used in conjunction with ResourceSpecFile option +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec.cmake new file mode 100644 index 0000000..668b049 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec.cmake @@ -0,0 +1,10 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-ctest-s-stdout.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-ctest-s-stdout.txt new file mode 100644 index 0000000..ec97787 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-ctest-s-stdout.txt @@ -0,0 +1,24 @@ +test 2 + Start 2: GenerateSpecFile + +2: Test command: "?[^ +]*[\\/]bin([\\/][^\\/ +]+)?[\\/]cmake(\.exe)?"? "-E" "copy" "[^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resspec\.json" "[^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-ctest-s-build" +2: Working Directory: [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-ctest-s-build +2: Test timeout computed to be: 600 +1/2 Test #2: GenerateSpecFile ................. Passed +[0-9]+\.[0-9]+ sec +Using generated resource spec file [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-ctest-s-build/dynamic-resspec\.json +test 1 + Start 1: RealTest + +1: Test command: "?[^ +]*[\\/]bin([\\/][^\\/ +]+)?[\\/]cmake(\.exe)?"? "-E" "true" +1: Working Directory: [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-ctest-s-build +1: Test timeout computed to be: 600 +2/2 Test #1: RealTest ......................... Passed +[0-9]+\.[0-9]+ sec diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators-ctest-s-stderr.txt new file mode 100644 index 0000000..273cb80 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators-ctest-s-stderr.txt @@ -0,0 +1,2 @@ +^Only one test may define the GENERATED_RESOURCE_SPEC_FILE property +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators.cmake new file mode 100644 index 0000000..7ee58d4 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators.cmake @@ -0,0 +1,11 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile1 COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile2 COMMAND "${CMAKE_COMMAND}" -E true) +set_tests_properties(GenerateSpecFile1 GenerateSpecFile2 PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures-ctest-s-stderr.txt new file mode 100644 index 0000000..39ee275 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures-ctest-s-stderr.txt @@ -0,0 +1,2 @@ +^Test that defines GENERATED_RESOURCE_SPEC_FILE must have exactly one FIXTURES_SETUP +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures.cmake new file mode 100644 index 0000000..a9e72ea --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures.cmake @@ -0,0 +1,10 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec;InvalidResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture-ctest-s-stderr.txt new file mode 100644 index 0000000..06ea90f --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture-ctest-s-stderr.txt @@ -0,0 +1,2 @@ +^All tests that have RESOURCE_GROUPS must include the resource spec generator fixture in their FIXTURES_REQUIRED +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture.cmake new file mode 100644 index 0000000..1983678 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture.cmake @@ -0,0 +1,9 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture-ctest-s-stderr.txt new file mode 100644 index 0000000..39ee275 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture-ctest-s-stderr.txt @@ -0,0 +1,2 @@ +^Test that defines GENERATED_RESOURCE_SPEC_FILE must have exactly one FIXTURES_SETUP +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture.cmake new file mode 100644 index 0000000..b6dec5e --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture.cmake @@ -0,0 +1,9 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stderr.txt new file mode 100644 index 0000000..343f632 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stderr.txt @@ -0,0 +1,7 @@ +^Could not read/parse resource spec file [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-build/dynamic-resspec\.json:[ ] +File not found: [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-build/dynamic-resspec\.json +CMake Error at [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s/test\.cmake:[0-9]+ \(message\): + Tests did not pass$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stdout.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stdout.txt new file mode 100644 index 0000000..fcf8ace --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stdout.txt @@ -0,0 +1,5 @@ + Start 2: GenerateSpecFile +1/2 Test #2: GenerateSpecFile .................\*\*\*Failed Invalid resource spec file +[0-9]+\.[0-9]+ sec + Start 1: RealTest +Failed test dependencies: GenerateSpecFile +2/2 Test #1: RealTest .........................\*\*\*Not Run +[0-9]+\.[0-9]+ sec diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile.cmake new file mode 100644 index 0000000..e771c60 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile.cmake @@ -0,0 +1,10 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E true) +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-stderr.txt new file mode 100644 index 0000000..393ab84 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-stderr.txt @@ -0,0 +1,14 @@ +^Insufficient resources for test RealTest: + + Test requested resources of type 'widgets' in the following amounts: + 2 slots + but only the following units were available: + '0': 1 slot + +Resource spec file: + + [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-build/dynamic-resspec\.json +CMake Error at [^ +]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s/test\.cmake:[0-9]+ \(message\): + Tests did not pass$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-stdout.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-stdout.txt new file mode 100644 index 0000000..b411a74 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough-ctest-s-stdout.txt @@ -0,0 +1,4 @@ + Start 2: GenerateSpecFile +1/2 Test #2: GenerateSpecFile ................. Passed +[0-9]+\.[0-9]+ sec + Start 1: RealTest +2/2 Test #1: RealTest .........................\*\*\*Not Run +[0-9]+\.[0-9]+ sec diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough.cmake new file mode 100644 index 0000000..c8e1313 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-notenough.cmake @@ -0,0 +1,10 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:2" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path-ctest-s-result.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path-ctest-s-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path-ctest-s-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path-ctest-s-stderr.txt new file mode 100644 index 0000000..2c4dff8 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path-ctest-s-stderr.txt @@ -0,0 +1,2 @@ +^GENERATED_RESOURCE_SPEC_FILE must be an absolute path +No tests were found!!!$ diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path.cmake new file mode 100644 index 0000000..3ee83d7 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path.cmake @@ -0,0 +1,10 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource.cmake b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource.cmake new file mode 100644 index 0000000..668b049 --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource.cmake @@ -0,0 +1,10 @@ +add_test(NAME RealTest COMMAND "${CMAKE_COMMAND}" -E true) +add_test(NAME GenerateSpecFile COMMAND "${CMAKE_COMMAND}" -E copy "${CTEST_DYNAMIC_RESOURCE_SPEC_FILE}" "${CMAKE_BINARY_DIR}") +set_tests_properties(GenerateSpecFile PROPERTIES + GENERATED_RESOURCE_SPEC_FILE "${CMAKE_BINARY_DIR}/dynamic-resspec.json" + FIXTURES_SETUP "ResourceSpec" + ) +set_tests_properties(RealTest PROPERTIES + FIXTURES_REQUIRED "ResourceSpec" + RESOURCE_GROUPS "widgets:1" + ) diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resspec.json b/Tests/RunCMake/CTestResourceAllocation/dynamic-resspec.json new file mode 100644 index 0000000..f9bedaf --- /dev/null +++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resspec.json @@ -0,0 +1,16 @@ +{ + "version": { + "major": 1, + "minor": 0 + }, + "local": [ + { + "widgets": [ + { + "id": "0", + "slots": 1 + } + ] + } + ] +} diff --git a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake b/Tests/RunCMake/CTestResourceAllocation/resource-common.cmake index ef79dce..ef79dce 100644 --- a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake +++ b/Tests/RunCMake/CTestResourceAllocation/resource-common.cmake diff --git a/Tests/RunCMake/CTestResourceAllocation/test.cmake.in b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in index 9ad9ac8..319ebf1 100644 --- a/Tests/RunCMake/CTestResourceAllocation/test.cmake.in +++ b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in @@ -8,9 +8,15 @@ set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@") set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") -set(config_options - "-DCTEST_RESOURCE_ALLOC_ENABLED=${CTEST_RESOURCE_ALLOC_ENABLED};-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" - ) +if("@CASE_NAME@" MATCHES "^dynamic-resource-") + set(config_options + "-DCTEST_DYNAMIC_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/dynamic-resspec.json" + ) +else() + set(config_options + "-DCTEST_RESOURCE_ALLOC_ENABLED=${CTEST_RESOURCE_ALLOC_ENABLED};-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" + ) +endif() if(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "CMDLINE") list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json") |