comparison tests/run-tests.py @ 22045:769198c6a62d

run-tests: add #require to abort full test This allows nuking a bunch of ugly hghave || exit 80 lines.
author Matt Mackall <mpm@selenic.com>
date Wed, 06 Aug 2014 10:34:54 -0500
parents a06172e85fd4
children 70bdf59d27b6
comparison
equal deleted inserted replaced
22044:a06172e85fd4 22045:769198c6a62d
808 script.append('alias pwd="pwd -W"\n') 808 script.append('alias pwd="pwd -W"\n')
809 809
810 for n, l in enumerate(lines): 810 for n, l in enumerate(lines):
811 if not l.endswith('\n'): 811 if not l.endswith('\n'):
812 l += '\n' 812 l += '\n'
813 if l.startswith('#if'): 813 if l.startswith('#require'):
814 lsplit = l.split()
815 if len(lsplit) < 2 or lsplit[0] != '#require':
816 after.setdefault(pos, []).append(' !!! invalid #require\n')
817 if not self._hghave(lsplit[1:]):
818 script = ["exit 80\n"]
819 break
820 after.setdefault(pos, []).append(l)
821 elif l.startswith('#if'):
814 lsplit = l.split() 822 lsplit = l.split()
815 if len(lsplit) < 2 or lsplit[0] != '#if': 823 if len(lsplit) < 2 or lsplit[0] != '#if':
816 after.setdefault(pos, []).append(' !!! invalid #if\n') 824 after.setdefault(pos, []).append(' !!! invalid #if\n')
817 if skipping is not None: 825 if skipping is not None:
818 after.setdefault(pos, []).append(' !!! nested #if\n') 826 after.setdefault(pos, []).append(' !!! nested #if\n')