<div dir="ltr">In cases where this is trigger, wouldn't the warning always fire and the proper way to suppress (so developers don't regularly see warnings) to exclude that path? If so, then it seems like erroring out is ok, it just forces resolution of that issue immediately.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 8:09 AM, Brian Gesiak <span dir="ltr"><<a href="mailto:modocache@gmail.com" target="_blank">modocache@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">modocache created this revision.<br>
modocache added reviewers: ddunbar, abdulras.<br>
modocache added subscribers: llvm-commits, kastiglione.<br>
<br>
lit is usually forgiving when it comes to files that aren't tests, but<br>
happen to match the test suffix being searched for. For example, even if I<br>
specify a suffix of ".py", lit will not fail the test suite if it finds<br>
a Python file that doesn't contain any lit commands.<br>
<br>
lit's googletest format, on the other hand, is not as forgiving. If a<br>
normal, non-executable file matching the test suffix is found, lit<br>
attempts to execute it:<br>
<br>
```<br>
NotATest --gtest_list_tests<br>
```<br>
<br>
This fails, and causes lit to fail the test suite.<br>
<br>
To mirror the lit's lenient behavior with other test formats, instead<br>
of failing the test, have lit simply emit a warning instead. Add a test<br>
that verifies the new behavior.<br>
<br>
<a href="http://reviews.llvm.org/D18647" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18647</a><br>
<br>
Files:<br>
  utils/lit/lit/formats/googletest.py<br>
  utils/lit/tests/Inputs/googletest-format/DummySubDir/NotAGoogleTest<br>
<br>
Index: utils/lit/tests/Inputs/googletest-format/DummySubDir/NotAGoogleTest<br>
===================================================================<br>
--- /dev/null<br>
+++ utils/lit/tests/Inputs/googletest-format/DummySubDir/NotAGoogleTest<br>
@@ -0,0 +1,3 @@<br>
+This file is not an executable, but it happens to have the same test suffix as<br>
+as the googletest executables in this directory. lit should emit a warning in<br>
+this case, but it should not fail the test suite.<br>
Index: utils/lit/lit/formats/googletest.py<br>
===================================================================<br>
--- utils/lit/lit/formats/googletest.py<br>
+++ utils/lit/lit/formats/googletest.py<br>
@@ -35,8 +35,8 @@<br>
               lines = lines.replace('\r', '')<br>
             lines = lines.split('\n')<br>
         except:<br>
-            litConfig.error("unable to discover google-tests in %r" % path)<br>
-            raise StopIteration<br>
+            litConfig.warning("unable to discover google-tests in %r" % path)<br>
+            lines = []<br>
<br>
         nested_tests = []<br>
         for ln in lines:<br>
<br>
<br>
</blockquote></div><br></div>