This is an archive of the discontinued Mercurial Phabricator instance.

run-tests: fix TESTDIR if testdescs are absolute paths
ClosedPublic

Authored by spectral on Nov 15 2017, 11:41 PM.

Details

Summary

Commit a18eef03d879 made TESTDIR be the location of the arguments that were
passed to run-tests.py instead of just PWD. It assumed that these tests were
specified using relative paths, so if pwd was /tmp/foo, and the first argument
was /tmp/baz, it would set TESTDIR to /tmp/foo//tmp/baz.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

spectral created this revision.Nov 15 2017, 11:41 PM
yuja requested changes to this revision.Nov 16 2017, 9:38 AM
yuja added a subscriber: yuja.

Looks good, but perhaps we can simply do os.path.join(TESTDIR, pathname)
for any pathname.

This revision now requires changes to proceed.Nov 16 2017, 9:38 AM
spectral updated this revision to Diff 3578.Nov 16 2017, 3:42 PM
In D1433#23806, @yuja wrote:

Looks good, but perhaps we can simply do os.path.join(TESTDIR, pathname)
for any pathname.

I didn't think that would work because of bytes, but apparently it does, at least on 2.7.13 and 3.5.3 on my linux machine. Done.

yuja accepted this revision.Nov 17 2017, 8:32 AM

Queued, thanks. FIle APIs still accept bytes/unicode on Py3.

tests/run-tests.py
2359–2361

Restored if pathname: part, caught by test-run-tests.t

This revision is now accepted and ready to land.Nov 17 2017, 8:32 AM
This revision was automatically updated to reflect the committed changes.