run-tests: add #require to abort full test
This allows nuking a bunch of ugly hghave || exit 80 lines.
--- 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')
--- a/tests/test-run-tests.t Tue Aug 05 21:17:11 2014 -0400
+++ b/tests/test-run-tests.t Wed Aug 06 10:34:54 2014 -0500
@@ -309,7 +309,7 @@
================
$ cat > test-skip.t <<EOF
> $ echo xyzzy
- > $ exit 80
+ > #require false
> EOF
$ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
!.s