Skip to content

Commit c939e65

Browse files
committed
Don't bail out on test errors by default
Add JL_RUNTESTS_STOP environment variable to control fail-on-error behavior for the CI systems.
1 parent 0752339 commit c939e65

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ script:
6262
- cd .. && mv julia julia2
6363
- cp /tmp/julia/lib/julia/sys.ji local.ji && /tmp/julia/bin/julia-debug -J local.ji -e 'true' && rm local.ji
6464
- /tmp/julia/bin/julia-debug -e 'versioninfo()'
65-
- cd /tmp/julia/share/julia/test && /tmp/julia/bin/julia-debug --check-bounds=yes runtests.jl all && /tmp/julia/bin/julia-debug --check-bounds=yes runtests.jl pkg
65+
- cd /tmp/julia/share/julia/test && /tmp/julia/bin/julia-debug --check-bounds=yes runtests.jl all && JL_TESTFAILURE_STOP=1 /tmp/julia/bin/julia-debug --check-bounds=yes runtests.jl pkg
6666
- cd - && mv julia2 julia
6767
- echo "Ready for packaging..."

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ build_script:
5050

5151
test_script:
5252
- usr\bin\julia -e "versioninfo()"
53-
- cd test && ..\usr\bin\julia runtests.jl all
53+
- cd test && JL_TESTFAILURE_STOP=1 ..\usr\bin\julia runtests.jl all

test/runtests.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ cd(dirname(@__FILE__)) do
1010

1111
@everywhere include("testdefs.jl")
1212

13-
reduce(propagate_errors, nothing, pmap(runtests, tests; err_retry=false, err_stop=true))
13+
err_stop = haskey(ENV, "JL_TESTFAILURE_STOP")
14+
15+
results = reduce(propagate_errors, nothing, pmap(runtests, tests; err_retry=false, err_stop=err_stop))
1416

1517
@unix_only n > 1 && rmprocs(workers(), waitfor=5.0)
16-
println(" \033[32;1mSUCCESS\033[0m")
18+
all(x->x==false, results) && println(" \033[32;1mSUCCESS\033[0m")
1719
end

test/testdefs.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ function runtests(name)
88
end
99

1010
function propagate_errors(a,b)
11-
if isa(a,Exception)
11+
err_stop = haskey(ENV, "JL_TESTFAILURE_STOP")
12+
err = false
13+
if isa(a, Exception) || isa(b, Exception)
14+
err = true
15+
end
16+
if isa(a,Exception) && err_stop
1217
rethrow(a)
1318
end
14-
if isa(b,Exception)
19+
if isa(b,Exception) && err_stop
1520
rethrow(b)
1621
end
17-
nothing
22+
err
1823
end
1924

2025
# looking in . messes things up badly

0 commit comments

Comments
 (0)