@@ -493,6 +493,7 @@ const retest_defaults = (
493
493
seed = false ,
494
494
marks = true ,
495
495
spin = true ,
496
+ clear = false ,
496
497
)
497
498
498
499
def (kw:: Symbol ) =
@@ -653,6 +654,8 @@ function retest(@nospecialize(args::ArgType...);
653
654
seed:: Integer = def (:seed ),
654
655
marks:: Bool = def (:marks ),
655
656
spin:: Bool = def (:spin ),
657
+ # clear: clear marks for matching tests, only active if dry=true
658
+ clear:: Bool = def (:clear ),
656
659
)
657
660
658
661
dry, stats, shuffle, group, verbose, recursive, id, strict, dup, static, marks, spin =
@@ -712,7 +715,7 @@ function retest(@nospecialize(args::ArgType...);
712
715
end
713
716
if verbose > 0
714
717
foreach (ts -> dryrun (mod, ts, pat, id ? 0 : module_header* 2 ,
715
- maxidw = id ? maxidw[] : 0 , marks= marks),
718
+ maxidw = id ? maxidw[] : 0 , marks= marks, clear = clear ),
716
719
tests)
717
720
end
718
721
continue
@@ -1389,7 +1392,7 @@ module_summary(verbose, many) = many | iszero(verbose)
1389
1392
hasmany (tests) = length (tests) > 1 || isfor (tests[1 ])
1390
1393
1391
1394
function dryrun (mod:: Module , ts:: TestsetExpr , pat:: Pattern , align:: Int = 0 , parentsubj= " "
1392
- ; maxidw:: Int , marks:: Bool , # external calls
1395
+ ; maxidw:: Int , marks:: Bool , clear :: Bool , # external calls
1393
1396
# only recursive calls:
1394
1397
evaldesc= true , repeated= nothing , show:: Bool = true )
1395
1398
@assert ts. run
@@ -1412,6 +1415,10 @@ function dryrun(mod::Module, ts::TestsetExpr, pat::Pattern, align::Int=0, parent
1412
1415
end
1413
1416
1414
1417
res = get (ts. pastresults, subject, nothing )
1418
+ if clear && res != = nothing
1419
+ delete! (ts. pastresults, subject)
1420
+ end
1421
+
1415
1422
if show
1416
1423
print_id (ts. id, maxidw)
1417
1424
printstyled (' ' ^ align, desc, color = desc isa String ? :normal : Base. warn_color ())
@@ -1434,7 +1441,7 @@ function dryrun(mod::Module, ts::TestsetExpr, pat::Pattern, align::Int=0, parent
1434
1441
for tsc in ts. children
1435
1442
tsc. run || continue
1436
1443
dryrun (mod, tsc, pat, align + 2 , subject,
1437
- maxidw= maxidw, marks= marks, show= true )
1444
+ maxidw= maxidw, marks= marks, clear = clear, show= true )
1438
1445
end
1439
1446
false , false , false # meaningless unused triple
1440
1447
elseif marks
@@ -1451,7 +1458,7 @@ function dryrun(mod::Module, ts::TestsetExpr, pat::Pattern, align::Int=0, parent
1451
1458
for tsc in ts. children
1452
1459
tsc. run || continue
1453
1460
cp, cf, cu = dryrun (mod, tsc, pat, align + 2 , subject,
1454
- maxidw= maxidw, marks= marks, show= false )
1461
+ maxidw= maxidw, marks= marks, clear = clear, show= false )
1455
1462
passes |= cp
1456
1463
fails |= cf
1457
1464
unrun |= cu
@@ -1498,7 +1505,7 @@ function dryrun(mod::Module, ts::TestsetExpr, pat::Pattern, align::Int=0, parent
1498
1505
beginend. id = ts. id
1499
1506
beginend. pastresults = ts. pastresults
1500
1507
dryrun (mod, beginend, pat, align, parentsubj; evaldesc= false ,
1501
- repeated= repeated, maxidw= maxidw, marks= marks, show= show)
1508
+ repeated= repeated, maxidw= maxidw, marks= marks, clear = clear, show= show)
1502
1509
end
1503
1510
1504
1511
loopvalues = ts. loopvalues
0 commit comments