import shlex
import sys
+import lit.reports
import lit.util
help="Display all commandlines and output",
action="store_true")
format_group.add_argument("-o", "--output",
- dest="output_path",
+ dest="reports",
+ action="append",
+ type=lit.reports.JsonReport,
+ default=[],
help="Write test results to the provided path",
metavar="PATH")
format_group.add_argument("--no-progress-bar",
help="Don't execute any tests (assume PASS)",
action="store_true")
execution_group.add_argument("--xunit-xml-output",
- dest="xunit_output_file",
+ dest="reports",
+ action="append",
+ type=lit.reports.XunitReport,
+ default=[],
help="Write XUnit-compatible XML test reports to the specified file")
execution_group.add_argument("--timeout",
dest="maxIndividualTestTime",
print_results(discovered_tests, elapsed, opts)
- if opts.output_path:
- #TODO(yln): pass in discovered_tests
- write_test_results(executed_tests, lit_config, elapsed, opts.output_path)
- if opts.xunit_output_file:
- write_test_results_xunit(executed_tests, opts)
+ for report in opts.reports:
+ report.write_results(executed_tests, elapsed)
if lit_config.numErrors:
sys.stderr.write('\n%d error(s) in tests\n' % lit_config.numErrors)
label = label.ljust(max_label_len)
count = str(count).rjust(max_count_len)
print(' %s: %s' % (label, count))
-
-
-def write_test_results(tests, lit_config, elapsed, output_path):
- import lit.reports
- r = lit.reports.JsonReport(output_path)
- r.write_results(tests, elapsed)
-
-
-def write_test_results_xunit(tests, opts):
- import lit.reports
- r = lit.reports.XunitReport(opts.xunit_output_file)
- r.write_results(tests, 0.0)
-