Commit f78f001c authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot

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..
parent 6863b196
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment