@@ -590,21 +590,18 @@ function retest(@nospecialize(args::ArgType...);
590
590
591
591
implicitmodules, modules, verbose = process_args (args; verbose= verbose, shuffle= shuffle,
592
592
recursive= recursive, load= load)
593
- # overall: print header for each module, and "Overall" summary for all modules
593
+ # overall: print header for each module, and probably "Overall" summary for all modules
594
594
overall = length (modules) > 1
595
- moduleheader = overall | implicitmodules
595
+ module_header = overall | implicitmodules
596
596
root = Testset. ReTestSet (Main, " Overall" , overall= true )
597
597
598
598
maxidw = Ref {Int} (0 ) # visual width for showing IDs (Ref for mutability in hack below)
599
- tests_descs_hasbrokens = fetchtests .(modules, verbose, moduleheader , Ref (maxidw);
599
+ tests_descs_hasbrokens = fetchtests .(modules, verbose, module_header , Ref (maxidw);
600
600
strict= strict, dup= dup, static= static)
601
601
isempty (tests_descs_hasbrokens) &&
602
602
throw (ArgumentError (" no modules using ReTest could be found" ))
603
603
604
604
alltests = first .(tests_descs_hasbrokens)
605
- descwidth = max (textwidth (root. description),
606
- maximum (x-> x[2 ], tests_descs_hasbrokens))
607
- format = Format (stats, descwidth)
608
605
hasbroken = any (last .(tests_descs_hasbrokens))
609
606
610
607
emptymods = findall (isempty, alltests)
@@ -623,6 +620,13 @@ function retest(@nospecialize(args::ArgType...);
623
620
hasinteger (pat)
624
621
end )
625
622
623
+ descwidth = maximum (x-> x[2 ], tests_descs_hasbrokens)
624
+ if nmodules > 1 # might be different to overall, if !isempty(emptymods)
625
+ # this is the condition for printing "Overall" summary
626
+ descwidth = max (descwidth, textwidth (root. description))
627
+ end
628
+ format = Format (stats, descwidth)
629
+
626
630
maxidw[] = id ? maxidw[] : 0
627
631
628
632
for imod in eachindex (modules)
@@ -634,13 +638,13 @@ function retest(@nospecialize(args::ArgType...);
634
638
shuffle! (tests)
635
639
636
640
if dry
637
- if moduleheader
641
+ if module_header
638
642
imod > 1 && verbose > 0 &&
639
643
println ()
640
644
printstyled (mod, ' \n ' , bold= true )
641
645
end
642
646
if verbose > 0
643
- foreach (ts -> dryrun (mod, ts, pat, id ? 0 : moduleheader * 2 ,
647
+ foreach (ts -> dryrun (mod, ts, pat, id ? 0 : module_header * 2 ,
644
648
maxidw = id ? maxidw[] : 0 ),
645
649
tests)
646
650
end
@@ -756,7 +760,7 @@ function retest(@nospecialize(args::ArgType...);
756
760
description = desc
757
761
style = NamedTuple ()
758
762
end
759
- if isindented (verbose, moduleheader , many)
763
+ if isindented (verbose, module_header , many)
760
764
description = " " * description
761
765
end
762
766
cursor += 1
@@ -799,7 +803,7 @@ function retest(@nospecialize(args::ArgType...);
799
803
finito = false
800
804
801
805
print_overall () =
802
- if many || verbose == 0
806
+ if module_summary ( verbose, many)
803
807
@assert endswith (module_ts. description, ' :' )
804
808
module_ts. description = chop (module_ts. description, tail= 1 )
805
809
clear_line ()
@@ -843,7 +847,7 @@ function retest(@nospecialize(args::ArgType...);
843
847
Testset. print_test_results (
844
848
rts, format;
845
849
depth = Int (! rts. overall &
846
- isindented (verbose, moduleheader , many)),
850
+ isindented (verbose, module_header , many)),
847
851
bold = rts. overall | ! many,
848
852
hasbroken= hasbroken,
849
853
maxidw= maxidw[]
@@ -870,8 +874,8 @@ function retest(@nospecialize(args::ArgType...);
870
874
871
875
ndone = 0
872
876
873
- if moduleheader
874
- # + if moduleheader , we print the module as a header, to know where the currently
877
+ if module_header
878
+ # + if module_header , we print the module as a header, to know where the currently
875
879
# printed testsets belong
876
880
ntests += 1
877
881
put! (outchan, module_ts) # printer task will take care of feeding computechan
@@ -1250,7 +1254,7 @@ function update_TESTED_MODULES!(double_check::Bool=false)
1250
1254
TESTED_MODULES
1251
1255
end
1252
1256
1253
- function fetchtests ((mod, pat), verbose, moduleheader , maxidw; static, strict, dup)
1257
+ function fetchtests ((mod, pat), verbose, module_header , maxidw; static, strict, dup)
1254
1258
tests = updatetests! (mod, dup)
1255
1259
descwidth = 0
1256
1260
hasbroken = false
@@ -1270,16 +1274,21 @@ function fetchtests((mod, pat), verbose, moduleheader, maxidw; static, strict, d
1270
1274
1271
1275
tests = filter (ts -> ts. run, tests)
1272
1276
many = length (tests) > 1
1273
- indented = isindented (verbose, moduleheader , many)
1277
+ indented = isindented (verbose, module_header , many)
1274
1278
1275
- if indented
1276
- descwidth += 2
1279
+ if ! isempty (tests)
1280
+ if indented
1281
+ descwidth += 2
1282
+ end
1283
+ if module_header || module_summary (verbose, many)
1284
+ descwidth = max (descwidth, textwidth (string (mod)) + module_header) # +1 for ':'
1285
+ end
1277
1286
end
1278
- descwidth = max (descwidth, textwidth (string (mod)) + indented)
1279
1287
tests, descwidth, hasbroken
1280
1288
end
1281
1289
1282
- isindented (verbose, moduleheader, many) = (verbose > 0 ) & moduleheader
1290
+ isindented (verbose, module_header, many) = (verbose > 0 ) & module_header
1291
+ module_summary (verbose, many) = many | iszero (verbose)
1283
1292
1284
1293
function dryrun (mod:: Module , ts:: TestsetExpr , pat:: Pattern , align:: Int = 0 , parentsubj= " "
1285
1294
; maxidw:: Int , # external calls
0 commit comments