-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exec-test: allow setting of the working directory #5937
Comments
Hi @dgibson, can you share your opinion on this? Thanks! |
Hi @clebergnu, sorry it's taken me a while to look at this. I don't think setting the cwd relative to the uri or one of the arguments is very useful.
Instead, what I think would be useful is to be able to set the cwd as a path relative to the directory if the For example, in some source tree
I don't personally see a use for setting cwd based on kwargs, but it might be useful to someone, so I have no strong opinion on that option. What might be useful, would be the ability to pass the test an environment variable (or Python kwarg, I guess) that's given as a path relative to the
(the specific syntax I'm using there is just an example to get the idea across, I don't think it would be a good choice for a final syntax). |
Is your feature request related to a problem? Please describe.
The
exec-test
test type allows users to run an executable given by absolute path, or more commonly by relative path. In both cases, the current working directory inherited by Avocado or the specific test runner (sayavocado-runner-exec-test
) may not be appropriate to the executable.One common situation is when using an executable that will depend on files located somewhere else in the filesystem. For instance, having a runnable's
uri
ofmake
, together with a make target as an argument given toargs
, will depend on the location of theMakefile
containing that target.The goal here is to implement a way to control how
exec-test
s can set their current working directory, so that use cases such asmake <target>
can be defined withuri
andargs
in a way that makes the execution relocatable (that is, does not depend on running from a specific location).Describe the solution you'd like
A configuration option such as
runner.exectest.cwd
can take a number of options that will control the current working for the executables themselves. For instance:DIR_OF_URI
: would set the executable current working directory to the directory name of the URI$ARGS[0]
: would set the current working directory to the same directory given as the first argument$KWARGS["WORKING_DIR"]
: would set the executable current working directory to the location of theWORKING_DIR
keyword argument.Describe alternatives you've considered
None.
Additional information
None
The text was updated successfully, but these errors were encountered: