Mercurial > hg-stable
changeset 19251:6857f53456f2
run-tests: add a log function
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 24 May 2013 14:30:43 -0500 |
parents | 5fa946330970 |
children | 9e9c407e0d1f |
files | tests/run-tests.py |
diffstat | 1 files changed, 13 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Fri May 24 14:30:43 2013 -0500 +++ b/tests/run-tests.py Fri May 24 14:30:43 2013 -0500 @@ -320,6 +320,16 @@ sys.stdout.flush() iolock.release() +def log(*msg): + iolock.acquire() + if verbose: + print verbose, + for m in msg: + print m, + print + sys.stdout.flush() + iolock.release() + def findprogram(program): """Search PATH for a executable program""" for p in os.environ.get('PATH', os.defpath).split(os.pathsep): @@ -572,9 +582,7 @@ if el + '\n' == l: if os.name == 'nt': # matching on "/" is not needed for this line - iolock.acquire() - print "\nInfo, unnecessary glob: %s (glob)" % el - iolock.release() + log("\nInfo, unnecessary glob: %s (glob)" % el) return True i, n = 0, len(el) res = '' @@ -832,16 +840,12 @@ def skip(msg): if options.verbose: - iolock.acquire() - print "\nSkipping %s: %s" % (testpath, msg) - iolock.release() + log("\nSkipping %s: %s" % (testpath, msg)) return 's', test, msg def fail(msg, ret): if not options.nodiff: - iolock.acquire() - print "\nERROR: %s %s" % (testpath, msg) - iolock.release() + log("\nERROR: %s %s" % (testpath, msg)) if (not ret and options.interactive and os.path.exists(testpath + ".err")): iolock.acquire()