[PATCH i-g-t v2 6/7] runner/settings: Serialize command line

Gustavo Sousa gustavo.sousa at intel.com
Wed Jan 22 18:55:34 UTC 2025


Quoting Peter Senna Tschudin (2025-01-22 15:35:30-03:00)
>
>
>On 22.01.2025 19:26, Gustavo Sousa wrote:
>> Quoting Peter Senna Tschudin (2025-01-22 15:16:59-03:00)
>>>
>>>
>>> On 22.01.2025 13:40, Gustavo Sousa wrote:
>>>> Quoting Lucas De Marchi (2025-01-21 19:57:32-03:00)
>>>>> Serialize the command line to metadata.txt. The expected format in the
>>>>> metadata.txt is like below:
>>>>>
>>>>>        cmdline.argc : 6
>>>>>        cmdline.argv[0] : ./build/runner/igt_runner
>>>>>        cmdline.argv[1] : -o
>>>>>        cmdline.argv[2] : --test-list
>>>>>        cmdline.argv[3] : /tmp/testlist.txt
>>>>>        cmdline.argv[4] : build/tests/
>>>>>        cmdline.argv[5] : /tmp/results
>>>>
>>>> One limitation here is that we would run into problems if one of the
>>>> arguments contains a newline character. We need to have a proper way of
>>>> handling that.
>>>
>>> I tested this by adding -t '(?m)\b\w*exec\w*\b\n', is that what you mean?
>> 
>> If you are using bash, I'm afraid '\n' in '(?m)\b\w*exec\w*\b\n' is not
>> turned into a real newline character. Something like $'foo\nbar'
>> would.
>> 
>> Example:
>> 
>>   $ echo 'foo\nbar'
>>   foo\nbar
>> 
>>   $ echo $'foo\nbar'
>>   foo
>>   bar
>
>No no, I am looking for an example that I can pass to igt_runner.

Perhaps that would be possible for --hook and --env, since the user is
free to pass anything there, so I would prefer that we are prepared for
that.

> If there
>is no way to pass a newline character to igt_runner, then there is no
>problem. :-) At least not a blocker for this patch, and we can create a
>Jira for improving special character handling.

If the majority thinks not supporting newlines right now is okay, then
I won't object. :-)

--
Gustavo Sousa


More information about the igt-dev mailing list