You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/09/20 01:10:02 UTC

svn commit: r1387810 - /subversion/trunk/build/run_tests.py

Author: stsp
Date: Wed Sep 19 23:10:01 2012
New Revision: 1387810

URL: http://svn.apache.org/viewvc?rev=1387810&view=rev
Log:
* build/run_tests.py
  (TestHarness): In the progress callbacks, if we're not logging to a file,
   we won't be printing anything. So simply exit early instead of performing
   computations we're not going to use for anything. Also, for purely cosmetic
   reasons, trim empty lines from the progress callbacks.

Modified:
    subversion/trunk/build/run_tests.py

Modified: subversion/trunk/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/run_tests.py?rev=1387810&r1=1387809&r2=1387810&view=diff
==============================================================================
--- subversion/trunk/build/run_tests.py (original)
+++ subversion/trunk/build/run_tests.py Wed Sep 19 23:10:01 2012
@@ -383,14 +383,13 @@ class TestHarness:
     # This has to be class-scoped for use in the progress_func()
     self.dots_written = 0
     def progress_func(completed):
+      if not self.log:
+        return
       dots = (completed * dot_count) / total
       if dots > dot_count:
         dots = dot_count
-
       dots_to_write = dots - self.dots_written
-      if self.log:
-        os.write(sys.stdout.fileno(), '.' * dots_to_write)
-
+      os.write(sys.stdout.fileno(), '.' * dots_to_write)
       self.dots_written = dots
 
     tests_completed = 0
@@ -494,14 +493,13 @@ class TestHarness:
     # This has to be class-scoped for use in the progress_func()
     self.dots_written = 0
     def progress_func(completed, total):
+      if not self.log:
+        return
       dots = (completed * dot_count) / total
       if dots > dot_count:
         dots = dot_count
-
       dots_to_write = dots - self.dots_written
-      if self.log:
-        os.write(old_stdout, '.' * dots_to_write)
-
+      os.write(old_stdout, '.' * dots_to_write)
       self.dots_written = dots
 
     serial_only = hasattr(prog_mod, 'serial_only') and prog_mod.serial_only