@@ -483,7 +483,8 @@ const ArgType = Union{Module,PatternX,AbstractString,AbstractArray,Tuple,Symbol,
483
483
dry::Bool=false, stats::Bool=false, verbose::Real=true,
484
484
[id::Bool], shuffle::Bool=false, recursive::Bool=true,
485
485
static::Union{Bool,Nothing}=nothing, dup::Bool=false,
486
- load::Bool=false, [seed::Integer], marks::Bool=true)
486
+ load::Bool=false, seed::Union{Integer,Bool}=false,
487
+ marks::Bool=true)
487
488
488
489
Run tests declared with [`@testset`](@ref) blocks, within modules `mod` if specified,
489
490
or within all currently loaded modules otherwise.
@@ -523,7 +524,8 @@ Filtering `pattern`s can be specified to run only a subset of the tests.
523
524
are associated to `Mod` (they inherit its pattern specification as
524
525
above), and are cached and used again on subsequent invocations.
525
526
* If `seed` is provided, it is used to seed the global RNG before running
526
- the tests.
527
+ the tests. As a special case, if `seed === false` (the default), no seeding
528
+ is performed, and if `seed === true`, a seed is chosen randomly.
527
529
* When `marks` and `dry` are `true`, "check marks" are printed next to testsets
528
530
which passed or failed in previous runs.
529
531
@@ -611,7 +613,7 @@ function retest(@nospecialize(args::ArgType...);
611
613
dup:: Bool = false ,
612
614
static:: Maybe{Bool} = nothing ,
613
615
load:: Bool = false ,
614
- seed:: Maybe{ Integer} = nothing ,
616
+ seed:: Integer = false ,
615
617
marks:: Bool = true ,
616
618
)
617
619
@@ -920,10 +922,18 @@ function retest(@nospecialize(args::ArgType...);
920
922
@async put! (computechan, nothing )
921
923
end
922
924
923
- if seed != = nothing
924
- let includestr = """
925
+ if seed != = false
926
+ let seedstr =
927
+ if seed === true
928
+ # seed!(nothing) doesn't work on old Julia, so we can't just set
929
+ # `seed = nothing` and interpolate `seed` directly in includestr
930
+ " "
931
+ else
932
+ string (seed)
933
+ end ,
934
+ includestr = """
925
935
using Random
926
- Random.seed!($seed )
936
+ Random.seed!($seedstr )
927
937
nothing
928
938
"""
929
939
# can't use `@everywhere using Random`, as here is not toplevel
0 commit comments