-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Help wanted: switch Base.Test to use testsets everywhere #17165
Changes from 1 commit
3510df9
5da10b5
7d38fb9
17637fc
41bba34
22fd4ae
c08ca0e
27262ac
f8413b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1788,6 +1788,8 @@ for op in (:.+, :.*, :.÷, :.%, :.<<, :.>>, :.-, :./, :.\, :.//, :.^) | |
@eval @test typeof($(op)(A,A)) == Matrix{Foo} | ||
end | ||
|
||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was mistakenly deleted in an earlier commit, in order for intermediate commits to pass the re-addition should be squashed into the same commit that deleted it |
||
|
||
# Test that concatenations of dense matrices/vectors yield dense matrices/vectors | ||
let | ||
N = 4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file is a part of Julia. License is MIT: http://Julialang.org/license | ||
# This file is a part of Julia. License is MIT: http://julialang.org/license | ||
|
||
module DatesAdjustersTests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you remember why these were made modules? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because these tests were overwriting lots of function names from |
||
using Base.Test | ||
|
@@ -389,7 +389,7 @@ isthanksgiving(dt) = Dates.dayofweek(dt) == Dates.Thu && | |
Dates.month(dt) == Dates.Nov && Dates.dayofweekofmonth(dt) == 4 | ||
|
||
function easter(y) | ||
# Butcher's Algorithm: http://www.sMart.net/~mmontes/butcher.html | ||
# Butcher's Algorithm: http://www.smart.net/~mmontes/butcher.html | ||
a=y%19 | ||
b=div(y,100) | ||
c=y%100 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,33 +74,44 @@ cd(dirname(@__FILE__)) do | |
o_ts = Base.Test.DefaultTestSet("Overall") | ||
Base.Test.push_testset(o_ts) | ||
for res in results | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this new code could use some comments explaining what's going on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comments please |
||
if isa(res[2][1], Exception) | ||
Base.showerror(STDERR,res[2][1]) | ||
elseif isa(res[2][1], Base.Test.DefaultTestSet) | ||
Base.Test.push_testset(res[2][1]) | ||
Base.Test.record(o_ts, res[2][1]) | ||
Base.Test.pop_testset() | ||
if isa(res[2][1], Base.Test.DefaultTestSet) | ||
Base.Test.push_testset(res[2][1]) | ||
Base.Test.record(o_ts, res[2][1]) | ||
Base.Test.pop_testset() | ||
elseif isa(res[2][1], Tuple{Int,Int}) | ||
fake = Base.Test.DefaultTestSet(res[1]) | ||
[Base.Test.record(fake, Base.Test.Pass(:test, nothing, nothing, nothing)) for i in 1:res[2][1][1]] | ||
[Base.Test.record(fake, Base.Test.Broken(:test, nothing)) for i in 1:res[2][1][2]] | ||
Base.Test.push_testset(fake) | ||
Base.Test.record(o_ts, fake) | ||
Base.Test.pop_testset() | ||
fake = Base.Test.DefaultTestSet(res[1]) | ||
[Base.Test.record(fake, Base.Test.Pass(:test, nothing, nothing, nothing)) for i in 1:res[2][1][1]] | ||
[Base.Test.record(fake, Base.Test.Broken(:test, nothing)) for i in 1:res[2][1][2]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the arrays aren't actually getting used here, right? would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably. I'll give it a spin. |
||
Base.Test.push_testset(fake) | ||
Base.Test.record(o_ts, fake) | ||
Base.Test.pop_testset() | ||
elseif isa(res[2][1], RemoteException) | ||
println("Worker $(res[2][1].pid) failed running test $(res[1]):") | ||
Base.showerror(STDOUT,res[2][1].captured) | ||
o_ts.anynonpass = true | ||
if isa(res[2][1].captured.ex, Base.Test.TestSetException) | ||
fake = Base.Test.DefaultTestSet(res[1]) | ||
[Base.Test.record(fake, Base.Test.Pass(:test, nothing, nothing, nothing)) for i in 1:res[2][1].captured.ex.pass] | ||
[Base.Test.record(fake, Base.Test.Broken(:test, nothing)) for i in 1:res[2][1].captured.ex.broken] | ||
for t in res[2][1].captured.ex.errors_and_fails | ||
Base.Test.record(fake, t) | ||
end | ||
Base.Test.push_testset(fake) | ||
Base.Test.record(o_ts, fake) | ||
Base.Test.pop_testset() | ||
end | ||
end | ||
end | ||
println() | ||
Base.Test.print_test_results(o_ts,1) | ||
for res in results | ||
if !isa(res[2][1], Exception) | ||
if !isa(res[2][1], RemoteException) | ||
rss_str = @sprintf("%7.2f",res[2][6]/2^20) | ||
time_str = @sprintf("%7f",res[2][2]) | ||
gc_str = @sprintf("%7f",res[2][5].total_time/10^9) | ||
percent_str = @sprintf("%7.2f",100*res[2][5].total_time/(10^9*res[2][2])) | ||
alloc_str = @sprintf("%7.2f",res[2][3]/2^20) | ||
println("Tests for $(res[1]):\n\ttook $time_str seconds, of which $gc_str were spent in gc ($percent_str % ),\n\tallocated $alloc_str MB,\n\twith rss $rss_str MB") | ||
else | ||
o_ts.anynonpass = true | ||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this field be concretely typed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and I guess some dummy cases where you're sending
nothing
could be replaced by empty arrays? this field holds an array of something (right?), is the element type always the same and known?