pactest: remove results summary
This functionality can be provided by a test harness. Having pactest output this information as well clutters the result log created by automake. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
403c175dbc
commit
12e00af531
2 changed files with 1 additions and 71 deletions
|
@ -105,9 +105,8 @@ if __name__ == "__main__":
|
||||||
for i in opts.testcases:
|
for i in opts.testcases:
|
||||||
env.addtest(i)
|
env.addtest(i)
|
||||||
|
|
||||||
# run tests and print overall results
|
# run tests
|
||||||
env.run()
|
env.run()
|
||||||
env.results()
|
|
||||||
|
|
||||||
if not opts.keeproot:
|
if not opts.keeproot:
|
||||||
shutil.rmtree(root_path)
|
shutil.rmtree(root_path)
|
||||||
|
|
|
@ -61,7 +61,6 @@ class pmenv(object):
|
||||||
"""
|
"""
|
||||||
tap.plan(len(self.testcases))
|
tap.plan(len(self.testcases))
|
||||||
for t in self.testcases:
|
for t in self.testcases:
|
||||||
tap.diag("==========" * 8)
|
|
||||||
tap.diag("Running '%s'" % t.testname)
|
tap.diag("Running '%s'" % t.testname)
|
||||||
|
|
||||||
t.load()
|
t.load()
|
||||||
|
@ -72,72 +71,4 @@ class pmenv(object):
|
||||||
tap.todo = t.expectfailure
|
tap.todo = t.expectfailure
|
||||||
tap.subtest(lambda: t.check(), t.description)
|
tap.subtest(lambda: t.check(), t.description)
|
||||||
|
|
||||||
def results(self):
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
tpassed = []
|
|
||||||
tfailed = []
|
|
||||||
texpectedfail = []
|
|
||||||
tunexpectedpass = []
|
|
||||||
for test in self.testcases:
|
|
||||||
fail = test.result["fail"]
|
|
||||||
if fail == 0 and not test.expectfailure:
|
|
||||||
self.passed += 1
|
|
||||||
tpassed.append(test)
|
|
||||||
elif fail != 0 and test.expectfailure:
|
|
||||||
self.expectedfail += 1
|
|
||||||
texpectedfail.append(test)
|
|
||||||
elif fail == 0: # and not test.expectfail
|
|
||||||
self.unexpectedpass += 1
|
|
||||||
tunexpectedpass.append(test)
|
|
||||||
else:
|
|
||||||
self.failed += 1
|
|
||||||
tfailed.append(test)
|
|
||||||
|
|
||||||
def _printtest(t):
|
|
||||||
success = t.result["success"]
|
|
||||||
fail = t.result["fail"]
|
|
||||||
rules = len(t.rules)
|
|
||||||
if fail == 0:
|
|
||||||
result = "[PASS]"
|
|
||||||
else:
|
|
||||||
result = "[FAIL]"
|
|
||||||
tap.diag("%s %s Rules: OK = %2u FAIL = %2u" \
|
|
||||||
% (result, t.testname.ljust(34), success, fail))
|
|
||||||
if fail != 0:
|
|
||||||
# print test description if test failed
|
|
||||||
tap.diag(" " + t.description)
|
|
||||||
|
|
||||||
tap.diag("==========" * 8)
|
|
||||||
tap.diag("Results")
|
|
||||||
tap.diag("----------" * 8)
|
|
||||||
tap.diag(" Passed:")
|
|
||||||
for test in tpassed:
|
|
||||||
_printtest(test)
|
|
||||||
tap.diag("----------" * 8)
|
|
||||||
tap.diag(" Expected Failures:")
|
|
||||||
for test in texpectedfail:
|
|
||||||
_printtest(test)
|
|
||||||
tap.diag("----------" * 8)
|
|
||||||
tap.diag(" Unexpected Passes:")
|
|
||||||
for test in tunexpectedpass:
|
|
||||||
_printtest(test)
|
|
||||||
tap.diag("----------" * 8)
|
|
||||||
tap.diag(" Failed:")
|
|
||||||
for test in tfailed:
|
|
||||||
_printtest(test)
|
|
||||||
tap.diag("----------" * 8)
|
|
||||||
|
|
||||||
total = len(self.testcases)
|
|
||||||
tap.diag("Total = %3u" % total)
|
|
||||||
if total:
|
|
||||||
tap.diag("Pass = %3u (%6.2f%%)" % (self.passed,
|
|
||||||
float(self.passed) * 100 / total))
|
|
||||||
tap.diag("Expected Fail = %3u (%6.2f%%)" % (self.expectedfail,
|
|
||||||
float(self.expectedfail) * 100 / total))
|
|
||||||
tap.diag("Unexpected Pass = %3u (%6.2f%%)" % (self.unexpectedpass,
|
|
||||||
float(self.unexpectedpass) * 100 / total))
|
|
||||||
tap.diag("Fail = %3u (%6.2f%%)" % (self.failed,
|
|
||||||
float(self.failed) * 100 / total))
|
|
||||||
|
|
||||||
# vim: set ts=4 sw=4 et:
|
# vim: set ts=4 sw=4 et:
|
||||||
|
|
Loading…
Add table
Reference in a new issue