comparison tests/run-tests.py @ 10406:6586a6889f66

run-tests.py: skipped tests shouldn't change working directory
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 09 Feb 2010 01:12:29 +0100
parents bc9a3bb267fa
children e433002acb05
comparison
equal deleted inserted replaced
10405:2d30d66a89ad 10406:6586a6889f66
520 hgrc.write('[inotify]\n') 520 hgrc.write('[inotify]\n')
521 hgrc.write('pidfile=%s\n' % DAEMON_PIDS) 521 hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
522 hgrc.write('appendpid=True\n') 522 hgrc.write('appendpid=True\n')
523 hgrc.close() 523 hgrc.close()
524 524
525 testpath = os.path.join(TESTDIR, test)
526 ref = os.path.join(TESTDIR, test+".out")
525 err = os.path.join(TESTDIR, test+".err") 527 err = os.path.join(TESTDIR, test+".err")
526 ref = os.path.join(TESTDIR, test+".out")
527 testpath = os.path.join(TESTDIR, test)
528
529 if os.path.exists(err): 528 if os.path.exists(err):
530 os.remove(err) # Remove any previous output files 529 os.remove(err) # Remove any previous output files
531
532 # Make a tmp subdirectory to work in
533 tmpd = os.path.join(HGTMP, test)
534 os.mkdir(tmpd)
535 os.chdir(tmpd)
536
537 try: 530 try:
538 tf = open(testpath) 531 tf = open(testpath)
539 firstline = tf.readline().rstrip() 532 firstline = tf.readline().rstrip()
540 tf.close() 533 tf.close()
541 except: 534 except:
560 if not os.path.exists(testpath): 553 if not os.path.exists(testpath):
561 return fail("does not exist") 554 return fail("does not exist")
562 elif not os.access(testpath, os.X_OK): 555 elif not os.access(testpath, os.X_OK):
563 return skip("not executable") 556 return skip("not executable")
564 cmd = '"%s"' % testpath 557 cmd = '"%s"' % testpath
558
559 # Make a tmp subdirectory to work in
560 tmpd = os.path.join(HGTMP, test)
561 os.mkdir(tmpd)
562 os.chdir(tmpd)
565 563
566 if options.timeout > 0: 564 if options.timeout > 0:
567 signal.alarm(options.timeout) 565 signal.alarm(options.timeout)
568 566
569 vlog("# Running", cmd) 567 vlog("# Running", cmd)