changeset 21755:9e9288b9463a

test-run-tests.t: test the --interactive option
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 30 May 2014 12:12:12 -0700
parents 7e14d026c4c4
children f5fd1580a649
files tests/test-run-tests.t
diffstat 1 files changed, 50 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-run-tests.t	Fri Jun 13 14:45:23 2014 +0530
+++ b/tests/test-run-tests.t	Fri May 30 12:12:12 2014 -0700
@@ -143,3 +143,53 @@
 (delete the duplicated test file)
   $ rm test-failure-copy.t
 
+
+Interactive run
+===============
+
+(backup the failing test)
+  $ cp test-failure.t backup
+
+Refuse the fix
+
+  $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
+  
+  --- $TESTTMP/test-failure.t
+  +++ $TESTTMP/test-failure.t.err
+  @@ -1,2 +1,2 @@
+     $ echo babar
+  -  rataxes
+  +  babar
+  
+  ERROR: test-failure.t output changed
+  Accept this change? [n] !.
+  Failed test-failure.t: output changed
+  # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
+  python hash seed: * (glob)
+  [1]
+
+  $ cat test-failure.t
+    $ echo babar
+    rataxes
+
+Accept the fix
+
+  $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
+  
+  --- $TESTTMP/test-failure.t
+  +++ $TESTTMP/test-failure.t.err
+  @@ -1,2 +1,2 @@
+     $ echo babar
+  -  rataxes
+  +  babar
+  
+  ERROR: test-failure.t output changed
+  Accept this change? [n] ..
+  # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
+
+  $ cat test-failure.t
+    $ echo babar
+    babar
+
+(reinstall)
+  $ mv backup test-failure.t