CMake: Build standalone tests out of source in Coin

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 <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2020-03-11 14:17:50 +01:00 committed by Alexandru Croitor
parent c977e74afd
commit 3c85440b16
2 changed files with 5 additions and 7 deletions

View File

@ -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

View File

@ -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