summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-10-25 14:26:28 -0700
committerEdward Thomson <ethomson@edwardthomson.com>2018-10-25 14:26:28 -0700
commit0e26717a57169d1222bdebef3f0caa728fd85b75 (patch)
treec91311b833a36bbe979801477590aa8675dcb284
parentbea65980c7a42e34edfafbdc40b199ba7b2a564e (diff)
downloadlibgit2-ethomson/win_ci.tar.gz
ci: fail on test failuresethomson/win_ci
PowerShell can _read_ top-level variables in functions, but cannot _update_ top-level variables in functions unless they're explicitly prefixed with `$global`.
-rw-r--r--ci/test.ps16
1 files changed, 3 insertions, 3 deletions
diff --git a/ci/test.ps1 b/ci/test.ps1
index 7a55bff79..1cf02118f 100644
--- a/ci/test.ps1
+++ b/ci/test.ps1
@@ -7,7 +7,7 @@ $PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
$SourceDir = Split-Path (Split-Path (Get-Variable MyInvocation).Value.MyCommand.Path)
$BuildDir = Get-Location
-$Success = $true
+$global:Success = $true
if ($Env:SKIP_TESTS) { exit }
@@ -25,7 +25,7 @@ function run_test {
Write-Host $TestCommand
Invoke-Expression $TestCommand
- if ($LastExitCode -ne 0) { $Success = $false }
+ if ($LastExitCode -ne 0) { $global:Success = $false }
}
Write-Host "##############################################################################"
@@ -69,4 +69,4 @@ if (-not $Env:SKIP_PROXY_TESTS) {
taskkill /F /IM javaw.exe
}
-if (-not $Success) { exit 1 }
+if (-Not $global:Success) { exit 1 }