Mercurial > hg
comparison tests/run-tests.py @ 35382:dfae14354660
run-tests: accept '\' vs '/' path differences without '(glob)'
Having to constantly adjust these is a hassle. It's easy for this to slip by
when not testing on Windows, and then when it happens on stable, the tests fail
for the next 3 months if we follow the rules for stable.
This works the same way the EOL differences are ignored, namely to adjust on the
fly and recheck on Windows. I can't think of any situation where there would be
a '\' on Windows, a '/' elsewhere, and the '/' should be considered a failure on
Windows.
This fixes the obvious output problems where (glob) is missing. Without this,
test-alias.t, test-remotenames.t and test-largefiles-misc.t are failing. The
flip side (not handled by this) is the case where an unnecessary glob is
present. There seems to be two separate behaviors. cf300c1ad7bf is an example
of where the test has been autocorrecting (with output differences), and
d4ec69ff652a is an example where the test fails and reports 'no result code from
test'. Hopefully those cases will become even more rare if people don't need to
guess at when a glob is needed for a Windows path.
It's probably unreasonable to submit a single patch that wipes out all of the
(glob) instances that were only used to hide path differences, given the churn
from other contributors. Since their presence isn't harming the tests, these
can be removed through attrition.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 10 Dec 2017 00:16:11 -0500 |
parents | 14fd435763ee |
children | 0432e54f4dbe |
comparison
equal
deleted
inserted
replaced
35381:14fd435763ee | 35382:dfae14354660 |
---|---|
1449 while i < len(els): | 1449 while i < len(els): |
1450 el = els[i] | 1450 el = els[i] |
1451 | 1451 |
1452 r = self.linematch(el, lout) | 1452 r = self.linematch(el, lout) |
1453 if isinstance(r, str): | 1453 if isinstance(r, str): |
1454 if r == '+glob': | 1454 if r == '-glob': |
1455 lout = el[:-1] + ' (glob)\n' | |
1456 r = '' # Warn only this line. | |
1457 elif r == '-glob': | |
1458 lout = ''.join(el.rsplit(' (glob)', 1)) | 1455 lout = ''.join(el.rsplit(' (glob)', 1)) |
1459 r = '' # Warn only this line. | 1456 r = '' # Warn only this line. |
1460 elif r == "retry": | 1457 elif r == "retry": |
1461 postout.append(b' ' + el) | 1458 postout.append(b' ' + el) |
1462 els.pop(i) | 1459 els.pop(i) |
1611 l = l[:-8] + b"\n" | 1608 l = l[:-8] + b"\n" |
1612 return TTest.globmatch(el[:-8], l) or retry | 1609 return TTest.globmatch(el[:-8], l) or retry |
1613 if os.altsep: | 1610 if os.altsep: |
1614 _l = l.replace(b'\\', b'/') | 1611 _l = l.replace(b'\\', b'/') |
1615 if el == _l or os.name == 'nt' and el[:-1] + b'\r\n' == _l: | 1612 if el == _l or os.name == 'nt' and el[:-1] + b'\r\n' == _l: |
1616 return b'+glob' | 1613 return True |
1617 return retry | 1614 return retry |
1618 | 1615 |
1619 @staticmethod | 1616 @staticmethod |
1620 def parsehghaveoutput(lines): | 1617 def parsehghaveoutput(lines): |
1621 '''Parse hghave log lines. | 1618 '''Parse hghave log lines. |