This is an archive of the discontinued LLVM Phabricator instance.

Add option to set environment variables from dotest.py
ClosedPublic

Authored by tberghammer on Feb 24 2015, 2:57 AM.

Details

Summary

Add option to set environment variables from dotest.py

Setting environment variables are required when testing on a remote target requiring different flags then the ones specified on the host OS (e.g.: Android).

PS.: I haven't find any reasonable 1 letter flag name, but I am open for suggestions (-e, -E, -s, -S are already used)

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer retitled this revision from to Add option to set environment variables from dotest.py.
tberghammer updated this object.
tberghammer edited the test plan for this revision. (Show Details)
tberghammer added reviewers: clayborg, vharron.
tberghammer added a subscriber: Unknown Object (MLST).
clayborg accepted this revision.Feb 24 2015, 9:47 AM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Feb 24 2015, 9:47 AM
vharron edited edge metadata.Feb 24 2015, 9:53 AM

Does this work if the value side is quoted?

--env FOO="Hello, World"

Are the quotes removed?

tberghammer edited edge metadata.

Unquote value passed to the environment variable

tberghammer added a comment.EditedFeb 25 2015, 4:07 AM

Does this work if the value side is quoted?

--env FOO="Hello, World"

Are the quotes removed?

Added full unquoting logic which remove the surrounding quotes and also deals with escaping inside the value if neccessary

This revision was automatically updated to reflect the committed changes.

After some follow up discussion with @labath we found out that the unquoting is done either by dosep.py or by the shell executing the command what makes it unnecessary.