[poppler] 2 commits - regtest/Printer.py regtest/TestRun.py

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Oct 21 08:50:57 PDT 2012


 regtest/Printer.py |    5 ++++-
 regtest/TestRun.py |   10 +++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 74d6217ba164fdfe263b4edac8047b60506e39a6
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Oct 21 17:48:57 2012 +0200

    regstest: Add print_test_result_ln() and use it for failed test results
    
    To make sure they are always shown.

diff --git a/regtest/Printer.py b/regtest/Printer.py
index 1aafe02..008f46b 100644
--- a/regtest/Printer.py
+++ b/regtest/Printer.py
@@ -80,6 +80,9 @@ class Printer:
     def print_test_result(self, msg):
         self.printout_update(msg)
 
+    def print_test_result_ln(self, msg):
+        self.printout_update(self._ensure_new_line(msg))
+
     def print_default(self, msg):
         if self._verbose:
             self.printout_ln(msg)
diff --git a/regtest/TestRun.py b/regtest/TestRun.py
index 24afa2f..f4e5051 100644
--- a/regtest/TestRun.py
+++ b/regtest/TestRun.py
@@ -74,14 +74,14 @@ class TestRun:
                 self.printer.print_test_result("PASS")
                 self._n_passed += 1
             else:
-                print("FAIL")
+                self.printer.print_test_result_ln("FAIL")
                 self._failed.append("%s (%s)" % (doc_path, backend.get_name()))
             return
         elif test_has_md5:
             if ref_is_crashed:
-                self.printer.print_test_result("DOES NOT CRASH")
+                self.printer.print_test_result_ln("DOES NOT CRASH")
             elif ref_is_failed:
-                self.printer.print_test_result("DOES NOT FAIL")
+                self.printer.print_test_result_ln("DOES NOT FAIL")
             return
 
         test_is_crashed = backend.is_crashed(test_path)
@@ -98,12 +98,12 @@ class TestRun:
             return
 
         if test_is_crashed:
-            self.printer.print_test_result("CRASH")
+            self.printer.print_test_result_ln("CRASH")
             self._crashed.append("%s (%s)" % (doc_path, backend.get_name()))
             return
 
         if test_is_failed:
-            self.printer.print_test_result("FAIL (status error %d)" % (test_is_failed))
+            self.printer.print_test_result_ln("FAIL (status error %d)" % (test_is_failed))
             self._failed_status_error("%s (%s)" % (doc_path, backend.get_name()))
             return
 
commit 4e9b8d2cca44241a501bb8095b3980d17fcda6c5
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Oct 21 17:48:22 2012 +0200

    regtest: Do not rewrite lines in verbose mode

diff --git a/regtest/Printer.py b/regtest/Printer.py
index 68356b5..1aafe02 100644
--- a/regtest/Printer.py
+++ b/regtest/Printer.py
@@ -29,7 +29,7 @@ class Printer:
 
         self._verbose = Config().verbose
         self._stream = sys.stdout
-        self._rewrite = self._stream.isatty() #and not self.config.verbose
+        self._rewrite = self._stream.isatty() and not self._verbose
         self._current_line = None
 
         Printer.__single = self


More information about the poppler mailing list