-
-
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 5 commits
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# This file is a part of Julia. License is MIT: http://julialang.org/license | ||
|
||
module TestBroadcastInternals | ||
|
||
using Base.Broadcast: broadcast_indices, check_broadcast_indices, | ||
check_broadcast_shape, newindex, _bcs, _bcsm | ||
using Base: Test, OneTo | ||
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. Isn't 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. Derp, yes. Thanks! |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ Upon return, `tests` is a vector of fully-expanded test names, and | |
function choosetests(choices = []) | ||
testnames = [ | ||
"linalg", "subarray", "core", "inference", "keywordargs", "numbers", | ||
"printf", "char", "string", "triplequote", "unicode", | ||
"printf", "char", "strings", "triplequote", "unicode", | ||
"dates", "dict", "hashing", "iobuffer", "staged", "offsetarray", | ||
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. offsetarray probably shouldn't be deleted |
||
"arrayops", "tuple", "reduce", "reducedim", "random", "abstractarray", | ||
"intfuncs", "simdloop", "vecelement", "blas", "sparse", | ||
|
@@ -60,6 +60,57 @@ function choosetests(choices = []) | |
tests = testnames | ||
end | ||
|
||
datestests = ["dates/accessors", "dates/adjusters", "dates/query", | ||
"dates/periods", "dates/ranges", "dates/rounding", "dates/types", | ||
"dates/io", "dates/arithmetic", "dates/conversions"] | ||
if "dates" in skip_tests | ||
filter!(x -> (x != "dates" && !(x in datestests)), tests) | ||
elseif "dates" in tests | ||
# specifically selected case | ||
filter!(x -> x != "dates", tests) | ||
prepend!(tests, datestests) | ||
end | ||
|
||
unicodetests = ["unicode/UnicodeError", "unicode/utf8proc", "unicode/utf8"] | ||
if "unicode" in skip_tests | ||
filter!(x -> (x != "unicode" && !(x in unicodetests)), tests) | ||
elseif "unicode" in tests | ||
# specifically selected case | ||
filter!(x -> x != "unicode", tests) | ||
prepend!(tests, unicodetests) | ||
end | ||
|
||
stringtests = ["strings/basic", "strings/search", "strings/util", | ||
"strings/io", "strings/types"] | ||
if "strings" in skip_tests | ||
filter!(x -> (x != "strings" && !(x in stringtests)), tests) | ||
elseif "strings" in tests | ||
# specifically selected case | ||
filter!(x -> x != "strings", tests) | ||
prepend!(tests, stringtests) | ||
end | ||
|
||
|
||
sparsetests = ["sparse/sparse", "sparse/sparsevector"] | ||
if Base.USE_GPL_LIBS | ||
append!(sparsetests, ["sparse/umfpack", "sparse/cholmod", "sparse/spqr"]) | ||
end | ||
if "sparse" in skip_tests | ||
filter!(x -> (x != "sparse" && !(x in sparsetests)), tests) | ||
elseif "sparse" in tests | ||
# specifically selected case | ||
filter!(x -> x != "sparse", tests) | ||
prepend!(tests, sparsetests) | ||
end | ||
|
||
#do subarray before sparse but after linalg | ||
if "subarray" in skip_tests | ||
filter!(x -> x != "subarray", tests) | ||
elseif "subarray" in tests | ||
filter!(x -> x != "subarray", tests) | ||
prepend!(tests, ["subarray"]) | ||
end | ||
|
||
linalgtests = ["linalg/triangular", "linalg/qr", "linalg/dense", | ||
"linalg/matmul", "linalg/schur", "linalg/special", | ||
"linalg/eigen", "linalg/bunchkaufman", "linalg/svd", | ||
|
@@ -83,7 +134,7 @@ function choosetests(choices = []) | |
net_required_for = ["socket", "parallel", "libgit2"] | ||
net_on = true | ||
try | ||
getipaddr() | ||
ipa = getipaddr() | ||
catch | ||
warn("Networking unavailable: Skipping tests [" * join(net_required_for, ", ") * "]") | ||
net_on = false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# This file is a part of Julia. License is MIT: http://julialang.org/license | ||
|
||
# test core language features | ||
|
||
const Bottom = Union{} | ||
|
||
macro testintersect(args...) | ||
|
@@ -1108,7 +1107,7 @@ let | |
@test a==1 && b==2 | ||
end | ||
|
||
# issue #1876 | ||
@testset "issue #1876" begin | ||
let | ||
tst = 1 | ||
m1(i) = (tst+=1;i-1) | ||
|
@@ -1126,6 +1125,7 @@ let | |
X[r...] *= 2 | ||
@test X == [1,4,6,4] | ||
end | ||
end | ||
|
||
# issue #1632 | ||
let | ||
|
@@ -2301,24 +2301,26 @@ g9535() = (f9535(),f9535()) | |
|
||
# weak references | ||
type Obj; x; end | ||
@noinline function mk_wr(r, wr) | ||
x = Obj(1) | ||
push!(r, x) | ||
push!(wr, WeakRef(x)) | ||
end | ||
test_wr(r,wr) = @test r[1] == wr[1].value | ||
function test_wr() | ||
ref = [] | ||
wref = [] | ||
mk_wr(ref, wref) | ||
test_wr(ref, wref) | ||
gc() | ||
test_wr(ref, wref) | ||
pop!(ref) | ||
gc() | ||
@test wref[1].value === nothing | ||
@testset "weak references" begin | ||
@noinline function mk_wr(r, wr) | ||
x = Obj(1) | ||
push!(r, x) | ||
push!(wr, WeakRef(x)) | ||
end | ||
test_wr(r,wr) = @test r[1] == wr[1].value | ||
function test_wr() | ||
ref = [] | ||
wref = [] | ||
mk_wr(ref, wref) | ||
test_wr(ref, wref) | ||
gc() | ||
test_wr(ref, wref) | ||
pop!(ref) | ||
gc() | ||
@test wref[1].value == nothing | ||
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 should be 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. Done |
||
end | ||
test_wr() | ||
end | ||
test_wr() | ||
|
||
# issue #9947 | ||
function f9947() | ||
|
This file was deleted.
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?