comparison tests/run-tests.py @ 5806:4dfe7d5b1fc8

Merge with crew-stable
author Patrick Mezard <pmezard@gmail.com>
date Sat, 05 Jan 2008 22:52:28 +0100
parents e9f68860d5ed 2f597243e1d7
children 5af5f0f9d724
comparison
equal deleted inserted replaced
5804:a3a380af8fb5 5806:4dfe7d5b1fc8
65 print >> sys.stderr, 'ERROR: -j/--jobs must be positive' 65 print >> sys.stderr, 'ERROR: -j/--jobs must be positive'
66 sys.exit(1) 66 sys.exit(1)
67 if options.interactive and options.jobs > 1: 67 if options.interactive and options.jobs > 1:
68 print >> sys.stderr, 'ERROR: cannot mix -interactive and --jobs > 1' 68 print >> sys.stderr, 'ERROR: cannot mix -interactive and --jobs > 1'
69 sys.exit(1) 69 sys.exit(1)
70
71 def rename(src, dst):
72 """Like os.rename(), trade atomicity and opened files friendliness
73 for existing destination support.
74 """
75 shutil.copy(src, dst)
76 os.remove(src)
70 77
71 def vlog(*msg): 78 def vlog(*msg):
72 if verbose: 79 if verbose:
73 for m in msg: 80 for m in msg:
74 print m, 81 print m,
528 elif not ret: 535 elif not ret:
529 if options.interactive: 536 if options.interactive:
530 print "Accept this change? [n] ", 537 print "Accept this change? [n] ",
531 answer = sys.stdin.readline().strip() 538 answer = sys.stdin.readline().strip()
532 if answer.lower() in "y yes".split(): 539 if answer.lower() in "y yes".split():
533 os.rename(test + ".err", test + ".out") 540 rename(test + ".err", test + ".out")
534 tested += 1 541 tested += 1
535 continue 542 continue
536 failed += 1 543 failed += 1
537 if options.first: 544 if options.first:
538 break 545 break