Skip to content

Commit

Permalink
ROUND 2: Multiple fixes, modules still (?) borken
Browse files Browse the repository at this point in the history
Now pipe error/failure info to STDERR on node1. I think the issue
with top-level typedefs is fixed now! Also, the test suite will
error in a stupid/ugly way when test(s) fail. But it does error.
  • Loading branch information
kshyatt committed Jul 2, 2016
1 parent 3d03a63 commit 2fc617b
Show file tree
Hide file tree
Showing 140 changed files with 43 additions and 325 deletions.
34 changes: 25 additions & 9 deletions base/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -424,21 +424,33 @@ record(ts::DefaultTestSet, t::Broken) = (push!(ts.results, t); t)
# For the other result types, immediately print the error message
# but do not terminate. Print a backtrace.
function record(ts::DefaultTestSet, t::Union{Fail, Error})
print_with_color(:white, ts.description, ": ")
print(t)
# don't print the backtrace for Errors because it gets printed in the show
# method
isa(t, Error) || Base.show_backtrace(STDOUT, backtrace())
println()
if myid() == 0
print_with_color(:white, ts.description, ": ")
print(t)
# don't print the backtrace for Errors because it gets printed in the show
# method
isa(t, Error) || Base.show_backtrace(STDOUT, backtrace())
println()
end
push!(ts.results, t)
t
t, isa(t, Error) || backtrace()
end

# When a DefaultTestSet finishes, it records itself to its parent
# testset, if there is one. This allows for recursive printing of
# the results at the end of the tests
record(ts::DefaultTestSet, t::AbstractTestSet) = push!(ts.results, t)

function print_test_errors(ts::DefaultTestSet)
for t in ts.results
if (isa(t, Error) || isa(t, Failure)) && myid() == 1
Base.show(STDERR,t)
elseif isa(t, DefaultTestSet)
print_test_errors(t)
end
end
end

function print_test_results(ts::DefaultTestSet, depth_pad=0)
# Calculate the overall number for each type so each of
# the test result types are aligned
Expand Down Expand Up @@ -531,8 +543,12 @@ function get_test_counts(ts::DefaultTestSet)
c_passes, c_fails, c_errors, c_broken = 0, 0, 0, 0
for t in ts.results
isa(t, Pass) && (passes += 1)
isa(t, Fail) && (fails += 1)
isa(t, Error) && (errors += 1)
if isa(t, Fail)
fails += 1
end
if isa(t, Error)
errors += 1
end
isa(t, Broken) && (broken += 1)
if isa(t, DefaultTestSet)
np, nf, ne, nb, ncp, ncf, nce , ncb = get_test_counts(t)
Expand Down
3 changes: 0 additions & 3 deletions test/abstractarray.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "abstractarray" begin
# Bounds checking
A = rand(3,3,3)
@test checkbounds(Bool, A, 1, 1, 1) == true
Expand Down Expand Up @@ -630,5 +629,3 @@ let
@test !issparse(m1)
@test !issparse(m2)
end

end
2 changes: 0 additions & 2 deletions test/ambiguous.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "ambiguous" begin
# DO NOT ALTER ORDER OR SPACING OF METHODS BELOW
const lineoffset = @__LINE__ + 0 # XXX: __LINE__ at the end of a line is off-by-one
ambig(x, y) = 1
Expand Down Expand Up @@ -171,4 +170,3 @@ let ms = methods(g16493, (Complex, Any))
end

nothing
end
3 changes: 0 additions & 3 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "arrayops" begin
#Array test

## basics
Expand Down Expand Up @@ -1663,5 +1662,3 @@ let A = zeros(3,3)
@test size(A[:,UInt(1):UInt(2)]) == (3,2)
@test size(similar(A, UInt(3), 0x3)) == size(similar(A, (UInt(3), 0x3))) == (3,3)
end

end
3 changes: 1 addition & 2 deletions test/backtrace.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license
@testset "backtrace" begin

bt = backtrace()
have_backtrace = false
for l in bt
Expand Down Expand Up @@ -96,4 +96,3 @@ let
@test i1 > 0 && i2 > 0
@test b1[i1].line != b2[i2].line
end
end
2 changes: 0 additions & 2 deletions test/bigfloat.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "bigfloat" begin
@test big(2.0)^big(3) == 8

for T in [Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, BigInt]
Expand All @@ -10,4 +9,3 @@ end

# issue 15659
@test (setprecision(53) do; big(1/3); end) < 1//3
end
2 changes: 0 additions & 2 deletions test/bigint.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "bigint" begin
a = parse(BigInt,"123456789012345678901234567890")
b = parse(BigInt,"123456789012345678901234567891")

Expand Down Expand Up @@ -312,4 +311,3 @@ ndigits(rand(big(-999:999)), big(2)^rand(2:999))

