# HG changeset patch # User timeless # Date 2015-12-22 08:00:03 # Node ID 80b53082a3538475ef88b0767fdfbffbe569e734 # Parent 56c2caffde3d89f53faefac33678388bc95d20e0 run-tests: report missing feature for skipped tests diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -940,11 +940,11 @@ class TTest(Test): sys.exit(1) if ret != 0: - return False + return False, stdout if 'slow' in reqs: self._timeout = self._slowtimeout - return True + return True, None def _parsetest(self, lines): # We generate a shell script which outputs unique markers to line @@ -989,8 +989,9 @@ class TTest(Test): lsplit = l.split() if len(lsplit) < 2 or lsplit[0] != b'#require': after.setdefault(pos, []).append(' !!! invalid #require\n') - if not self._hghave(lsplit[1:]): - script = [b"exit 80\n"] + haveresult, message = self._hghave(lsplit[1:]) + if not haveresult: + script = [b'echo "%s"\nexit 80\n' % message] break after.setdefault(pos, []).append(l) elif l.startswith(b'#if'): @@ -999,7 +1000,7 @@ class TTest(Test): after.setdefault(pos, []).append(' !!! invalid #if\n') if skipping is not None: after.setdefault(pos, []).append(' !!! nested #if\n') - skipping = not self._hghave(lsplit[1:]) + skipping = not self._hghave(lsplit[1:])[0] after.setdefault(pos, []).append(l) elif l.startswith(b'#else'): if skipping is None: diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -418,7 +418,7 @@ timeouts > cat test-timeout.t >> test-slow-timeout.t $ rt --timeout=1 --slowtimeout=3 test-timeout.t test-slow-timeout.t st - Skipped test-slow-timeout.t: skipped + Skipped test-slow-timeout.t: missing feature: allow slow tests Failed test-timeout.t: timed out # Ran 1 tests, 1 skipped, 0 warned, 1 failed. python hash seed: * (glob) @@ -460,7 +460,7 @@ Skips > EOF $ rt --nodiff !.s - Skipped test-skip.t: skipped + Skipped test-skip.t: missing feature: nail clipper Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 0 warned, 1 failed. python hash seed: * (glob) @@ -468,14 +468,14 @@ Skips $ rt --keyword xyzzy .s - Skipped test-skip.t: skipped + Skipped test-skip.t: missing feature: nail clipper # Ran 2 tests, 2 skipped, 0 warned, 0 failed. Skips with xml $ rt --keyword xyzzy \ > --xunit=xunit.xml .s - Skipped test-skip.t: skipped + Skipped test-skip.t: missing feature: nail clipper # Ran 2 tests, 2 skipped, 0 warned, 0 failed. $ cat xunit.xml @@ -510,7 +510,7 @@ test for --json ERROR: test-failure.t output changed !.s - Skipped test-skip.t: skipped + Skipped test-skip.t: missing feature: nail clipper Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 0 warned, 1 failed. python hash seed: * (glob) @@ -558,7 +558,7 @@ Test that failed test accepted through i 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 + Skipped test-skip.t: missing feature: nail clipper # Ran 2 tests, 1 skipped, 0 warned, 0 failed. $ cat report.json @@ -673,7 +673,7 @@ test support for --allow-slow-tests > EOF $ rt $HGTEST_RUN_TESTS_PURE test-very-slow-test.t s - Skipped test-very-slow-test.t: skipped + Skipped test-very-slow-test.t: missing feature: allow slow tests # Ran 0 tests, 1 skipped, 0 warned, 0 failed. $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t .