Skip to content

Commit 06661c4

Browse files
committed
tests: don't define TESTNAMES in recent Julia versions
`TESTNAMES` was recently defined as a global variable in "julia/test/choosetests.jl".
1 parent 40e4a99 commit 06661c4

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/hijack.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function hijack(packagemod::Module, modname=nothing; parentmodule::Module=Main,
245245
end
246246

247247
if packagemod === Base
248-
hijack_base(ChooseTests.BASETESTS,
248+
hijack_base(:_Base_tests,
249249
base=modname, parentmodule=parentmodule, lazy=lazy, revise=revise)
250250
elseif startswith(packagepath, Sys.STDLIB) # packagemod is an STDLIB
251251
hijack_base(string(packagemod), modname,
@@ -483,6 +483,12 @@ const BASETESTPATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test")
483483
function call_choosetests(choices)
484484
isdefined(ChooseTests, :STDLIBS) ||
485485
include(joinpath(BASETESTPATH, "choosetests.jl"))
486+
487+
if choices === :_Base_tests
488+
# we compute choices lazily, as in recent Julia versions, TESTNAMES is defined
489+
# globally in choosetests.jl, and therefore defined only after the include above
490+
choices = filter(x -> x != "stdlib", TESTNAMES)
491+
end
486492
Base.invokelatest(choosetests, choices)
487493
end
488494

@@ -501,7 +507,8 @@ function test_path(test)
501507
end
502508
end
503509

504-
const TESTNAMES = [
510+
if VERSION < v"1.8.0-DEV.34"
511+
const TESTNAMES = [
505512
"subarray", "core", "compiler", "worlds",
506513
"keywordargs", "numbers", "subtype",
507514
"char", "strings", "triplequote", "unicode", "intrinsics",
@@ -525,9 +532,8 @@ const TESTNAMES = [
525532
"channels", "iostream", "secretbuffer", "specificity",
526533
"reinterpretarray", "syntax", "corelogging", "missing", "asyncmap",
527534
"smallarrayshrink", "opaque_closure"
528-
]
529-
530-
const BASETESTS = filter(x -> x != "stdlib", TESTNAMES)
535+
]
536+
end
531537

532538
const BLACKLIST = [
533539
# failing at load time (in hijack_base)

0 commit comments

Comments
 (0)