Prepare for running tests with cmake

This is just a small step towards the situation where we build the tests
during the module build phase and later extract and merely run them.

The general steps we need are:

    * build tests separately, which includes the cmake test plan
    * let coin archive the tests (build) directory
    * in the test VM unpack everything
    * run ctest on the test plan that was part of the tests archive

This patch implements the first two steps.

Change-Id: Ifb8321015d0d18ad20e8cf20bb8b746030202daf
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
bb10
Simon Hausmann 2019-06-19 16:10:10 +02:00
parent 174d870635
commit b0bd50d339
1 changed files with 30 additions and 5 deletions

View File

@ -169,14 +169,11 @@ build_instructions:
property: host.os
equals_value: Windows
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -GNinja {{.SourceDir}}"
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF -GNinja {{.SourceDir}}"
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed to call cmake. Contact Liang then.
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: "{{.InstallRoot}}"
- type: ExecuteCommand # TODO: remove me, just debuging
command: cmd.exe /c type {{.BuildDir}}\\CMakeCache.txt
enable_if:
@ -196,7 +193,16 @@ build_instructions:
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed to install sources. In the current state bug can be everywhere. Contact Liang first.
Failed to install package.
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: "{{.InstallRoot}}"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake --install ."
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed to install package for archiving.
- type: SignPackage
enable_if:
condition: property
@ -210,6 +216,25 @@ build_instructions:
transferType: UploadModuleBuildArtifact
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
- type: ChangeDirectory
directory: "{{.SourceDir}}/tests"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_PREFIX_PATH:PATH={{.InstallDir}} -GNinja {{.SourceDir}}/tests"
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed to call cmake. Contact Liang then.
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake --build ."
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed to build sources. In the current state bug can be everywhere. Contact Liang first.
- type: UploadTestArtifact
transferType: UploadModuleTestsArtifact
archiveDirectory: "{{.SourceDir}}/tests"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
test_instructions:
- type: ExecuteCommand
command: echo "hello world - test"