Skip to content

Commit a76464a

Browse files
authored
More verbose output: Report passed tests, tool invocations. (#763)
* More verbose output: Report passed tests, tool invocations. - Also, when used with '-v', let's also report all passed checks in the summary. - Set debug log level on second verbose (just like --debug). Signed-off-by: Kurt Garloff <[email protected]>
1 parent ed85718 commit a76464a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Tests/scs-compliance-check.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ def apply_argv(self, argv):
108108
usage()
109109
sys.exit(0)
110110
elif opt[0] == "-v" or opt[0] == "--verbose":
111+
if self.verbose:
112+
logger.setLevel(logging.DEBUG)
111113
self.verbose = True
112114
elif opt[0] == "--debug":
113-
logging.getLogger().setLevel(logging.DEBUG)
115+
logger.setLevel(logging.DEBUG)
114116
elif opt[0] == "-q" or opt[0] == "--quiet":
115117
self.quiet = True
116118
logging.getLogger().setLevel(logging.ERROR)
@@ -271,7 +273,7 @@ def run_suite(suite: TestSuite, runner: CheckRunner):
271273
return builder.finalize(permissible_ids=suite.ids)
272274

273275

274-
def print_report(subject: str, suite: TestSuite, targets: dict, results: dict):
276+
def print_report(subject: str, suite: TestSuite, targets: dict, results: dict, verbose=False):
275277
print(f"{subject} {suite.name}:")
276278
for tname, target_spec in targets.items():
277279
failed, missing, passed = suite.select(tname, target_spec).eval_buckets(results)
@@ -283,7 +285,10 @@ def print_report(subject: str, suite: TestSuite, targets: dict, results: dict):
283285
summary_parts.append(f"{len(missing)} missing")
284286
verdict += f" ({', '.join(summary_parts)})"
285287
print(f"- {tname}: {verdict}")
286-
for offenders, category in ((failed, 'FAILED'), (missing, 'MISSING')):
288+
reportcateg = [(failed, 'FAILED'), (missing, 'MISSING')]
289+
if verbose:
290+
reportcateg.append((passed, 'PASSED'))
291+
for offenders, category in reportcateg:
287292
if category == 'MISSING' and suite.partial:
288293
continue # do not report each missing testcase if a filter was used
289294
if not offenders:
@@ -363,7 +368,7 @@ def main(argv):
363368
if runner.spamminess:
364369
print("********" * 10) # 80 characters
365370
for version, suite, results in report_data:
366-
print_report(config.subject, suite, version['targets'], results)
371+
print_report(config.subject, suite, version['targets'], results, config.verbose)
367372
if config.output:
368373
version_report = {version['version']: results for version, _, results in report_data}
369374
report = create_report(argv, config, spec, version_report, runner.get_invocations())

0 commit comments

Comments
 (0)