Skip to content

Instantly share code, notes, and snippets.

@torarnv
Created May 28, 2024 13:24
Show Gist options
  • Save torarnv/66cc8cc213c7a9442510afba60bc02eb to your computer and use it in GitHub Desktop.
Save torarnv/66cc8cc213c7a9442510afba60bc02eb to your computer and use it in GitHub Desktop.
diff --git i/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml w/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
index a7039b5015e..6543c6bbfd6 100644
--- i/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
+++ w/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
@@ -104,14 +104,35 @@ 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
+ - type: Group
+ enable_if:
+ condition: runtime
+ env_var: IGNORE_CTEST_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: IGNORE_CTEST_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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment