From patchwork Sat Jul 13 22:25:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3, of, 5] run-tests: do not fail when the path sep does not match on windows From: Simon Heimberg X-Patchwork-Id: 1883 Message-Id: To: Mercurial-devel Date: Sun, 14 Jul 2013 00:25:13 +0200 # HG changeset patch # User Simon Heimberg # Date 1373752948 -7200 # Node ID d9fa7503933a2491fc1bb0d2f5c921655d8f9f37 # Parent 9baf643dca269dde0791972e6f4f092b1913ee2d run-tests: do not fail when the path sep does not match on windows Instead of failing the test when \ instead of / is returned, only print a warning. Like this writing test output is less delicate. And we do not loose any information when running the test. Output example: ... info, missing glob in test test-example.t (after line 5): moving x/y/z ..... diff -r 9baf643dca26 -r d9fa7503933a tests/run-tests.py --- a/tests/run-tests.py Sam Jul 13 23:58:01 2013 +0200 +++ b/tests/run-tests.py Son Jul 14 00:02:28 2013 +0200 @@ -626,6 +626,8 @@ if (el.endswith(" (re)\n") and rematch(el[:-6], l) or el.endswith(" (glob)\n") and globmatch(el[:-8], l)): return True + elif os.altsep and l.replace('\\', '/') == el: + return 'slash' return False def tsttest(test, wd, options, replacements, env): @@ -781,8 +783,12 @@ if pos in expected and expected[pos]: el = expected[pos].pop(0) - if linematch(el, lout): + r = linematch(el, lout) + if r: postout.append(" " + el) + if r == 'slash': + log('\ninfo, missing glob in test %s (after line %d): %s' + % (test, pos, el)) else: if needescape(lout): lout = stringescape(lout.rstrip('\n')) + " (esc)\n"