diff tests/test-run-tests.t @ 27141:a4e3dec3010e

run-tests: add --slowtimeout and use it for slow tests
author timeless <timeless@mozdev.org>
date Wed, 25 Nov 2015 00:39:05 +0000
parents c281c20ad0ad
children a40b623e6380
line wrap: on
line diff
--- a/tests/test-run-tests.t	Sat Oct 31 22:17:05 2015 +0900
+++ b/tests/test-run-tests.t	Wed Nov 25 00:39:05 2015 +0000
@@ -401,6 +401,36 @@
   .
   # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
 
+timeouts
+========
+  $ cat > test-timeout.t <<EOF
+  >   $ sleep 2
+  >   $ echo pass
+  >   pass
+  > EOF
+  > echo '#require slow' > test-slow-timeout.t
+  > cat test-timeout.t >> test-slow-timeout.t
+  $ run-tests.py --with-hg=`which hg` --timeout=1 --slowtimeout=3 \
+  > test-timeout.t test-slow-timeout.t
+  s
+  ERROR: test-timeout.t output changed
+  !
+  Skipped test-slow-timeout.t: skipped
+  Failed test-timeout.t: timed out
+  # Ran 1 tests, 1 skipped, 0 warned, 1 failed.
+  python hash seed: * (glob)
+  [1]
+  $ run-tests.py --with-hg=`which hg` --timeout=1 --slowtimeout=3 \
+  > test-timeout.t test-slow-timeout.t --allow-slow-tests
+  .
+  ERROR: test-timeout.t output changed
+  !
+  Failed test-timeout.t: timed out
+  # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
+  python hash seed: * (glob)
+  [1]
+  $ rm test-timeout.t test-slow-timeout.t
+
 test for --time
 ==================