File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed
Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ $PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
77
88$SourceDir = Split-Path (Split-Path (Get-Variable MyInvocation).Value.MyCommand.Path)
99$BuildDir = Get-Location
10+ $Success = $true
1011
1112if ($Env: SKIP_TESTS ) { exit }
1213
@@ -24,7 +25,7 @@ function run_test {
2425 Write-Host $TestCommand
2526 Invoke-Expression $TestCommand
2627
27- if ($LastExitCode -ne 0 ) { [ Environment ]:: Exit ( $LastExitCode ) }
28+ if ($LastExitCode -ne 0 ) { $Success = $false }
2829}
2930
3031Write-Host " ##############################################################################"
@@ -67,3 +68,5 @@ if (-not $Env:SKIP_PROXY_TESTS) {
6768
6869 taskkill / F / IM javaw.exe
6970}
71+
72+ if (-not $Success ) { exit 1 }
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ BUILD_DIR=$(pwd)
1111TMPDIR=${TMPDIR:-/ tmp}
1212USER=${USER:- $(whoami)}
1313
14+ SUCCESS=1
15+
1416VALGRIND=" valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\" $SOURCE_DIR /libgit2_clar.supp\" "
1517LEAKS=" MallocStackLogging=1 MallocScribble=1 leaks -quiet -atExit -- nohup"
1618
@@ -30,11 +32,9 @@ cleanup() {
3032 echo " Done."
3133}
3234
33- die () {
35+ failure () {
3436 echo " Test exited with code: $1 "
35-
36- cleanup
37- exit $1
37+ SUCCESS=0
3838}
3939
4040# Ask ctest what it would run if we were to invoke it directly. This lets
@@ -54,7 +54,7 @@ run_test() {
5454 RUNNER=" $TEST_CMD "
5555 fi
5656
57- eval $RUNNER || die $?
57+ eval $RUNNER || failure
5858}
5959
6060# Configure the test environment; run them early so that we're certain
@@ -194,10 +194,16 @@ if [ -z "$SKIP_FUZZERS" ]; then
194194 echo " ##############################################################################"
195195
196196 for fuzzer in fuzzers/* _fuzzer; do
197- " ${fuzzer} " " ${SOURCE_DIR} /fuzzers/corpora/$( basename " ${fuzzer% _fuzzer} " ) " || die $?
197+ " ${fuzzer} " " ${SOURCE_DIR} /fuzzers/corpora/$( basename " ${fuzzer% _fuzzer} " ) " || failure
198198 done
199199fi
200200
201- echo " Success."
202201cleanup
202+
203+ if [ " $SUCCESS " -ne " 1" ]; then
204+ echo " Some tests failed."
205+ exit 1
206+ fi
207+
208+ echo " Success."
203209exit 0
You can’t perform that action at this time.
0 commit comments