# HG changeset patch # User Pierre-Yves David # Date 1431138731 25200 # Node ID f44db7343be98ba0af97efa21786c37dbd39ba43 # Parent f52560c649535aec1bc601d060ee54426f63be73 run-test: add a test for json output when -i is used The -i can apparently confused some internal data structure, we want to make sure we do not regress. diff -r f52560c64953 -r f44db7343be9 tests/test-run-tests.t --- a/tests/test-run-tests.t Thu Apr 30 16:45:03 2015 -0700 +++ b/tests/test-run-tests.t Fri May 08 19:32:11 2015 -0700 @@ -490,6 +490,46 @@ } } (no-eol) +Test that failed test accepted through interactive are properly reported: + + $ cp test-failure.t backup + $ echo y | $TESTDIR/run-tests.py --with-hg=`which hg` --json -i + + --- $TESTTMP/test-failure.t + +++ $TESTTMP/test-failure.t.err + @@ -1,4 +1,4 @@ + $ echo babar + - rataxes + + babar + This is a noop statement so that + this test is still more bytes than success. + Accept this change? [n] ..s + Skipped test-skip.t: skipped + # Ran 2 tests, 1 skipped, 0 warned, 0 failed. + + $ cat report.json + testreport ={ + "test-failure.t": [\{] (re) + "csys": "\s*[\d\.]{4,5}", ? (re) + "cuser": "\s*[\d\.]{4,5}", ? (re) + "result": "success", ? (re) + "time": "\s*[\d\.]{4,5}" (re) + }, ? (re) + "test-skip.t": { + "csys": "\s*[\d\.]{4,5}", ? (re) + "cuser": "\s*[\d\.]{4,5}", ? (re) + "result": "skip", ? (re) + "time": "\s*[\d\.]{4,5}" (re) + }, ? (re) + "test-success.t": [\{] (re) + "csys": "\s*[\d\.]{4,5}", ? (re) + "cuser": "\s*[\d\.]{4,5}", ? (re) + "result": "success", ? (re) + "time": "\s*[\d\.]{4,5}" (re) + } + } (no-eol) + $ mv backup test-failure.t + #endif backslash on end of line with glob matching is handled properly