run-tests: use return values instead of sys.exit stable
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 24 Mar 2014 21:41:56 -0700
branchstable
changeset 1364 772a53435e14
parent 1363 58a33a3ed565
child 1365 51476d2dcab1
run-tests: use return values instead of sys.exit [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Mon Mar 24 21:37:33 2014 -0700
+++ b/tests/run-tests.py	Mon Mar 24 21:41:56 2014 -0700
@@ -1228,7 +1228,8 @@
             # Meaning of tmpdir has changed since 1.3: we used to create
             # HGTMP inside tmpdir; now HGTMP is tmpdir.  So fail if
             # tmpdir already exists.
-            sys.exit("error: temp dir %r already exists" % tmpdir)
+            print "error: temp dir %r already exists" % tmpdir
+            return 1
 
             # Automatically removing tmpdir sounds convenient, but could
             # really annoy anyone in the habit of using "--tmpdir=/tmp"
@@ -1293,10 +1294,10 @@
     vlog("# Using", IMPL_PATH, os.environ[IMPL_PATH])
 
     try:
-        sys.exit(runtests(options, tests) or 0)
+        return runtests(options, tests) or 0
     finally:
         time.sleep(.1)
         cleanup(options)
 
 if __name__ == '__main__':
-    main(sys.argv[1:])
+    sys.exit(main(sys.argv[1:]))