summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-02-17 11:16:40 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-18 13:51:59 -0500
commitf78f001c91736e31cdfb23959647226f9bd9fe6b (patch)
tree8fd4ee8d496d236e7e94395dee866e571b64e6cf
parent6863b196aa178504db124b4f0bfedac8a4d04e2b (diff)
downloadhaskell-f78f001c91736e31cdfb23959647226f9bd9fe6b.tar.gz
Test Driver: Tweak interval of test reporting
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