[Piglit] [PATCH 1/2] piglit-print-commands: Print relative paths for binaries.

Brian Paul brianp at vmware.com
Wed Jun 26 08:12:39 PDT 2013


On 06/26/2013 08:23 AM, jfonseca at vmware.com wrote:
> From: José Fonseca <jfonseca at vmware.com>
>
> Relative executable paths introduce no new requirements.  The tests'
> arguments are already relative, so they already imply that the commands
> must be run from the top of the piglit directory for printed commands to
> work properly.
>
> The benefit of relative executable paths is that it makes it easier to
> run the tests on a different directory later on.
> ---
>   piglit-print-commands.py | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/piglit-print-commands.py b/piglit-print-commands.py
> index 74cc70c..fb5510c 100755
> --- a/piglit-print-commands.py
> +++ b/piglit-print-commands.py
> @@ -88,7 +88,12 @@ def main():
>           if isinstance(test, GleanTest):
>               for var, val in test.env.items():
>                   command += var + "='" + val + "' "
> -        command += ' '.join(test.command)
> +
> +        # Make the test command relative to the piglit_dir
> +        testCommand = test.command[:]
> +        testCommand[0] = os.path.relpath(testCommand[0], piglit_dir)
> +
> +        command += ' '.join(testCommand)
>           return command
>
>       profile.prepare_test_list(env)
>

For both:
Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list