diff --git a/coin/instructions/cmake_regular_test_instructions.yaml b/coin/instructions/cmake_regular_test_instructions.yaml index 5d3571c5d83..4b21c47b72e 100644 --- a/coin/instructions/cmake_regular_test_instructions.yaml +++ b/coin/instructions/cmake_regular_test_instructions.yaml @@ -1,8 +1,15 @@ type: Group instructions: - - !include "{{qt/qtbase}}/cmake_regular_test_instructions_common.yaml" - - !include "{{qt/qtbase}}/cmake_run_ctest_ignore_exit_code.yaml" -disable_if: - condition: property - property: configureArgs - contains_value: "-DBUILD_SHARED_LIBS=OFF" + - type: MakeDirectory + directory: "{{.SourceDir}}_standalone_tests" + - type: InstallTestBinaryArchive + relativeStoragePath: "{{.Env.MODULE_ARTIFACTS_RELATIVE_STORAGE_PATH}}/tests.tar.gz" + directory: "{{.SourceDir}}_standalone_tests" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install tests archive. + - type: ChangeDirectory + directory: "{{.SourceDir}}_standalone_tests" + + - !include "{{qt/qtbase}}/cmake_run_ctest.yaml" diff --git a/coin/instructions/cmake_regular_test_instructions_common.yaml b/coin/instructions/cmake_regular_test_instructions_common.yaml deleted file mode 100644 index ec6f23a3f76..00000000000 --- a/coin/instructions/cmake_regular_test_instructions_common.yaml +++ /dev/null @@ -1,13 +0,0 @@ -type: Group -instructions: - - type: MakeDirectory - directory: "{{.SourceDir}}_standalone_tests" - - type: InstallTestBinaryArchive - relativeStoragePath: "{{.Env.MODULE_ARTIFACTS_RELATIVE_STORAGE_PATH}}/tests.tar.gz" - directory: "{{.SourceDir}}_standalone_tests" - maxTimeInSeconds: 1200 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install tests archive. - - type: ChangeDirectory - directory: "{{.SourceDir}}_standalone_tests" diff --git a/coin/instructions/cmake_regular_test_instructions_enforced.yaml b/coin/instructions/cmake_regular_test_instructions_enforced.yaml deleted file mode 100644 index 197b925c2ae..00000000000 --- a/coin/instructions/cmake_regular_test_instructions_enforced.yaml +++ /dev/null @@ -1,4 +0,0 @@ -type: Group -instructions: - - !include "{{qt/qtbase}}/cmake_regular_test_instructions_common.yaml" - - !include "{{qt/qtbase}}/cmake_run_ctest_enforce_exit_code.yaml" diff --git a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml b/coin/instructions/cmake_run_ctest.yaml similarity index 81% rename from coin/instructions/cmake_run_ctest_enforce_exit_code.yaml rename to coin/instructions/cmake_run_ctest.yaml index a7039b5015e..e51c9bbd76f 100644 --- a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml +++ b/coin/instructions/cmake_run_ctest.yaml @@ -104,14 +104,37 @@ instructions: property: features contains_value: TestOnly - - type: ExecuteCommand - command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - ignoreExitCode: false - maxTimeInSeconds: 10800 - maxTimeBetweenOutput: "{{.Env.COIN_COMMAND_OUTPUT_TIMEOUT}}" - userMessageOnFailure: > - Failed to run tests. + # Run CTest, with or without ignoring exit code + # FIXME: De-duplicate the CTest instruction when + # ignoreExitCode expands environment variables. + - type: Group + enable_if: + condition: runtime + env_var: COIN_CTEST_IGNORE_EXIT_CODE + not_equals_value: "1" + instructions: + - type: ExecuteCommand + command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + ignoreExitCode: false + maxTimeInSeconds: 10800 + maxTimeBetweenOutput: "{{.Env.COIN_COMMAND_OUTPUT_TIMEOUT}}" + userMessageOnFailure: > + Failed to run tests. + - type: Group + enable_if: + condition: runtime + env_var: COIN_CTEST_IGNORE_EXIT_CODE + equals_value: "1" + instructions: + - type: ExecuteCommand + command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + ignoreExitCode: true + maxTimeInSeconds: 10800 + maxTimeBetweenOutput: "{{.Env.COIN_COMMAND_OUTPUT_TIMEOUT}}" + userMessageOnFailure: > + Failed to run tests. - type: Group instructions: diff --git a/coin/instructions/cmake_run_ctest_ignore_exit_code.yaml b/coin/instructions/cmake_run_ctest_ignore_exit_code.yaml deleted file mode 100644 index b94717730bd..00000000000 --- a/coin/instructions/cmake_run_ctest_ignore_exit_code.yaml +++ /dev/null @@ -1,20 +0,0 @@ -type: Group -instructions: - - type: EnvironmentVariable - variableName: CTEST_ARGS - variableValue: "-V --rerun-failed --force-new-ctest-process" - - type: AppendToEnvironmentVariable - variableName: CTEST_ARGS - variableValue: " --stop-on-failure" - enable_if: - condition: property - property: features - contains_value: AbortTestingOnFirstFailure - - type: ExecuteCommand - command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - ignoreExitCode: true - maxTimeInSeconds: 10800 - maxTimeBetweenOutput: 900 - userMessageOnFailure: > - Failed to run tests. diff --git a/coin/instructions/coin_module_test_template_v2.yaml b/coin/instructions/coin_module_test_template_v2.yaml index 423d292bf71..37765846892 100644 --- a/coin/instructions/coin_module_test_template_v2.yaml +++ b/coin/instructions/coin_module_test_template_v2.yaml @@ -5,6 +5,9 @@ instructions: - !include "{{qt/qtbase}}/coin_module_test_template_common.yaml" - type: Group instructions: + - type: EnvironmentVariable + variableName: COIN_CTEST_IGNORE_EXIT_CODE + variableValue: "1" - !include "{{qt/qtbase}}/cmake_regular_test_instructions.yaml" enable_if: condition: or diff --git a/coin/instructions/coin_module_test_template_v3.yaml b/coin/instructions/coin_module_test_template_v3.yaml index de870b9d45d..83b40c141b0 100644 --- a/coin/instructions/coin_module_test_template_v3.yaml +++ b/coin/instructions/coin_module_test_template_v3.yaml @@ -5,7 +5,7 @@ instructions: - !include "{{qt/qtbase}}/coin_module_test_template_common.yaml" - type: Group instructions: - - !include "{{qt/qtbase}}/cmake_regular_test_instructions_enforced.yaml" + - !include "{{qt/qtbase}}/cmake_regular_test_instructions.yaml" enable_if: condition: or conditions: