[llvm] r210597 - lit: warn when passed invalid pathname
Hans Wennborg
hans at chromium.org
Tue Jun 17 11:26:34 PDT 2014
On Tue, Jun 17, 2014 at 11:13 AM, Daniel Dunbar <daniel at zuster.org> wrote:
> On Tue, Jun 17, 2014 at 10:48 AM, Hans Wennborg <hans at chromium.org> wrote:
>> I would like to simplify this code while I'm here though:
>>
>> --- a/utils/lit/lit/discovery.py
>> +++ b/utils/lit/lit/discovery.py
>> @@ -200,9 +200,7 @@ def find_tests_for_inputs(lit_config, inputs):
>> # Expand '@...' form in inputs.
>> actual_inputs = []
>> for input in inputs:
>> - if os.path.exists(input) or not input.startswith('@'):
>> - actual_inputs.append(input)
>> - else:
>> + if input.startswith('@'):
>> f = open(input[1:])
>> try:
>> for ln in f:
>> @@ -211,6 +209,8 @@ def find_tests_for_inputs(lit_config, inputs):
>> actual_inputs.append(ln)
>> finally:
>> f.close()
>> + else:
>> + actual_inputs.append(input)
>>
>> I think this reflects the intent of the code better - add all files to
>> actual_inputs, except files starting with @ which are treated as
>> response files. (Supporting the case of test inputs start with @
>> doesn't seem important.) What do you think?
>
>
> That is fine with me.
Thanks! r211119.
- Hans
More information about the llvm-commits
mailing list