@test big(5)^true == big(5)
@test big(5)^false == one(BigInt)
end
3 changes: 0 additions & 3 deletions test/bitarray.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "bitarray" begin
tc{N}(r1::NTuple{N}, r2::NTuple{N}) = all(x->tc(x...), [zip(r1,r2)...])
tc{N}(r1::BitArray{N}, r2::Union{BitArray{N},Array{Bool,N}}) = true
tc{T}(r1::T, r2::T) = true
Expand Down Expand Up @@ -1353,5 +1352,3 @@ B = trues(Int64(10))
A = falses(Int32(10))
B = falses(Int64(10))
@test A == B

end
2 changes: 0 additions & 2 deletions test/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import Base.LinAlg, Base.LinAlg.BlasReal, Base.LinAlg.BlasComplex

@testset "blas" begin
srand(100)
# syr2k! and her2k!
for elty in (Float32, Float64, Complex64, Complex128)
Expand Down Expand Up @@ -297,4 +296,3 @@ for elty in [Float32, Float64, Complex64, Complex128]
end
end

end
3 changes: 0 additions & 3 deletions test/ccall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import Base.copy, Base.==

@testset "ccall" begin
const libccalltest = "libccalltest"

const verbose = false
Expand Down Expand Up @@ -714,5 +713,3 @@ elseif Sys.ARCH === :aarch64
@test res === expected
end
end

end
2 changes: 0 additions & 2 deletions test/char.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "char" begin
@test typemin(Char) == Char(0)
@test ndims(Char) == 0
@test getindex('a', 1) == 'a'
Expand Down Expand Up @@ -194,4 +193,3 @@ let
end

@test !isequal('x', 120)
end
2 changes: 0 additions & 2 deletions test/checked.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import Base: checked_abs, checked_neg, checked_add, checked_sub, checked_mul,
checked_div, checked_rem, checked_fld, checked_mod, checked_cld

@testset "checked" begin
# checked operations

for T in (Int8, Int16, Int32, Int64, Int128)
Expand Down Expand Up @@ -252,4 +251,3 @@ end

@test checked_mul(UInt128(3), UInt128(4)) === UInt128(12)
@test_throws OverflowError checked_mul(UInt128(2)^127, UInt128(2))
end
3 changes: 0 additions & 3 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "cmdlineargs" begin
let exename = `$(Base.julia_cmd()) --precompiled=yes`
# --version
let v = split(readstring(`$exename -v`), "julia version ")[end]
Expand Down Expand Up @@ -281,5 +280,3 @@ let exename = `$(Base.julia_cmd())`
@test readchomp(`$exename --precompiled=yes -E "Bool(Base.JLOptions().use_precompiled)"`) == "true"
@test readchomp(`$exename --precompiled=no -E "Bool(Base.JLOptions().use_precompiled)"`) == "false"
end

end
2 changes: 0 additions & 2 deletions test/combinatorics.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "combinatorics" begin
@test binomial(5,-1) == 0
@test binomial(5,10) == 0
@test binomial(5,3) == 10
Expand Down Expand Up @@ -63,4 +62,3 @@ if Int === Int32
@test factorial(Int32(12)) === Int32(479001600)
@test_throws OverflowError factorial(Int32(13))
end
end
2 changes: 0 additions & 2 deletions test/complex.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "complex" begin
@test reim(2 + 3im) == (2, 3)

for T in (Int64, Float64)
Expand Down Expand Up @@ -915,4 +914,3 @@ let x = 1+im
@inferred sin(x)
@inferred cos(x)
end
end
2 changes: 0 additions & 2 deletions test/copy.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "copy" begin
mainres = ([4, 5, 3],
[1, 5, 3])
bitres = ([true, true, false],
Expand Down Expand Up @@ -109,4 +108,3 @@ let x = BigFloat[1:1000;], y, z, v
# Check that the setprecision indeed does something
@test z != x
end
end
2 changes: 0 additions & 2 deletions test/datafmt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "datafmt" begin
# countlines
@test countlines(IOBuffer("\n")) == 1
@test countlines(IOBuffer("\n"),'\r') == 0
Expand Down Expand Up @@ -263,4 +262,3 @@ for writefunc in ((io,x) -> show(io, "text/csv", x),
@test vec(readcsv(io)) == x
end
end
end
2 changes: 0 additions & 2 deletions test/dates/accessors.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "accessors" begin
# yearmonthday is the opposite of totaldays
# taking Rata Die Day # and returning proleptic Gregorian date
@test Dates.yearmonthday(-306) == (0,2,29)
Expand Down Expand Up @@ -195,4 +194,3 @@ dr = [a,a,a,a,a,a,a,a,a,a]
@test Dates.second(dr) == repmat([0],10)
@test Dates.millisecond(dr) == repmat([0],10)

end
2 changes: 0 additions & 2 deletions test/dates/adjusters.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "adjustors" begin
#trunc
dt = Dates.Date(2012,12,21)
@test trunc(dt,Dates.Year) == Dates.Date(2012)
Expand Down Expand Up @@ -460,4 +459,3 @@ end) == 251
return sum == 15
end) == 15 # On average, there's one of those months every year

