[LNT] r255946 - Reorder command line printing, and count kinds of results
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 17 17:10:33 PST 2015
Author: cmatthews
Date: Thu Dec 17 19:10:33 2015
New Revision: 255946
URL: http://llvm.org/viewvc/llvm-project?rev=255946&view=rev
Log:
Reorder command line printing, and count kinds of results
When you submit from the command line, the summary data is obscured by
all the results data that is printed. Reorder those so they are in a
better order. Also add handy counts, so you don't have to guess if any
failed.
Modified:
lnt/trunk/lnt/util/ImportData.py
Modified: lnt/trunk/lnt/util/ImportData.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/ImportData.py?rev=255946&r1=255945&r2=255946&view=diff
==============================================================================
--- lnt/trunk/lnt/util/ImportData.py (original)
+++ lnt/trunk/lnt/util/ImportData.py Thu Dec 17 19:10:33 2015
@@ -1,5 +1,5 @@
import os, re, time
-
+import collections
import lnt.testing
import lnt.formats
import lnt.server.reporting.analysis
@@ -158,45 +158,7 @@ def print_report_result(result, out, err
print >>err, "--\n%s--\n" % result['error']
err.flush()
return
-
- if 'original_run' in result:
- print >>out, ("This submission is a duplicate of run %d, "
- "already in the database.") % result['original_run']
- print >>out
-
- if not result['committed']:
- print >>out, "NOTE: This run was not committed!"
- print >>out
-
- if result['report_to_address']:
- print >>out, "Report emailed to: %r" % result['report_to_address']
- print >>out
-
- # Print the processing times.
- print >>out, "Processing Times"
- print >>out, "----------------"
- print >>out, "Load : %.2fs" % result['load_time']
- print >>out, "Import : %.2fs" % result['import_time']
- print >>out, "Report : %.2fs" % result['report_time']
- print >>out, "Total : %.2fs" % result['total_time']
- print >>out
-
- # Print the added database items.
- total_added = (result['added_machines'] + result['added_runs'] +
- result['added_tests'] + result.get('added_samples', 0))
- if total_added:
- print >>out, "Imported Data"
- print >>out, "-------------"
- if result['added_machines']:
- print >>out, "Added Machines: %d" % result['added_machines']
- if result['added_runs']:
- print >>out, "Added Runs : %d" % result['added_runs']
- if result['added_tests']:
- print >>out, "Added Tests : %d" % result['added_tests']
- if result.get('added_samples', 0):
- print >>out, "Added Samples : %d" % result['added_samples']
- print >>out
-
+
# Print the test results.
test_results = result.get('test_results')
if not test_results:
@@ -215,18 +177,19 @@ def print_report_result(result, out, err
for item in test_results])
print >>out, "--- Tested: %d tests --" % total_num_tests
test_index = 0
+ result_kinds = collections.Counter()
for i,item in enumerate(test_results):
pset = item['pset']
pset_results = item['results']
for name,test_status,perf_status in pset_results:
test_index += 1
-
# FIXME: Show extended information for performance changes, previous
# samples, standard deviation, all that.
#
# FIXME: Think longer about mapping to test codes.
result_info = None
+
if test_status == lnt.server.reporting.analysis.REGRESSED:
result_string = 'FAIL'
elif test_status == lnt.server.reporting.analysis.UNCHANGED_FAIL:
@@ -245,7 +208,7 @@ def print_report_result(result, out, err
result_info = 'Performance improved.'
else:
result_string = 'PASS'
-
+ result_kinds[result_string] += 1
# Ignore passes unless in verbose mode.
if not verbose and result_string == 'PASS':
continue
@@ -259,3 +222,45 @@ def print_report_result(result, out, err
print >>out, "%s TEST '%s' %s" % ('*'*20, name, '*'*20)
print >>out, result_info
print >>out, "*" * 20
+
+ if 'original_run' in result:
+ print >>out, ("This submission is a duplicate of run %d, "
+ "already in the database.") % result['original_run']
+ print >>out
+
+ if not result['committed']:
+ print >>out, "NOTE: This run was not committed!"
+ print >>out
+
+ if result['report_to_address']:
+ print >>out, "Report emailed to: %r" % result['report_to_address']
+ print >>out
+
+ # Print the processing times.
+ print >>out, "Processing Times"
+ print >>out, "----------------"
+ print >>out, "Load : %.2fs" % result['load_time']
+ print >>out, "Import : %.2fs" % result['import_time']
+ print >>out, "Report : %.2fs" % result['report_time']
+ print >>out, "Total : %.2fs" % result['total_time']
+ print >>out
+
+ # Print the added database items.
+ total_added = (result['added_machines'] + result['added_runs'] +
+ result['added_tests'] + result.get('added_samples', 0))
+ if total_added:
+ print >>out, "Imported Data"
+ print >>out, "-------------"
+ if result['added_machines']:
+ print >>out, "Added Machines: %d" % result['added_machines']
+ if result['added_runs']:
+ print >>out, "Added Runs : %d" % result['added_runs']
+ if result['added_tests']:
+ print >>out, "Added Tests : %d" % result['added_tests']
+ if result.get('added_samples', 0):
+ print >>out, "Added Samples : %d" % result['added_samples']
+ print >>out
+ print >>out, "Results"
+ print >>out, "----------------"
+ for kind, count in result_kinds.items():
+ print >>out, kind, ":", count
More information about the llvm-commits
mailing list