mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
tests: warn on invalid #if directive
This commit is contained in:
parent
584b6544fe
commit
56bd029861
@ -702,9 +702,12 @@ def tsttest(test, wd, options, replacements, env):
|
||||
if not l.endswith('\n'):
|
||||
l += '\n'
|
||||
if l.startswith('#if'):
|
||||
lsplit = l.split()
|
||||
if len(lsplit) < 2 or lsplit[0] != '#if':
|
||||
after.setdefault(pos, []).append(' !!! invalid #if\n')
|
||||
if skipping is not None:
|
||||
after.setdefault(pos, []).append(' !!! nested #if\n')
|
||||
skipping = not hghave(l.split()[1:])
|
||||
skipping = not hghave(lsplit[1:])
|
||||
after.setdefault(pos, []).append(l)
|
||||
elif l.startswith('#else'):
|
||||
if skipping is None:
|
||||
|
@ -1,4 +1,4 @@
|
||||
#ifdef unix-permissions no-root
|
||||
#if unix-permissions no-root
|
||||
|
||||
$ hg init t
|
||||
$ cd t
|
||||
|
Loading…
Reference in New Issue
Block a user