end
2 changes: 0 additions & 2 deletions test/dates/arithmetic.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "arithmetic" begin
# DateTime arithmetic
a = Dates.DateTime(2013,1,1,0,0,0,1)
b = Dates.DateTime(2013,1,1,0,0,0,0)
Expand Down Expand Up @@ -390,4 +389,3 @@ t4 = [DateTime(2009,1,1,0,0,1), DateTime(2009,1,2,0,1), DateTime(2009,1,3,1)]
@test (Date(2009,1,1):Week(1):Date(2009,1,21)) - (Date(2009,1,1):Day(1):Date(2009,1,3)) == [0d, 6d, 12d]
@test (DateTime(2009,1,1,1,1,1):Second(1):DateTime(2009,1,1,1,1,3)) - (DateTime(2009,1,1,1,1):Second(1):DateTime(2009,1,1,1,1,2)) == [1s, 1s, 1s]

end
2 changes: 0 additions & 2 deletions test/dates/conversions.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "conversions" begin
# Test conversion to and from unix
@test Dates.unix2datetime(Dates.datetime2unix(DateTime(2000,1,1))) == DateTime(2000,1,1)
@test Dates.value(Dates.DateTime(1970)) == Dates.UNIXEPOCH
Expand Down Expand Up @@ -104,4 +103,3 @@ b = Dates.Date(2000)
@test convert(Date,730120.0) == b
@test convert(Date,Int32(730120)) == b

end
2 changes: 0 additions & 2 deletions test/dates/io.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "io" begin
# Test string/show representation of Date
@test string(Dates.Date(1,1,1)) == "0001-01-01" # January 1st, 1 AD/CE
@test sprint(show, Dates.Date(1,1,1)) == "0001-01-01"
Expand Down Expand Up @@ -360,4 +359,3 @@ let
@test DateTime(ds, format) == dt
@test DateTime(ds, escaped_format) == dt
end
end
2 changes: 0 additions & 2 deletions test/dates/periods.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "periods" begin
# Period testing
@test -Dates.Year(1) == Dates.Year(-1)
@test Dates.Year(1) > Dates.Year(0)
Expand Down Expand Up @@ -382,4 +381,3 @@ cpa = [1y+1s 1m+1s 1w+1s 1d+1s; 1h+1s 1mi+1s 2m+1s 1s+1ms]
@test [1y+1s 1m+1s; 1w+1s 1d+1s] + [1y+1h 1y+1mi; 1y+1s 1y+1ms] == [2y+1h+1s 1y+1m+1mi+1s; 1y+1w+2s 1y+1d+1s+1ms]
@test [1y+1s 1m+1s; 1w+1s 1d+1s] - [1y+1h 1y+1mi; 1y+1s 1y+1ms] == [1s-1h 1m+1s-1y-1mi; 1w-1y 1d+1s-1y-1ms]

end
2 changes: 0 additions & 2 deletions test/dates/query.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "query" begin
# Name functions
jan = Dates.DateTime(2013,1,1) #Tuesday
feb = Dates.DateTime(2013,2,2) #Saturday
Expand Down Expand Up @@ -199,4 +198,3 @@ end
@test Dates.dayofquarter(Dates.DateTime(2014,9,30)) == 92
@test Dates.dayofquarter(Dates.DateTime(2014,12,31)) == 92

end
2 changes: 0 additions & 2 deletions test/dates/ranges.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "ranges" begin
function test_all_combos()
for T in (Dates.Date,Dates.DateTime)
f1 = T(2014); l1 = T(2013,12,31)
Expand Down Expand Up @@ -504,4 +503,3 @@ let d = Dates.Day(1)
@test (Dates.Date(2000):d:Dates.Date(2001))+d == (Dates.Date(2000)+d:d:Dates.Date(2001)+d)
@test (Dates.Date(2000):d:Dates.Date(2001))-d == (Dates.Date(2000)-d:d:Dates.Date(2001)-d)
end
end
2 changes: 0 additions & 2 deletions test/dates/types.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "types" begin
# Date internal algorithms
@test Dates.totaldays(0,2,28) == -307
@test Dates.totaldays(0,2,29) == -306
Expand Down Expand Up @@ -173,4 +172,3 @@ ms = Dates.Millisecond(1)
@test isfinite(Dates.Date)
@test isfinite(Dates.DateTime)

end
2 changes: 0 additions & 2 deletions test/dict.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

@testset "dict" begin
# Pair
p = Pair(1,2)
@test p == (1=>2)
Expand Down Expand Up @@ -551,4 +550,3 @@ let badKeys = UInt16[0xb800,0xa501,0xcdff,0x6303,0xe40a,0xcf0e,0xf3df,0xae99,0x9
end
end
end
end
2 changes: 0 additions & 2 deletions test/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import Base.Docs: meta, @var, DocStr, parsedoc

@testset "docs" begin
# Test helpers.
function docstrings_equal(d1, d2)
io1 = IOBuffer()
Expand Down Expand Up @@ -882,4 +881,3 @@ for (line, expr) in Pair[
]
@test Docs.helpmode(line) == :(Base.Docs.@repl($expr))
end
end
Loading

0 comments on commit 2fc617b

Please sign in to comment.