tests/run-tests.py
changeset 22045 769198c6a62d
parent 22044 a06172e85fd4
child 22104 70bdf59d27b6
--- a/tests/run-tests.py	Tue Aug 05 21:17:11 2014 -0400
+++ b/tests/run-tests.py	Wed Aug 06 10:34:54 2014 -0500
@@ -810,7 +810,15 @@
         for n, l in enumerate(lines):
             if not l.endswith('\n'):
                 l += '\n'
-            if l.startswith('#if'):
+            if l.startswith('#require'):
+                lsplit = l.split()
+                if len(lsplit) < 2 or lsplit[0] != '#require':
+                    after.setdefault(pos, []).append('  !!! invalid #require\n')
+                if not self._hghave(lsplit[1:]):
+                    script = ["exit 80\n"]
+                    break
+                after.setdefault(pos, []).append(l)
+            elif l.startswith('#if'):
                 lsplit = l.split()
                 if len(lsplit) < 2 or lsplit[0] != '#if':
                     after.setdefault(pos, []).append('  !!! invalid #if\n')