summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-02-17 11:16:40 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2021-02-17 11:17:47 +0000
commit991a1a2d7bf898e63cec0ce44e44023b57a297b4 (patch)
tree304be9af1a32f7305adf3843c11df5a1941382c8
parenta04179e74bf18837236fea02040438a2c29c8d56 (diff)
downloadhaskell-wip/tweak-test-interval.tar.gz
Test Driver: Tweak interval of test reportingwip/tweak-test-interval
Rather than just display every 100 tests, work out how many to display based on the total number of tests. This improves the experience when running a small number of tests. For [0..100] - Report every test [100..1000] - Report every 10 tests [1000..10000] - Report every 100 tests and so on..
-rw-r--r--testsuite/driver/testlib.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 9fc6b6d859..c2838ae5bf 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -13,7 +13,7 @@ import datetime
import copy
import glob
import sys
-from math import ceil, trunc
+from math import ceil, trunc, floor, log
from pathlib import Path, PurePath
import collections
import subprocess
@@ -1079,13 +1079,20 @@ def do_test(name: TestName,
opts = getTestOpts()
full_name = name + '(' + way + ')'
-
- progress_args = [ full_name, t.total_tests, len(allTestNames),
+ test_n = len(allTestNames)
+ progress_args = [ full_name, t.total_tests, test_n,
[len(t.unexpected_passes),
len(t.unexpected_failures),
len(t.framework_failures)]]
- if t.total_tests % 100 == 0: if_verbose(2, "=====> {1} of {2} {3}".format(*progress_args))
- if_verbose(3, "=====> {0} {1} of {2} {3}".format(*progress_args))
+ # For n = [0..100] - Report every test
+ # n = [100..1000] - Report every 10 tests
+ # n = [1000...10000] - report every 100 tests
+ # and so on...
+ report_every = 10 ** max(0, floor(log(test_n, 10)) - 1)
+ if t.total_tests % report_every == 0 and config.verbose <= 2:
+ if_verbose(2, "=====> {1} of {2} {3}".format(*progress_args))
+ else:
+ if_verbose(3, "=====> {0} {1} of {2} {3}".format(*progress_args))
# Update terminal title
# useful progress indicator even when make test VERBOSE=1