diff options
Diffstat (limited to 'Tests')
50 files changed, 514 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 2f5bc87..4a42bda 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -1008,6 +1008,10 @@ add_RunCMake_test(CMakePresetsPackage -DPython_EXECUTABLE=${Python_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} ) +add_RunCMake_test(CMakePresetsWorkflow + -DPython_EXECUTABLE=${Python_EXECUTABLE} + -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} + ) add_RunCMake_test(VerifyHeaderSets) diff --git a/Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt b/Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt index b1fcc28..57b714d 100644 --- a/Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt +++ b/Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt @@ -15,4 +15,8 @@ Available test presets: Available package presets: + "default" + +Available workflow presets: + "default"$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-result.txt new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-result.txt @@ -0,0 +1 @@ +8 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stderr.txt new file mode 100644 index 0000000..0690c69 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stderr.txt @@ -0,0 +1,4 @@ +^Errors while running CTest +Output from these tests are in: [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode/build/Testing/Temporary/LastTest\.log +Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely\.$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stdout.txt b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stdout.txt new file mode 100644 index 0000000..2f23f88 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stdout.txt @@ -0,0 +1,17 @@ +^Executing workflow step 1 of 4: configure preset "default" + +.*Testing the configure step at [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode/build.* + +Executing workflow step 2 of 4: build preset "default" + +.*Testing the build step at [^ +]*[\\/]Tests[\\/]RunCMake[\\/]CMakePresetsWorkflow[\\/]BadExitCode[\\/]build.* + +Executing workflow step 3 of 4: test preset "default" + +.*Testing the test step at [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode/build.* + +The following tests FAILED: +.* +1 - EchoTest \(Failed\)$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode.cmake b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode.cmake new file mode 100644 index 0000000..10b46e3 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCode.cmake @@ -0,0 +1,8 @@ +message(STATUS "Testing the configure step at ${CMAKE_BINARY_DIR}") + +add_custom_target(echo_test ALL COMMAND ${CMAKE_COMMAND} -E echo "Testing the build step at ${CMAKE_BINARY_DIR}") + +enable_testing() +add_test(NAME EchoTest COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_LIST_DIR}/BadExitCodeTest.cmake") + +include(CPack) diff --git a/Tests/RunCMake/CMakePresetsWorkflow/BadExitCodeTest.cmake b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCodeTest.cmake new file mode 100644 index 0000000..59f683e --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/BadExitCodeTest.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR " Testing the test step at ${CMAKE_BINARY_DIR}") diff --git a/Tests/RunCMake/CMakePresetsWorkflow/CMakeLists.txt.in b/Tests/RunCMake/CMakePresetsWorkflow/CMakeLists.txt.in new file mode 100644 index 0000000..129184a --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/CMakeLists.txt.in @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.19) +project("@CASE_NAME@" NONE) +include("@CASE_SOURCE_DIR@/@CASE_NAME@.cmake") diff --git a/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-stderr.txt new file mode 100644 index 0000000..22ca94d --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch: Invalid workflow steps$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch.json.in b/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch.json.in new file mode 100644 index 0000000..0864149 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch.json.in @@ -0,0 +1,32 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default" + }, + { + "name": "mismatch" + } + ], + "buildPresets": [ + { + "name": "mismatch", + "configurePreset": "mismatch" + } + ], + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "mismatch" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-result.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-result.txt diff --git a/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-stderr.txt new file mode 100644 index 0000000..cbfee5a --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure: Invalid workflow steps$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure.json.in b/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure.json.in new file mode 100644 index 0000000..2c121a8 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure.json.in @@ -0,0 +1,27 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default", + "binaryDir": "${sourceDir}/build", + "generator": "@RunCMake_GENERATOR@" + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default" + } + ], + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "build", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/Good-stdout.txt b/Tests/RunCMake/CMakePresetsWorkflow/Good-stdout.txt new file mode 100644 index 0000000..a04d7ea --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/Good-stdout.txt @@ -0,0 +1,19 @@ +^Executing workflow step 1 of 4: configure preset "default" + +.*Testing the configure step at [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/Good/build.* + +Executing workflow step 2 of 4: build preset "default" + +.*Testing the build step at [^ +]*[\\/]Tests[\\/]RunCMake[\\/]CMakePresetsWorkflow[\\/]Good[\\/]build.* + +Executing workflow step 3 of 4: test preset "default" + +.*Testing the test step at [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/Good/build.* + +Executing workflow step 4 of 4: package preset "default" + +.*Testing the package step at [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/Good/build.* diff --git a/Tests/RunCMake/CMakePresetsWorkflow/Good.cmake b/Tests/RunCMake/CMakePresetsWorkflow/Good.cmake new file mode 100644 index 0000000..31ce7ff --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/Good.cmake @@ -0,0 +1,8 @@ +message(STATUS "Testing the configure step at ${CMAKE_BINARY_DIR}") + +add_custom_target(echo_test ALL COMMAND ${CMAKE_COMMAND} -E echo "Testing the build step at ${CMAKE_BINARY_DIR}") + +enable_testing() +add_test(NAME EchoTest COMMAND ${CMAKE_COMMAND} -E echo "Testing the test step at ${CMAKE_BINARY_DIR}") + +include(CPack) diff --git a/Tests/RunCMake/CMakePresetsWorkflow/Good.json.in b/Tests/RunCMake/CMakePresetsWorkflow/Good.json.in new file mode 100644 index 0000000..87e2936 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/Good.json.in @@ -0,0 +1,87 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default", + "binaryDir": "${sourceDir}/build", + "generator": "@RunCMake_GENERATOR@" + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default", + "configuration": "Debug" + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "default", + "output": { + "verbosity": "verbose" + }, + "configuration": "Debug" + } + ], + "packagePresets": [ + { + "name": "default", + "configurePreset": "default", + "generators": [ + "External" + ], + "variables": { + "CPACK_EXTERNAL_PACKAGE_SCRIPT": "${sourceDir}/cpack_staging.cmake" + }, + "configurations": ["Debug"] + } + ], + "workflowPresets": [ + { + "name": "Good", + "displayName": "Good Workflow Preset", + "description": "This workflow preset works properly.", + "vendor": {}, + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + }, + { + "type": "package", + "name": "default" + } + ] + }, + { + "name": "BadExitCode", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + }, + { + "type": "package", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/GoodUser-stdout.txt b/Tests/RunCMake/CMakePresetsWorkflow/GoodUser-stdout.txt new file mode 100644 index 0000000..1014915 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/GoodUser-stdout.txt @@ -0,0 +1,2 @@ +-- Testing the configure step at [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/GoodUser/build diff --git a/Tests/RunCMake/CMakePresetsWorkflow/GoodUser.cmake b/Tests/RunCMake/CMakePresetsWorkflow/GoodUser.cmake new file mode 100644 index 0000000..9143e00 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/GoodUser.cmake @@ -0,0 +1 @@ +message(STATUS "Testing the configure step at ${CMAKE_BINARY_DIR}") diff --git a/Tests/RunCMake/CMakePresetsWorkflow/GoodUser.json.in b/Tests/RunCMake/CMakePresetsWorkflow/GoodUser.json.in new file mode 100644 index 0000000..e71b4ea --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/GoodUser.json.in @@ -0,0 +1,14 @@ +{ + "version": 6, + "workflowPresets": [ + { + "name": "GoodUser", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/ListPresets-stdout.txt b/Tests/RunCMake/CMakePresetsWorkflow/ListPresets-stdout.txt new file mode 100644 index 0000000..57f30a4 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/ListPresets-stdout.txt @@ -0,0 +1,4 @@ +^Available workflow presets: + + "default" + "with-description" - With Description$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/ListPresets.json.in b/Tests/RunCMake/CMakePresetsWorkflow/ListPresets.json.in new file mode 100644 index 0000000..9a7d5a6 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/ListPresets.json.in @@ -0,0 +1,30 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default" + } + ], + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + }, + { + "name": "with-description", + "displayName": "With Description", + "description": "This preset has a description.", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-stderr.txt new file mode 100644 index 0000000..049ed6b --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps: Invalid workflow steps$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps.json.in b/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps.json.in new file mode 100644 index 0000000..2757197 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps.json.in @@ -0,0 +1,9 @@ +{ + "version": 6, + "workflowPresets": [ + { + "name": "default", + "steps": [] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-stderr.txt new file mode 100644 index 0000000..c522b84 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep: Invalid workflow steps$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep.json.in b/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep.json.in new file mode 100644 index 0000000..235398b --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep.json.in @@ -0,0 +1,14 @@ +{ + "version": 6, + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsWorkflow/RunCMakeTest.cmake new file mode 100644 index 0000000..b89a11a --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/RunCMakeTest.cmake @@ -0,0 +1,79 @@ +include(RunCMake) + +# Presets do not support legacy VS generator name architecture suffix. +if(RunCMake_GENERATOR MATCHES "^(Visual Studio [0-9]+ [0-9]+) ") + set(RunCMake_GENERATOR "${CMAKE_MATCH_1}") +endif() + +function(run_cmake_workflow_presets name) + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}") + set(RunCMake_TEST_BINARY_DIR "${RunCMake_TEST_SOURCE_DIR}/build") + set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}") + + set(RunCMake_TEST_NO_CLEAN TRUE) + + file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}") + + set(CASE_NAME "${name}") + set(CASE_SOURCE_DIR "${RunCMake_SOURCE_DIR}") + configure_file("${RunCMake_SOURCE_DIR}/CMakeLists.txt.in" "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" @ONLY) + + if(NOT CMakePresets_FILE) + set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/${name}.json.in") + endif() + if(EXISTS "${CMakePresets_FILE}") + configure_file("${CMakePresets_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakePresets.json" @ONLY) + endif() + + if(NOT CMakeUserPresets_FILE) + set(CMakeUserPresets_FILE "${RunCMake_SOURCE_DIR}/${name}User.json.in") + endif() + if(EXISTS "${CMakeUserPresets_FILE}") + configure_file("${CMakeUserPresets_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakeUserPresets.json" @ONLY) + endif() + + foreach(ASSET ${CMakePresets_ASSETS}) + configure_file("${RunCMake_SOURCE_DIR}/${ASSET}.in" "${RunCMake_TEST_SOURCE_DIR}/${ASSET}" @ONLY) + endforeach() + + if(EXISTS "${RunCMake_SOURCE_DIR}/${name}-check.cmake") + set(RunCMake-check-file "${name}-check.cmake") + else() + set(RunCMake-check-file "check.cmake") + endif() + + if(eq) + set(eq 0 PARENT_SCOPE) + set(preset_arg "--preset=${name}") + else() + set(eq 1 PARENT_SCOPE) + set(preset_arg "--preset" "${name}") + endif() + run_cmake_command("${name}" "${CMAKE_COMMAND}" "--workflow" ${preset_arg} ${ARGN}) +endfunction() + +set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) +run_cmake_workflow_presets(UnsupportedVersion) +set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) +run_cmake_workflow_presets(NoWorkflowSteps) +run_cmake_workflow_presets(FirstStepNotConfigure) +run_cmake_workflow_presets(SecondStepConfigure) +run_cmake_workflow_presets(NonexistentStep) +run_cmake_workflow_presets(UnreachableStep) +run_cmake_workflow_presets(WorkflowStepHidden) +run_cmake_workflow_presets(WorkflowStepDisabled) +run_cmake_workflow_presets(WorkflowStepInvalidMacro) +run_cmake_workflow_presets(ConfigureStepMismatch) + +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/Good.json.in") +set(CMakeUserPresets_FILE "${RunCMake_SOURCE_DIR}/GoodUser.json.in") +set(CMakePresets_ASSETS cpack_staging.cmake) +run_cmake_workflow_presets(Good) +run_cmake_workflow_presets(GoodUser) +run_cmake_workflow_presets(BadExitCode) +unset(CMakePresets_FILE) +unset(CMakeUserPresets_FILE) +unset(CMakePresets_ASSETS) + +run_cmake_workflow_presets(ListPresets --list-presets) diff --git a/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-stderr.txt new file mode 100644 index 0000000..b0ad7d5 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure: Invalid workflow steps$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure.json.in b/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure.json.in new file mode 100644 index 0000000..44e1582 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure.json.in @@ -0,0 +1,25 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default", + "binaryDir": "${sourceDir}/build", + "generator": "@RunCMake_GENERATOR@" + } + ], + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-stderr.txt new file mode 100644 index 0000000..425e719 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep: Workflow step is unreachable from preset's file$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep.json.in b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep.json.in new file mode 100644 index 0000000..235398b --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep.json.in @@ -0,0 +1,14 @@ +{ + "version": 6, + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStepUser.json.in b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStepUser.json.in new file mode 100644 index 0000000..39b6835 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/UnreachableStepUser.json.in @@ -0,0 +1,8 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-stderr.txt new file mode 100644 index 0000000..5cf01aa --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion: File version must be 6 or higher for workflow preset support$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion.json.in b/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion.json.in new file mode 100644 index 0000000..4ebaa8e --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion.json.in @@ -0,0 +1,4 @@ +{ + "version": 5, + "workflowPresets": [] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-stderr.txt new file mode 100644 index 0000000..b598b27 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Cannot use disabled configure preset in [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled: "default"$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled.json.in b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled.json.in new file mode 100644 index 0000000..a3b6783 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled.json.in @@ -0,0 +1,23 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default", + "condition": { + "type": "const", + "value": false + } + } + ], + "workflowPresets": [ + { + "name": "WorkflowStepDisabled", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-stderr.txt new file mode 100644 index 0000000..838ded5 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Cannot use hidden configure preset in [^ +]*/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden: "default"$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden.json.in b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden.json.in new file mode 100644 index 0000000..07c4105 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden.json.in @@ -0,0 +1,20 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default", + "hidden": true + } + ], + "workflowPresets": [ + { + "name": "WorkflowStepHidden", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-result.txt b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-stderr.txt b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-stderr.txt new file mode 100644 index 0000000..f132a93 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Could not evaluate configure preset "default": Invalid macro expansion$ diff --git a/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro.json.in b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro.json.in new file mode 100644 index 0000000..6aec0e3 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro.json.in @@ -0,0 +1,20 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default", + "binaryDir": "$vendor{invalidMacro}" + } + ], + "workflowPresets": [ + { + "name": "WorkflowStepInvalidMacro", + "steps": [ + { + "type": "configure", + "name": "default" + } + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsWorkflow/check.cmake b/Tests/RunCMake/CMakePresetsWorkflow/check.cmake new file mode 100644 index 0000000..e79c4f1 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/check.cmake @@ -0,0 +1,3 @@ +set(CMakePresets_VALIDATE_SCRIPT_PATH "${RunCMake_SOURCE_DIR}/../CMakePresets/validate_schema.py") +include("${RunCMake_SOURCE_DIR}/../CMakePresets/validate_schema.cmake") +include("${RunCMake_SOURCE_DIR}/../CMakePresets/check.cmake") diff --git a/Tests/RunCMake/CMakePresetsWorkflow/cpack_staging.cmake.in b/Tests/RunCMake/CMakePresetsWorkflow/cpack_staging.cmake.in new file mode 100644 index 0000000..4030dfb --- /dev/null +++ b/Tests/RunCMake/CMakePresetsWorkflow/cpack_staging.cmake.in @@ -0,0 +1 @@ +message(STATUS "Testing the package step at @RunCMake_TEST_BINARY_DIR@") |