##// END OF EJS Templates
run-tests: make vlog a proper function
Matt Mackall -
r19250:5fa94633 default
parent child Browse files
Show More
@@ -240,23 +240,12 b' def parseargs():'
240 parser.error("sorry, coverage options do not work when --local "
240 parser.error("sorry, coverage options do not work when --local "
241 "is specified")
241 "is specified")
242
242
243 global vlog
243 global verbose
244 if options.verbose:
244 if options.verbose:
245 if options.jobs > 1 or options.child is not None:
245 if options.jobs > 1 or options.child is not None:
246 pid = "[%d]" % os.getpid()
246 verbose = "[%d]" % os.getpid()
247 else:
247 else:
248 pid = None
248 verbose = ''
249 def vlog(*msg):
250 iolock.acquire()
251 if pid:
252 print pid,
253 for m in msg:
254 print m,
255 print
256 sys.stdout.flush()
257 iolock.release()
258 else:
259 vlog = lambda *msg: None
260
249
261 if options.tmpdir:
250 if options.tmpdir:
262 options.tmpdir = os.path.expanduser(options.tmpdir)
251 options.tmpdir = os.path.expanduser(options.tmpdir)
@@ -319,6 +308,18 b' def showdiff(expected, output, ref, err)'
319 for line in difflib.unified_diff(expected, output, ref, err):
308 for line in difflib.unified_diff(expected, output, ref, err):
320 sys.stdout.write(line)
309 sys.stdout.write(line)
321
310
311 verbose = False
312 def vlog(*msg):
313 if verbose is not False:
314 iolock.acquire()
315 if verbose:
316 print verbose,
317 for m in msg:
318 print m,
319 print
320 sys.stdout.flush()
321 iolock.release()
322
322 def findprogram(program):
323 def findprogram(program):
323 """Search PATH for a executable program"""
324 """Search PATH for a executable program"""
324 for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
325 for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
General Comments 0
You need to be logged in to leave comments. Login now