Mercurial > public > mercurial-scm > hg
comparison tests/run-tests.py @ 23728:31d3f973d079
run-tests: automatically add (glob) to "saved backup bundle to" lines
Avoid spending too much time adding (glob) after running run-tests -i. This
doesn't handle all cases but it helps.
The run-tests tests add a bit of escaping of trailing (glob) in the output to
avoid interference from the outer test runner.
The regexp for matching the output lines contains a group for making multiline
substitute in a way that works with Python before 2.7.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 27 Nov 2014 02:04:30 +0100 |
parents | 42ed0780ec4b |
children | 661b246bf1c4 |
comparison
equal
deleted
inserted
replaced
23727:987ef74d8d01 | 23728:31d3f973d079 |
---|---|
625 """ | 625 """ |
626 r = [ | 626 r = [ |
627 (r':%s\b' % self._startport, ':$HGPORT'), | 627 (r':%s\b' % self._startport, ':$HGPORT'), |
628 (r':%s\b' % (self._startport + 1), ':$HGPORT1'), | 628 (r':%s\b' % (self._startport + 1), ':$HGPORT1'), |
629 (r':%s\b' % (self._startport + 2), ':$HGPORT2'), | 629 (r':%s\b' % (self._startport + 2), ':$HGPORT2'), |
630 (r'(?m)^(saved backup bundle to .*\.hg)( \(glob\))?$', | |
631 r'\1 (glob)'), | |
630 ] | 632 ] |
631 | 633 |
632 if os.name == 'nt': | 634 if os.name == 'nt': |
633 r.append( | 635 r.append( |
634 (''.join(c.isalpha() and '[%s%s]' % (c.lower(), c.upper()) or | 636 (''.join(c.isalpha() and '[%s%s]' % (c.lower(), c.upper()) or |
1023 if el == l or os.name == 'nt' and el[:-1] + '\r\n' == l: | 1025 if el == l or os.name == 'nt' and el[:-1] + '\r\n' == l: |
1024 return True | 1026 return True |
1025 if el.endswith(" (re)\n"): | 1027 if el.endswith(" (re)\n"): |
1026 return TTest.rematch(el[:-6], l) | 1028 return TTest.rematch(el[:-6], l) |
1027 if el.endswith(" (glob)\n"): | 1029 if el.endswith(" (glob)\n"): |
1030 # ignore '(glob)' added to l by 'replacements' | |
1031 if l.endswith(" (glob)\n"): | |
1032 l = l[:-8] + "\n" | |
1028 return TTest.globmatch(el[:-8], l) | 1033 return TTest.globmatch(el[:-8], l) |
1029 if os.altsep and l.replace('\\', '/') == el: | 1034 if os.altsep and l.replace('\\', '/') == el: |
1030 return '+glob' | 1035 return '+glob' |
1031 return False | 1036 return False |
1032 | 1037 |