# HG changeset patch # User Mads Kiilerich # Date 1397408460 -7200 # Node ID 27b5b55ff3d3d5a28f90674fd42868d3d2c1a83f # Parent 987a80dec7dbcccdc38813c1e4a4b7f1ac837025 tests: warn on invalid #if directive [ original upstream message ] diff -r 987a80dec7db -r 27b5b55ff3d3 tests/run-tests.py --- a/tests/run-tests.py Mon Mar 24 22:12:37 2014 -0700 +++ b/tests/run-tests.py Sun Apr 13 19:01:00 2014 +0200 @@ -696,9 +696,12 @@ 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: