[pacman-dev] [PATCH 7/7] pactest: remove results summary

Andrew Gregory andrew.gregory.8 at gmail.com
Fri Aug 2 08:34:14 EDT 2013


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 at gmail.com>
---
 test/pacman/pactest.py |  3 +--
 test/pacman/pmenv.py   | 69 --------------------------------------------------
 2 files changed, 1 insertion(+), 71 deletions(-)

diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py
index e92864d..d39fcaa 100755
--- a/test/pacman/pactest.py
+++ b/test/pacman/pactest.py
@@ -105,9 +105,8 @@ def create_parser():
     for i in opts.testcases:
         env.addtest(i)
 
-    # run tests and print overall results
+    # run tests
     env.run()
-    env.results()
 
     if not opts.keeproot:
         shutil.rmtree(root_path)
diff --git a/test/pacman/pmenv.py b/test/pacman/pmenv.py
index a3a8f54..f358285 100644
--- a/test/pacman/pmenv.py
+++ b/test/pacman/pmenv.py
@@ -61,7 +61,6 @@ def run(self):
         """
         tap.plan(len(self.testcases))
         for t in self.testcases:
-            tap.diag("==========" * 8)
             tap.diag("Running '%s'" % t.testname)
 
             t.load()
@@ -72,72 +71,4 @@ def run(self):
             tap.todo = t.expectfailure
             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:
-- 
1.8.3.4



More information about the pacman-dev mailing list