changeset 8671:a434c94b48e7

run-tests: show PID if running in parallel mode with -v. (Extremely handy when you break parallel operation and need to figure out what's going on. The assumption is that if you run with -v, you want more details.)
author Greg Ward <greg-hg@gerg.ca>
date Fri, 29 May 2009 22:17:53 -0400
parents 472ecf2c55d9
children d6b243731763
files tests/run-tests.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun May 31 19:48:37 2009 +0200
+++ b/tests/run-tests.py	Fri May 29 22:17:53 2009 -0400
@@ -96,7 +96,13 @@
                            options.annotate)
 
     if options.verbose:
+        if options.jobs > 1 or options.child is not None:
+            pid = "[%d]" % os.getpid()
+        else:
+            pid = None
         def vlog(*msg):
+            if pid:
+                print pid,
             for m in msg:
                 print m,
             print
@@ -178,8 +184,7 @@
 
 def cleanup(options):
     if not options.keep_tmpdir:
-        if options.verbose:
-            print "# Cleaning up HGTMP", HGTMP
+        vlog("# Cleaning up HGTMP", HGTMP)
         shutil.rmtree(HGTMP, True)
 
 def usecorrectpython():