Merge with stable
authorChristian Ebert <blacktrash@gmx.net>
Sat, 08 Jun 2013 13:46:05 +0100
changeset 1271 181e420ff0ac
parent 1264 b42c9f1d461a (current diff)
parent 1270 79e0df6ffaad (diff)
child 1275 b4ecdf12956f
Merge with stable
--- a/tests/run-tests.py	Thu Jun 06 22:36:18 2013 +0100
+++ b/tests/run-tests.py	Sat Jun 08 13:46:05 2013 +0100
@@ -256,10 +256,6 @@
             sys.stderr.write(
                 'warning: --timeout option ignored with --debug\n')
         options.timeout = 0
-        if options.time:
-            sys.stderr.write(
-                'warning: --time option ignored with --debug\n')
-        options.time = False
     if options.py3k_warnings:
         if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
             parser.error('--py3k-warnings can only be used on Python 2.6+')
@@ -333,7 +329,7 @@
 
 def createhgrc(path, options):
     # create a fresh hgrc
-    hgrc = open(path, 'w+')
+    hgrc = open(path, 'w')
     hgrc.write('[ui]\n')
     hgrc.write('slash = True\n')
     hgrc.write('interactive = False\n')
@@ -960,12 +956,15 @@
     env = createenv(options, testtmp, threadtmp, port)
     createhgrc(env['HGRCPATH'], options)
 
-    if options.time:
-        starttime = time.time()
-    ret, out = runner(testpath, testtmp, options, replacements, env)
-    if options.time:
+    starttime = time.time()
+    try:
+        ret, out = runner(testpath, testtmp, options, replacements, env)
+    except KeyboardInterrupt:
         endtime = time.time()
-        times.append((test, endtime - starttime))
+        log('INTERRUPTED: %s (after %d seconds)' % (test, endtime - starttime))
+        raise
+    endtime = time.time()
+    times.append((test, endtime - starttime))
     vlog("# Ret was:", ret)
 
     killdaemons(env['DAEMON_PIDS'])