mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
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. f3517e22bfa1 is an example of where the test has been autocorrecting (with output differences), and ed159a9fcf2a 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.
This commit is contained in:
parent
1a1aaf5b24
commit
b2d78bc596
@ -1451,10 +1451,7 @@ class TTest(Test):
|
||||
|
||||
r = self.linematch(el, lout)
|
||||
if isinstance(r, str):
|
||||
if r == '+glob':
|
||||
lout = el[:-1] + ' (glob)\n'
|
||||
r = '' # Warn only this line.
|
||||
elif r == '-glob':
|
||||
if r == '-glob':
|
||||
lout = ''.join(el.rsplit(' (glob)', 1))
|
||||
r = '' # Warn only this line.
|
||||
elif r == "retry":
|
||||
@ -1613,7 +1610,7 @@ class TTest(Test):
|
||||
if os.altsep:
|
||||
_l = l.replace(b'\\', b'/')
|
||||
if el == _l or os.name == 'nt' and el[:-1] + b'\r\n' == _l:
|
||||
return b'+glob'
|
||||
return True
|
||||
return retry
|
||||
|
||||
@staticmethod
|
||||
|
@ -67,9 +67,9 @@ def wintests():
|
||||
|
||||
missing glob
|
||||
>>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d/fg\n')
|
||||
'special: +glob'
|
||||
True
|
||||
>>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d\\fg\r\n')
|
||||
'special: +glob'
|
||||
True
|
||||
|
||||
restore os.altsep
|
||||
>>> os.altsep = _osaltsep
|
||||
|
Loading…
Reference in New Issue
Block a user