Skip to content

Commit

Permalink
CMake: Build standalone tests out of source in Coin
Browse files Browse the repository at this point in the history
Due to a bug in upstream CMake regarding relative paths being encoded
into the build.ninja file when performing in source builds, we need to
build the tests in a standalone directory outside of the source
directory.

Failing to do so will cause the source directory for the test to be
incorrect which can cause tests to fails and never read the
BLACKLIST.txt file. See the mentioned issue for details.

Task-number: QTBUG-82820
Change-Id: Ie5c178a92369d6b9decff625bd9641e53088a9fa
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
Leander Beernaert authored and alcroito committed Mar 11, 2020
1 parent c977e74 commit 3c85440
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions coin/instructions/cmake_build_and_upload_test_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ instructions:
- type: ChangeDirectory
directory: "{{.SourceDir}}"
- type: MakeDirectory
directory: "standalone_tests"
directory: "{{.SourceDir}}_standalone_tests"
- type: SetBuildDirectory
directory: "{{.SourceDir}}/standalone_tests"
directory: "{{.SourceDir}}_standalone_tests"
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: EnvironmentVariable
Expand Down
8 changes: 3 additions & 5 deletions coin/instructions/cmake_regular_test_instructions.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
type: Group
instructions:
- type: ChangeDirectory
directory: "{{.SourceDir}}"
- type: MakeDirectory
directory: "standalone_tests"
directory: "{{.SourceDir}}_standalone_tests"
- type: InstallTestBinaryArchive
relativeStoragePath: "{{.Env.MODULE_ARTIFACTS_RELATIVE_STORAGE_PATH}}/tests.tar.gz"
directory: "{{.SourceDir}}/standalone_tests"
directory: "{{.SourceDir}}_standalone_tests"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to install tests archive.
- type: ChangeDirectory
directory: "{{.SourceDir}}/standalone_tests"
directory: "{{.SourceDir}}_standalone_tests"
- type: ExecuteCommand
command: "ctest -V --rerun-failed"
ignoreExitCode: true
Expand Down

0 comments on commit 3c85440

Please sign in to comment.