sanitycheck: junit: add total duration of run
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
202d1308ae
commit
0605fa33ea
1 changed files with 6 additions and 5 deletions
|
@ -1560,7 +1560,7 @@ class TestSuite:
|
||||||
lower_better))
|
lower_better))
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def testcase_xunit_report(self, filename, args):
|
def testcase_xunit_report(self, filename, duration, args):
|
||||||
if self.goals == None:
|
if self.goals == None:
|
||||||
raise SanityRuntimeException("execute() hasn't been run!")
|
raise SanityRuntimeException("execute() hasn't been run!")
|
||||||
|
|
||||||
|
@ -1581,13 +1581,13 @@ class TestSuite:
|
||||||
eleTestsuite = None
|
eleTestsuite = None
|
||||||
append = args.only_failed
|
append = args.only_failed
|
||||||
|
|
||||||
if os.path.exists(filename) or append:
|
if os.path.exists(filename) and append:
|
||||||
tree = ET.parse(filename)
|
tree = ET.parse(filename)
|
||||||
eleTestsuites = tree.getroot()
|
eleTestsuites = tree.getroot()
|
||||||
eleTestsuite = tree.findall('testsuite')[0];
|
eleTestsuite = tree.findall('testsuite')[0];
|
||||||
else:
|
else:
|
||||||
eleTestsuites = ET.Element('testsuites')
|
eleTestsuites = ET.Element('testsuites')
|
||||||
eleTestsuite = ET.SubElement(eleTestsuites, 'testsuite', name=run,
|
eleTestsuite = ET.SubElement(eleTestsuites, 'testsuite', name=run, time="%d" %duration,
|
||||||
tests="%d" %(errors + passes + fails), failures="%d" %fails, errors="%d" %errors, skip="0")
|
tests="%d" %(errors + passes + fails), failures="%d" %fails, errors="%d" %errors, skip="0")
|
||||||
|
|
||||||
qemu_time = "0"
|
qemu_time = "0"
|
||||||
|
@ -2009,15 +2009,16 @@ def main():
|
||||||
info("Generating coverage files...")
|
info("Generating coverage files...")
|
||||||
generate_coverage(args.outdir, ["tests/*", "samples/*"])
|
generate_coverage(args.outdir, ["tests/*", "samples/*"])
|
||||||
|
|
||||||
|
duration = time.time() - start_time
|
||||||
info("%s%d of %d%s tests passed with %s%d%s warnings in %d seconds" %
|
info("%s%d of %d%s tests passed with %s%d%s warnings in %d seconds" %
|
||||||
(COLOR_RED if failed else COLOR_GREEN, len(goals) - failed,
|
(COLOR_RED if failed else COLOR_GREEN, len(goals) - failed,
|
||||||
len(goals), COLOR_NORMAL, COLOR_YELLOW if warnings else COLOR_NORMAL,
|
len(goals), COLOR_NORMAL, COLOR_YELLOW if warnings else COLOR_NORMAL,
|
||||||
warnings, COLOR_NORMAL, time.time() - start_time))
|
warnings, COLOR_NORMAL, duration))
|
||||||
|
|
||||||
if args.testcase_report:
|
if args.testcase_report:
|
||||||
ts.testcase_report(args.testcase_report)
|
ts.testcase_report(args.testcase_report)
|
||||||
if not args.no_update:
|
if not args.no_update:
|
||||||
ts.testcase_xunit_report(LAST_SANITY_XUNIT, args)
|
ts.testcase_xunit_report(LAST_SANITY_XUNIT, duration, args)
|
||||||
ts.testcase_report(LAST_SANITY)
|
ts.testcase_report(LAST_SANITY)
|
||||||
if args.release:
|
if args.release:
|
||||||
ts.testcase_report(RELEASE_DATA)
|
ts.testcase_report(RELEASE_DATA)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue