Skip to content
Snippets Groups Projects
Commit 769198c6a62d authored by Matt Mackall's avatar Matt Mackall
Browse files

run-tests: add #require to abort full test

This allows nuking a bunch of ugly hghave || exit 80 lines.
parent a06172e85fd4
No related branches found
No related tags found
No related merge requests found
......@@ -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')
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment