[PATCH] D44598: [lit] Report line number for failed RUN command

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 09:53:13 PDT 2018


jdenny added inline comments.


================
Comment at: utils/lit/lit/TestRunner.py:792
 
+    if cmd.commands[0].args[0] == ':':
+        if len(cmd.commands) != 1:
----------------
delcypher wrote:
> The null command is pretty esoteric but occasionally useful in normal shell script. What's the reason it's not supported?
> I guess we don't normally need it and it's a waste of time to implement it for the internal shell?
That would be my guess.  Do you object to implementing it for this purpose?


================
Comment at: utils/lit/lit/TestRunner.py:1367
                 output = []
+            line = ': \'' + keyword + ' at line ' + str(line_number) + \
+                   '\'; ' + line
----------------
delcypher wrote:
> I think this would be more readable as
> 
> ```
> line = ": '{keyword} at line {line}'; {real_command}".format(
>   keyword=keyword,
>   line=line,
>   real_command=line)
> ```
> 
> Or something similar. There's no reason for the `\'` if you use `"` quotes instead.
Sure, I'll change that and the other occurrence you pointed out.


https://reviews.llvm.org/D44598





More information about the llvm-commits mailing list