[Lldb-commits] [lldb] r316451 - Revert "[lldbtests] Handle errors instead of crashing."
Zachary Turner via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 24 09:12:32 PDT 2017
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:
```
def is_exe(fpath):
if not os.path.exists(fpath):
fpath = lit.util.which(fpath)
if not (fpath and os.path.exists(fpath)):
sys.exit(-1)
return is_exe(fpath)
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
```
On Tue, Oct 24, 2017 at 9:08 AM Pavel Labath via lldb-commits <
lldb-commits at lists.llvm.org> wrote:
> Author: labath
> Date: Tue Oct 24 09:07:50 2017
> New Revision: 316451
>
> URL: http://llvm.org/viewvc/llvm-project?rev=316451&view=rev
> Log:
> Revert "[lldbtests] Handle errors instead of crashing."
>
> The commit breaks the case where you specify just a filename to the
> compiler. Previously, it would look up the compiler in your path, now it
> complains that the compiler is not found. One of the lldb buildbots is
> depending on this. It seems like a nice feature to have, as it means
> less typing and being able to avoid hard-coding the system compiler path
> in the bot config.
>
> This reverts commit r316393.
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=316451&r1=316450&r2=316451&view=diff
>
> ==============================================================================
> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Tue Oct 24
> 09:07:50 2017
> @@ -50,11 +50,7 @@ from ..support import seven
>
>
> def is_exe(fpath):
> - """Returns true if fpath is an executable.
> - Exits with an error code if the specified path is invalid"""
> - if not os.path.exists(fpath):
> - print(fpath + " is not a valid path, exiting")
> - sys.exit(-1)
> + """Returns true if fpath is an executable."""
> return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
>
>
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171024/eb80fc10/attachment.html>
More information about the lldb-commits
mailing list