mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
ci: add pre-test step
This commit is contained in:
4
.gitlab/ci/pre_test.ps1
Normal file
4
.gitlab/ci/pre_test.ps1
Normal file
@@ -0,0 +1,4 @@
|
||||
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName
|
||||
if (Test-Path -Path ".gitlab/ci/pre_test_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) {
|
||||
. ".gitlab/ci/pre_test_$env:CMAKE_CONFIGURATION.ps1"
|
||||
}
|
18
.gitlab/ci/pre_test.sh
Executable file
18
.gitlab/ci/pre_test.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
quietly() {
|
||||
readonly log="/tmp/quietly-$RANDOM.log"
|
||||
if ! "$@" >"$log" 2>&1; then
|
||||
ret=$?
|
||||
cat "$log"
|
||||
rm -f "$log"
|
||||
exit $ret
|
||||
fi
|
||||
rm -f "$log"
|
||||
}
|
||||
|
||||
if test -r ".gitlab/ci/pre_test_${CMAKE_CONFIGURATION}.sh"; then
|
||||
source ".gitlab/ci/pre_test_${CMAKE_CONFIGURATION}.sh"
|
||||
fi
|
@@ -729,6 +729,7 @@
|
||||
|
||||
script:
|
||||
- *before_script_linux
|
||||
- .gitlab/ci/pre_test.sh
|
||||
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake"
|
||||
|
||||
interruptible: true
|
||||
|
@@ -214,6 +214,7 @@
|
||||
|
||||
script:
|
||||
- *before_script_macos
|
||||
- .gitlab/ci/pre_test.sh
|
||||
- ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
|
||||
|
||||
interruptible: true
|
||||
|
@@ -471,6 +471,7 @@
|
||||
script:
|
||||
- *before_script_windows
|
||||
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
|
||||
- (& "$pwsh" -File ".gitlab/ci/pre_test.ps1")
|
||||
- ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
|
||||
|
||||
interruptible: true
|
||||
|
Reference in New Issue
Block a user