changeset 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
files tests/run-tests.py
diffstat 1 files changed, 39 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Apr 20 21:07:05 2009 -0400
+++ b/tests/run-tests.py	Mon Apr 20 21:10:39 2009 -0400
@@ -496,45 +496,6 @@
         return None
     return ret == 0
 
-(options, args) = parse_args()
-if not options.child:
-    os.umask(022)
-
-    check_required_tools()
-
-# Reset some environment variables to well-known values so that
-# the tests produce repeatable output.
-os.environ['LANG'] = os.environ['LC_ALL'] = 'C'
-os.environ['TZ'] = 'GMT'
-os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
-os.environ['CDPATH'] = ''
-
-TESTDIR = os.environ["TESTDIR"] = os.getcwd()
-HGTMP = os.environ['HGTMP'] = os.path.realpath(tempfile.mkdtemp('', 'hgtests.',
-                                               options.tmpdir))
-DAEMON_PIDS = None
-HGRCPATH = None
-
-os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
-os.environ["HGMERGE"] = "internal:merge"
-os.environ["HGUSER"]   = "test"
-os.environ["HGENCODING"] = "ascii"
-os.environ["HGENCODINGMODE"] = "strict"
-os.environ["HGPORT"] = str(options.port)
-os.environ["HGPORT1"] = str(options.port + 1)
-os.environ["HGPORT2"] = str(options.port + 2)
-
-if options.with_hg:
-    INST = options.with_hg
-else:
-    INST = os.path.join(HGTMP, "install")
-BINDIR = os.environ["BINDIR"] = os.path.join(INST, "bin")
-PYTHONDIR = os.path.join(INST, "lib", "python")
-COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
-
-expecthg = os.path.join(HGTMP, 'install', 'lib', 'python', 'mercurial')
-hgpkg = None
-
 def run_children(tests):
     if not options.with_hg:
         install_hg()
@@ -686,6 +647,45 @@
     if failed:
         sys.exit(1)
 
+(options, args) = parse_args()
+if not options.child:
+    os.umask(022)
+
+    check_required_tools()
+
+# Reset some environment variables to well-known values so that
+# the tests produce repeatable output.
+os.environ['LANG'] = os.environ['LC_ALL'] = 'C'
+os.environ['TZ'] = 'GMT'
+os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
+os.environ['CDPATH'] = ''
+
+TESTDIR = os.environ["TESTDIR"] = os.getcwd()
+HGTMP = os.environ['HGTMP'] = os.path.realpath(tempfile.mkdtemp('', 'hgtests.',
+                                               options.tmpdir))
+DAEMON_PIDS = None
+HGRCPATH = None
+
+os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
+os.environ["HGMERGE"] = "internal:merge"
+os.environ["HGUSER"]   = "test"
+os.environ["HGENCODING"] = "ascii"
+os.environ["HGENCODINGMODE"] = "strict"
+os.environ["HGPORT"] = str(options.port)
+os.environ["HGPORT1"] = str(options.port + 1)
+os.environ["HGPORT2"] = str(options.port + 2)
+
+if options.with_hg:
+    INST = options.with_hg
+else:
+    INST = os.path.join(HGTMP, "install")
+BINDIR = os.environ["BINDIR"] = os.path.join(INST, "bin")
+PYTHONDIR = os.path.join(INST, "lib", "python")
+COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
+
+expecthg = os.path.join(HGTMP, 'install', 'lib', 'python', 'mercurial')
+hgpkg = None
+
 if len(args) == 0:
     args = os.listdir(".")
     args.sort()