run-tests: add --pure flag for using pure Python modules
authorMartin Geisler <mg@daimi.au.dk>
Sat, 31 Jan 2009 22:50:18 +0100
changeset 7723 a343cd25e425
parent 7722 103127a8cbdb
child 7724 fff6e253e1f6
run-tests: add --pure flag for using pure Python modules
tests/run-tests.py
--- a/tests/run-tests.py	Sat Jan 24 01:44:43 2009 +0100
+++ b/tests/run-tests.py	Sat Jan 31 22:50:18 2009 +0100
@@ -67,6 +67,8 @@
     help="skip showing test changes")
 parser.add_option("--with-hg", type="string",
     help="test existing install at given location")
+parser.add_option("--pure", action="store_true",
+    help="use pure Python code instead of C extensions")
 
 for option, default in defaults.items():
     defaults[option] = int(os.environ.get(*default))
@@ -175,13 +177,14 @@
     global python
     vlog("# Performing temporary installation of HG")
     installerrs = os.path.join("tests", "install.err")
+    pure = options.pure and "--pure" or ""
 
     # Run installer in hg root
     os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..'))
-    cmd = ('%s setup.py clean --all'
+    cmd = ('%s setup.py %s clean --all'
            ' install --force --prefix="%s" --install-lib="%s"'
            ' --install-scripts="%s" >%s 2>&1'
-           % (sys.executable, INST, PYTHONDIR, BINDIR, installerrs))
+           % (sys.executable, pure, INST, PYTHONDIR, BINDIR, installerrs))
     vlog("# Running", cmd)
     if os.system(cmd) == 0:
         if not verbose: