diff options
author | Davide Italiano <davide@freebsd.org> | 2017-10-23 23:17:53 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2017-10-23 23:17:53 +0000 |
commit | 252d7bdc67ec298f91286c02b2ff694673ce7c12 (patch) | |
tree | 2f3ca0332ff4650f2805bd022afb9cc4f3cc2436 /lldb/packages/Python/lldbsuite/test/dotest.py | |
parent | a50619bf84be63d28d319a323f8dfcee66a9345a (diff) | |
download | bcm5719-llvm-252d7bdc67ec298f91286c02b2ff694673ce7c12.tar.gz bcm5719-llvm-252d7bdc67ec298f91286c02b2ff694673ce7c12.zip |
[lldbtests] Handle errors instead of crashing.
If you pass an invalid compiler/debugger path on the cmdline to `dotest.py` this is what you get.
Traceback (most recent call last):
[...]
File "dotest.py", line 7, in <module>
lldbsuite.test.run_suite()
[...]
And with the patch applied:
/home/davide/work/build-lldb/bin/clandasfasg is not a valid path, exiting
Differential Revision: https://reviews.llvm.org/D39199
llvm-svn: 316393
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/dotest.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 7d739acba95..91f1427136c 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -50,7 +50,11 @@ from ..support import seven def is_exe(fpath): - """Returns true if fpath is an executable.""" + """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) return os.path.isfile(fpath) and os.access(fpath, os.X_OK) |