aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-22 20:28:56 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-25 07:24:56 -0400
commit9b22b69454de45d37ae0bd5ebbefa8538d36197f (patch)
tree420ae465c615759b53d4d79ad9bd9f49d4f460c3
parentc065b0d75f3039030ca7de36397585c66542574b (diff)
downloadrneovim-9b22b69454de45d37ae0bd5ebbefa8538d36197f.tar.gz
rneovim-9b22b69454de45d37ae0bd5ebbefa8538d36197f.tar.bz2
rneovim-9b22b69454de45d37ae0bd5ebbefa8538d36197f.zip
CI/Appveyor: set powershell strict mode
Set-PSDebug produces too much noise and has global scope. Strict mode is scoped to the script context and catches errors.
-rw-r--r--ci/build.ps18
1 files changed, 2 insertions, 6 deletions
diff --git a/ci/build.ps1 b/ci/build.ps1
index 6d91b97aed..8f7fdd5f59 100644
--- a/ci/build.ps1
+++ b/ci/build.ps1
@@ -1,10 +1,10 @@
+Set-StrictMode -Version Latest
$ErrorActionPreference = 'stop'
-Set-PSDebug -Strict -Trace 1
$isPullRequest = ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null)
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
$compiler = $Matches.compiler
-$compileOption = $Matches.option
+$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
$bits = $Matches.bits
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
@@ -23,7 +23,6 @@ $uploadToCodeCov = $false
function exitIfFailed() {
if ($LastExitCode -ne 0) {
- Set-PSDebug -Off
exit $LastExitCode
}
}
@@ -146,8 +145,6 @@ if ($env:USE_LUACOV -eq 1) {
# Functional tests
# The $LastExitCode from MSBuild can't be trusted
$failed = $false
-# Temporarily turn off tracing to reduce log file output
-Set-PSDebug -Off
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
foreach { $failed = $failed -or
$_ -match 'functional tests failed with error'; $_ }
@@ -161,7 +158,6 @@ if ($uploadToCodecov) {
if ($failed) {
exit $LastExitCode
}
-Set-PSDebug -Strict -Trace 1
# Old tests
# Add MSYS to path, required for e.g. `find` used in test scripts.