[patch] Unify handling of PWD

Manuel Klimek klimek at google.com
Thu Aug 8 13:49:16 PDT 2013


On Thu, Aug 8, 2013 at 4:51 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> The attached patches centralize the handling of the PWD environment
> variable in llvm::sys::fs::current_path().
>
> The only change in behavior I know is that using fake PWD environment
> variables in tooling tests doesn't work since we compare the unique id
> of PWD with the unique id of '.'.
>

Hm, the problem is that those tests really should test whether PWD is taken
into account (at least clang-check-pwd).

The real fix for those tests is now to create a symlink, cd into the
symlink directory, set PWD to the symlink path, and assert on the error
messages that the symlinked path is taken, as that would be the breaking
behavior if PWD was not taken.

Could you please add a comment to the tests that explain this?
// FIXME: PWD cannot be set to a different path any more; adapt the test to
build a symlink and verify
// correct handling of PWD by asserting that clang's error messages contain
the symlink path instead of
// the underlying path.

As a side note: if you put changes affecting Tooling through phabricator,
you'll get my eternal gratitude ;)

Cheers,
/Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130808/79f5c043/attachment.html>


More information about the cfe-commits mailing list