Avocado is a set of tools and libraries to help with automated testing. One can call it a test framework with benefits. Native tests are written in Python and they follow the unittest pattern, but any executable can serve as a test.
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 (say avocado-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 of make, together with a make target as an argument given to args, will depend on the location of the Makefile containing that target.
The goal here is to implement a way to control how exec-tests can set their current working directory, so that use cases such as make <target> can be defined with uri and args 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 the WORKING_DIR keyword argument.
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