<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 27, 2016 at 12:40 PM, Matthias Braun <span dir="ltr"><<a href="mailto:mbraun@apple.com" target="_blank">mbraun@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>I'd love to see lit report which of the commands failed! I sometimes change lit locally:</div><div><br></div><div><div>- f.write('set -o pipefail;')</div><div>+ f.write('set -o pipefail -x;')</div></div><div><br></div><div>as a bad hack to get this information. We could certainly run the tests one by one instead of concatenating them (in fact lit on windows does that and does report which one failed AFAIK). I did not make this change on unix because I feared it would slow down testing...</div><div><br></div></div></blockquote><div><br></div><div>Ok -- looks like this is a common pain. In many cases, user can get away with it as the the stderr and stdout output can give out some clues -- except for this case we are left with some message that is almost useless.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>In anyway the FileCheck modification you proposed should improve the situation a bit. LGTM.</div></div></blockquote><div><br></div><div>thanks,</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div><br></div><div>- Matthias</div></font></span><div><div class="h5"><br><div><blockquote type="cite"><div>On May 27, 2016, at 12:22 PM, Xinliang David Li via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr">This is a good idea -- except that there seems to be no good way to implement that.<div><br></div><div>For each test, tit tester first creates a shell script that executes subtests as</div><div> ...{ .... | FileCheck ..; } && { .... | FIleCheck ... ; } && ...</div><div><br></div><div>when one sub test fails, the information about which one is lost. </div><div><br></div><div>I will go ahead with this change first. If there are good suggestions on lit improvement, we can revisit it later.</div><div><br></div><div>thanks,</div><div><br></div><div>David </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 27, 2016 at 11:09 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Should we instead modify lit to indicate which command it stopped at? That would seem more general/to cover other cases as well?</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, May 26, 2016 at 6:05 PM, David Li via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>davidxl created this revision.<br>
davidxl added a reviewer: dblaikie.<br>
davidxl added a subscriber: llvm-commits.<br>
<br>
FileCheck dumps minimal information when input is empty. We have many tests that include more than one FileCheck command lines. When such an error happens, figuring out which command actually is the problem can be hard sometimes (e.g, without running environment to reproduce).<br>
<br>
This patch enables FileCheck to dump the full command line as a context line so that it is easier to identify the problem.<br>
<br>
<a href="http://reviews.llvm.org/D20716" rel="noreferrer" target="_blank">http://reviews.llvm.org/D20716</a><br>
<br>
Files:<br>
test/FileCheck/check-empty.txt<br>
utils/FileCheck/FileCheck.cpp<br>
<br>
Index: utils/FileCheck/FileCheck.cpp<br>
===================================================================<br>
--- utils/FileCheck/FileCheck.cpp<br>
+++ utils/FileCheck/FileCheck.cpp<br>
@@ -1298,6 +1298,13 @@<br>
CheckPrefixes.push_back("CHECK");<br>
}<br>
<br>
+static void DumpCommandLine(int argc, char **argv) {<br>
+ errs() << "FileCheck command line: ";<br>
+ for (int I = 0; I < argc; I++)<br>
+ errs() << " " << argv[I];<br>
+ errs() << "\n";<br>
+}<br>
+<br>
int main(int argc, char **argv) {<br>
sys::PrintStackTraceOnErrorSignal();<br>
PrettyStackTraceProgram X(argc, argv);<br>
@@ -1331,6 +1338,7 @@<br>
<br>
if (File->getBufferSize() == 0 && !AllowEmptyInput) {<br>
errs() << "FileCheck error: '" << InputFilename << "' is empty.\n";<br>
+ DumpCommandLine(argc, argv);<br>
return 2;<br>
}<br>
<br>
Index: test/FileCheck/check-empty.txt<br>
===================================================================<br>
--- test/FileCheck/check-empty.txt<br>
+++ test/FileCheck/check-empty.txt<br>
@@ -7,5 +7,6 @@<br>
; NOFOO-NOT: foo<br>
<br>
; EMPTY-ERR: FileCheck error: '-' is empty.<br>
+; EMPTY-ERR-NEXT: FileCheck command line: {{.*}}FileCheck -check-prefix={{.*}}FOO {{.*}}check-empty.txt<br>
; NO-EMPTY-ERR-NOT: FileCheck error: '-' is empty.<br>
; NOT-FOUND: error: expected string not found in input<br>
<br>
<br>
<br></div></div>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div>