From b0bd50d33966d93ba5e24ac6be0c849ce501eed6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 19 Jun 2019 16:10:10 +0200 Subject: Prepare for running tests with cmake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- coin/module_config.yaml | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'coin') diff --git a/coin/module_config.yaml b/coin/module_config.yaml index f15e07d498..210da62495 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -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" -- cgit v1.2.3