[Intel-gfx] [PATCH igt v2] igt/tools_test: Check the tools exist before executing
Petri Latvala
petri.latvala at intel.com
Thu Dec 14 12:39:35 UTC 2017
On 12/14/2017 01:24 PM, Chris Wilson wrote:
> Quoting Petri Latvala (2017-12-14 11:20:18)
>> On Thu, Dec 14, 2017 at 11:14:35AM +0000, Chris Wilson wrote:
>>>> Why the chdir?
>>> For me, I was trying to standardise the test, since "../tools" bakes in
>>> so many assumptions that simply aren't true when one invokes
>>> $path/tools_test. Back to the igt_data_dir() request.
>> Aye, the assumption is bad and should get changed to support both run
>> methods (within build dir, with installed). Currently it works by
>> carefully setting up the CI deployment so paths match. =(
>>
>>>
>>>> CI runs tests with IGT installed (make install). The test's directory
>>>> is $libexecdir/intel-gpu-tools/, ../tools is $libexecdir/tools and
>>>> that doesn't exist.
>>> So where was it expecting to find the tools?
>>
>> CI deploys the tools next to piglit. $cwd is piglit's directory when
>> running through piglit, tools are deployed to $piglit/../tools.
> How about
>
> if (access("../tools/", F_OK)) {
> chdir();
> }
>
Should be fine that way. Add a TODO comment somewhere about finding the
directory for real.
--
Petri Latvala
More information about the Intel-gfx
mailing list