|
@@ -81,6 +81,18 @@ class TestingProgressDisplay(object):
|
|
print('%s: %s ' % (metric_name, value.format()))
|
|
print('%s: %s ' % (metric_name, value.format()))
|
|
print("*" * 10)
|
|
print("*" * 10)
|
|
|
|
|
|
|
|
+ # Report micro-tests, if present
|
|
|
|
+ if test.result.microResults:
|
|
|
|
+ items = sorted(test.result.microResults.items())
|
|
|
|
+ for micro_test_name, micro_test in items:
|
|
|
|
+ print("%s MICRO-TEST: %s" %
|
|
|
|
+ ('*'*3, micro_test_name))
|
|
|
|
+
|
|
|
|
+ if micro_test.metrics:
|
|
|
|
+ sorted_metrics = sorted(micro_test.metrics.items())
|
|
|
|
+ for metric_name, value in sorted_metrics:
|
|
|
|
+ print(' %s: %s ' % (metric_name, value.format()))
|
|
|
|
+
|
|
# Ensure the output is flushed.
|
|
# Ensure the output is flushed.
|
|
sys.stdout.flush()
|
|
sys.stdout.flush()
|
|
|
|
|
|
@@ -113,6 +125,25 @@ def write_test_results(run, lit_config, testing_time, output_path):
|
|
for key, value in test.result.metrics.items():
|
|
for key, value in test.result.metrics.items():
|
|
metrics_data[key] = value.todata()
|
|
metrics_data[key] = value.todata()
|
|
|
|
|
|
|
|
+ # Report micro-tests separately, if present
|
|
|
|
+ if test.result.microResults:
|
|
|
|
+ for key, micro_test in test.result.microResults.items():
|
|
|
|
+ # Expand parent test name with micro test name
|
|
|
|
+ parent_name = test.getFullName()
|
|
|
|
+ micro_full_name = parent_name + ':' + key
|
|
|
|
+
|
|
|
|
+ micro_test_data = {
|
|
|
|
+ 'name' : micro_full_name,
|
|
|
|
+ 'code' : micro_test.code.name,
|
|
|
|
+ 'output' : micro_test.output,
|
|
|
|
+ 'elapsed' : micro_test.elapsed }
|
|
|
|
+ if micro_test.metrics:
|
|
|
|
+ micro_test_data['metrics'] = micro_metrics_data = {}
|
|
|
|
+ for key, value in micro_test.metrics.items():
|
|
|
|
+ micro_metrics_data[key] = value.todata()
|
|
|
|
+
|
|
|
|
+ tests_data.append(micro_test_data)
|
|
|
|
+
|
|
tests_data.append(test_data)
|
|
tests_data.append(test_data)
|
|
|
|
|
|
# Write the output.
|
|
# Write the output.
|