@@ -484,7 +484,7 @@ const ArgType = Union{Module,PatternX,AbstractString,AbstractArray,Tuple,Symbol,
484
484
[id::Bool], shuffle::Bool=false, recursive::Bool=true,
485
485
static::Union{Bool,Nothing}=nothing, dup::Bool=false,
486
486
load::Bool=false, seed::Union{Integer,Bool}=false,
487
- marks::Bool=true)
487
+ marks::Bool=true, spin::Bool=true )
488
488
489
489
Run tests declared with [`@testset`](@ref) blocks, within modules `mod` if specified,
490
490
or within all currently loaded modules otherwise.
@@ -528,6 +528,12 @@ Filtering `pattern`s can be specified to run only a subset of the tests.
528
528
is performed, and if `seed === true`, a seed is chosen randomly.
529
529
* When `marks` and `dry` are `true`, "check marks" are printed next to testsets
530
530
which passed or failed in previous runs.
531
+ * When `spin` is `true`, the description of the testset being currently executed
532
+ is shown (if there is only one), as well as a "spinner". This is disabled when
533
+ all the available threads/workers are used to run tests (i.e. typically
534
+ `Threads.nthreads()` should be greater than `1` for `spin` to take effect).
535
+ Note also that this feature slows down a bit the execution of tests.
536
+
531
537
532
538
### Filtering
533
539
@@ -615,10 +621,11 @@ function retest(@nospecialize(args::ArgType...);
615
621
load:: Bool = false ,
616
622
seed:: Integer = false ,
617
623
marks:: Bool = true ,
624
+ spin:: Bool = true ,
618
625
)
619
626
620
- dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks =
621
- update_keywords (args, dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks)
627
+ dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks, spin =
628
+ update_keywords (args, dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks, spin )
622
629
623
630
implicitmodules, modules, verbose = process_args (args; verbose= verbose, shuffle= shuffle,
624
631
recursive= recursive, load= load)
@@ -724,7 +731,8 @@ function retest(@nospecialize(args::ArgType...);
724
731
725
732
printlock = ReentrantLock ()
726
733
previewchan =
727
- if stdout isa Base. TTY && (nthreads () > 1 && VERSION >= v " 1.3" || nprocs () > 1 )
734
+ if spin && stdout isa Base. TTY && (nthreads () > 1 && VERSION >= v " 1.3" ||
735
+ nprocs () > 1 )
728
736
RemoteChannel (() -> Channel {Maybe{Tuple{Int64,String}}} (Inf ))
729
737
# needs to be "remote" in the case nprocs() == 2, as then nworkers() == 1,
730
738
# which means the one remote worker will put descriptions on previewchan
@@ -1056,7 +1064,7 @@ end
1056
1064
1057
1065
# hidden feature, shortcuts for passing kwargs to retest
1058
1066
function update_keywords (@nospecialize (args), dry, stats, shuffle, group, verbose,
1059
- recursive, id, strict, dup, static, marks)
1067
+ recursive, id, strict, dup, static, marks, spin )
1060
1068
for arg in args
1061
1069
if arg isa Symbol
1062
1070
for c in string (arg)
@@ -1085,13 +1093,15 @@ function update_keywords(@nospecialize(args), dry, stats, shuffle, group, verbos
1085
1093
static = val
1086
1094
elseif c == ' m'
1087
1095
marks = val
1096
+ elseif c == ' p'
1097
+ spin = val
1088
1098
else
1089
1099
error (" bad keyword shortcut" )
1090
1100
end
1091
1101
end
1092
1102
end
1093
1103
end
1094
- dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks
1104
+ dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks, spin
1095
1105
end
1096
1106
1097
1107
function process_args (@nospecialize (args);
0 commit comments