comparison tests/run-tests.py @ 8093:70d8f70264c4

run-tests: move bits of main program so it's all at the bottom.
author Greg Ward <greg-hg@gerg.ca>
date Mon, 20 Apr 2009 21:10:39 -0400
parents c49578c5122f
children 60a9e3cf0cf4
comparison
equal deleted inserted replaced
8092:c49578c5122f 8093:70d8f70264c4
493 if not options.keep_tmpdir: 493 if not options.keep_tmpdir:
494 shutil.rmtree(tmpd, True) 494 shutil.rmtree(tmpd, True)
495 if skipped: 495 if skipped:
496 return None 496 return None
497 return ret == 0 497 return ret == 0
498
499 (options, args) = parse_args()
500 if not options.child:
501 os.umask(022)
502
503 check_required_tools()
504
505 # Reset some environment variables to well-known values so that
506 # the tests produce repeatable output.
507 os.environ['LANG'] = os.environ['LC_ALL'] = 'C'
508 os.environ['TZ'] = 'GMT'
509 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
510 os.environ['CDPATH'] = ''
511
512 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
513 HGTMP = os.environ['HGTMP'] = os.path.realpath(tempfile.mkdtemp('', 'hgtests.',
514 options.tmpdir))
515 DAEMON_PIDS = None
516 HGRCPATH = None
517
518 os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
519 os.environ["HGMERGE"] = "internal:merge"
520 os.environ["HGUSER"] = "test"
521 os.environ["HGENCODING"] = "ascii"
522 os.environ["HGENCODINGMODE"] = "strict"
523 os.environ["HGPORT"] = str(options.port)
524 os.environ["HGPORT1"] = str(options.port + 1)
525 os.environ["HGPORT2"] = str(options.port + 2)
526
527 if options.with_hg:
528 INST = options.with_hg
529 else:
530 INST = os.path.join(HGTMP, "install")
531 BINDIR = os.environ["BINDIR"] = os.path.join(INST, "bin")
532 PYTHONDIR = os.path.join(INST, "lib", "python")
533 COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
534
535 expecthg = os.path.join(HGTMP, 'install', 'lib', 'python', 'mercurial')
536 hgpkg = None
537 498
538 def run_children(tests): 499 def run_children(tests):
539 if not options.with_hg: 500 if not options.with_hg:
540 install_hg() 501 install_hg()
541 if hgpkg != expecthg: 502 if hgpkg != expecthg:
684 print "\ninterrupted!" 645 print "\ninterrupted!"
685 646
686 if failed: 647 if failed:
687 sys.exit(1) 648 sys.exit(1)
688 649
650 (options, args) = parse_args()
651 if not options.child:
652 os.umask(022)
653
654 check_required_tools()
655
656 # Reset some environment variables to well-known values so that
657 # the tests produce repeatable output.
658 os.environ['LANG'] = os.environ['LC_ALL'] = 'C'
659 os.environ['TZ'] = 'GMT'
660 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
661 os.environ['CDPATH'] = ''
662
663 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
664 HGTMP = os.environ['HGTMP'] = os.path.realpath(tempfile.mkdtemp('', 'hgtests.',
665 options.tmpdir))
666 DAEMON_PIDS = None
667 HGRCPATH = None
668
669 os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
670 os.environ["HGMERGE"] = "internal:merge"
671 os.environ["HGUSER"] = "test"
672 os.environ["HGENCODING"] = "ascii"
673 os.environ["HGENCODINGMODE"] = "strict"
674 os.environ["HGPORT"] = str(options.port)
675 os.environ["HGPORT1"] = str(options.port + 1)
676 os.environ["HGPORT2"] = str(options.port + 2)
677
678 if options.with_hg:
679 INST = options.with_hg
680 else:
681 INST = os.path.join(HGTMP, "install")
682 BINDIR = os.environ["BINDIR"] = os.path.join(INST, "bin")
683 PYTHONDIR = os.path.join(INST, "lib", "python")
684 COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
685
686 expecthg = os.path.join(HGTMP, 'install', 'lib', 'python', 'mercurial')
687 hgpkg = None
688
689 if len(args) == 0: 689 if len(args) == 0:
690 args = os.listdir(".") 690 args = os.listdir(".")
691 args.sort() 691 args.sort()
692 692
693 tests = [] 693 tests = []