tests/run-tests.py
branchstable
changeset 1368 27b5b55ff3d3
parent 1366 987a80dec7db
child 1369 1161be3ff133
equal deleted inserted replaced
1366:987a80dec7db 1368:27b5b55ff3d3
   694     n = 0
   694     n = 0
   695     for n, l in enumerate(t):
   695     for n, l in enumerate(t):
   696         if not l.endswith('\n'):
   696         if not l.endswith('\n'):
   697             l += '\n'
   697             l += '\n'
   698         if l.startswith('#if'):
   698         if l.startswith('#if'):
       
   699             lsplit = l.split()
       
   700             if len(lsplit) < 2 or lsplit[0] != '#if':
       
   701                 after.setdefault(pos, []).append('  !!! invalid #if\n')
   699             if skipping is not None:
   702             if skipping is not None:
   700                 after.setdefault(pos, []).append('  !!! nested #if\n')
   703                 after.setdefault(pos, []).append('  !!! nested #if\n')
   701             skipping = not hghave(l.split()[1:])
   704             skipping = not hghave(lsplit[1:])
   702             after.setdefault(pos, []).append(l)
   705             after.setdefault(pos, []).append(l)
   703         elif l.startswith('#else'):
   706         elif l.startswith('#else'):
   704             if skipping is None:
   707             if skipping is None:
   705                 after.setdefault(pos, []).append('  !!! missing #if\n')
   708                 after.setdefault(pos, []).append('  !!! missing #if\n')
   706             skipping = not skipping
   709             skipping = not skipping