<div dir="ltr">I think there's something like lit.util.which(), or a similar function in lldb test utilities.  Seems like we could solve this by writing the function:<div><br></div><div>```</div><div><span style="color:rgb(33,33,33)">def is_exe(fpath):</span><br style="color:rgb(33,33,33)"><span style="color:rgb(33,33,33)">   if not os.path.exists(fpath):</span><br style="color:rgb(33,33,33)"><span style="color:rgb(33,33,33)">       fpath = lit.util.which(fpath)</span></div><div><span style="color:rgb(33,33,33)">       if not (fpath and os.path.exists(fpath)):</span></div><div><span style="color:rgb(33,33,33)">         sys.exit(-1)</span></div><div><span style="color:rgb(33,33,33)">      return is_exe(fpath)</span></div><div><br style="color:rgb(33,33,33)"><span style="color:rgb(33,33,33)">   return os.path.isfile(fpath) and os.access(fpath, os.X_OK)</span>  <br></div><div>```</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 24, 2017 at 9:08 AM Pavel Labath via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: labath<br>
Date: Tue Oct 24 09:07:50 2017<br>
New Revision: 316451<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=316451&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=316451&view=rev</a><br>
Log:<br>
Revert "[lldbtests] Handle errors instead of crashing."<br>
<br>
The commit breaks the case where you specify just a filename to the<br>
compiler. Previously, it would look up the compiler in your path, now it<br>
complains that the compiler is not found. One of the lldb buildbots is<br>
depending on this. It seems like a nice feature to have, as it means<br>
less typing and being able to avoid hard-coding the system compiler path<br>
in the bot config.<br>
<br>
This reverts commit r316393.<br>
<br>
Modified:<br>
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=316451&r1=316450&r2=316451&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=316451&r1=316450&r2=316451&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Tue Oct 24 09:07:50 2017<br>
@@ -50,11 +50,7 @@ from ..support import seven<br>
<br>
<br>
 def is_exe(fpath):<br>
-    """Returns true if fpath is an executable.<br>
-       Exits with an error code if the specified path is invalid"""<br>
-    if not os.path.exists(fpath):<br>
-        print(fpath  + " is not a valid path, exiting")<br>
-        sys.exit(-1)<br>
+    """Returns true if fpath is an executable."""<br>
     return os.path.isfile(fpath) and os.access(fpath, os.X_OK)<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>