@@ -478,6 +478,26 @@ const ArgType = Union{Module,PatternX,AbstractString,AbstractArray,Tuple,Symbol,
478
478
Pair{Module,
479
479
<: Union{PatternX,AbstractString,AbstractArray,Tuple} }}
480
480
481
+ const retest_defaults = (
482
+ dry = false ,
483
+ stats = false ,
484
+ shuffle = false ,
485
+ group = true ,
486
+ verbose = true ,
487
+ recursive = true ,
488
+ id = nothing ,
489
+ strict = true ,
490
+ dup = false ,
491
+ static = nothing ,
492
+ load = false ,
493
+ seed = false ,
494
+ marks = true ,
495
+ spin = true ,
496
+ )
497
+
498
+ def (kw:: Symbol ) = retest_defaults[kw]
499
+
500
+
481
501
"""
482
502
retest(mod..., pattern...;
483
503
dry::Bool=false, stats::Bool=false, verbose::Real=true,
@@ -608,20 +628,21 @@ i.e. this is equivalent to specifying `sub => (pattern, subpat)`.
608
628
module in which it was written (e.g. `mod`, when specified).
609
629
"""
610
630
function retest (@nospecialize (args:: ArgType... );
611
- dry:: Bool = false ,
612
- stats:: Bool = false ,
613
- shuffle:: Bool = false ,
614
- group:: Bool = true ,
615
- verbose:: Real = true , # should be @nospecialize, but not supported on old Julia
616
- recursive:: Bool = true ,
617
- id:: Maybe{Bool} = nothing ,
618
- strict:: Bool = true ,
619
- dup:: Bool = false ,
620
- static:: Maybe{Bool} = nothing ,
621
- load:: Bool = false ,
622
- seed:: Integer = false ,
623
- marks:: Bool = true ,
624
- spin:: Bool = true ,
631
+ dry:: Bool = def (:dry ),
632
+ stats:: Bool = def (:stats ),
633
+ shuffle:: Bool = def (:shuffle ),
634
+ group:: Bool = def (:group ),
635
+ # should be @nospecialize, but not supported on old Julia
636
+ verbose:: Real = def (:verbose ),
637
+ recursive:: Bool = def (:recursive ),
638
+ id:: Maybe{Bool} = def (:id ),
639
+ strict:: Bool = def (:strict ),
640
+ dup:: Bool = def (:dup ),
641
+ static:: Maybe{Bool} = def (:static ),
642
+ load:: Bool = def (:load ),
643
+ seed:: Integer = def (:seed ),
644
+ marks:: Bool = def (:marks ),
645
+ spin:: Bool = def (:spin ),
625
646
)
626
647
627
648
dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks, spin =
@@ -1107,8 +1128,8 @@ end
1107
1128
function process_args (@nospecialize (args);
1108
1129
# defaults for keywords are added just for process_args to be more
1109
1130
# easily called from test code
1110
- # TODO : set defaults in global variables to help stay in sync?
1111
- verbose = true , shuffle = false , recursive= true , load:: Bool = false )
1131
+ verbose = def ( :verbose ), shuffle = def ( :shuffle ),
1132
+ recursive= def ( :recursive ) , load:: Bool = def ( :load ) )
1112
1133
# ######### process args
1113
1134
patterns = PatternX[] # list of standalone patterns
1114
1135
modpats = Dict {Module,Any} () # pairs module => pattern
0 commit comments