run-tests: report missing feature for skipped tests
authortimeless <timeless@mozdev.org>
Tue, 22 Dec 2015 08:00:03 +0000
changeset 27564 80b53082a353
parent 27563 56c2caffde3d
child 27565 e7937438e3f7
run-tests: report missing feature for skipped tests
tests/run-tests.py
tests/test-run-tests.t
--- a/tests/run-tests.py	Sat Dec 26 16:06:12 2015 +0900
+++ b/tests/run-tests.py	Tue Dec 22 08:00:03 2015 +0000
@@ -940,11 +940,11 @@
             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 @@
                 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 @@
                     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:
--- a/tests/test-run-tests.t	Sat Dec 26 16:06:12 2015 +0900
+++ b/tests/test-run-tests.t	Tue Dec 22 08:00:03 2015 +0000
@@ -418,7 +418,7 @@
   > 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 @@
   > 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 @@
 
   $ 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
   <?xml version="1.0" encoding="utf-8"?>
@@ -510,7 +510,7 @@
   
   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 @@
    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 @@
   > 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
   .