aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2012-04-13 11:22:18 +0000
committerSylvestre Ledru <sylvestre@debian.org>2012-04-13 11:22:18 +0000
commite92077f11e2ca85d98fe41cf3aba2cb813e57c9a (patch)
tree8928c384a48870a78501aef8342c2190a31a9220
parent8fc7d5c35cc79f941d2eb8e992133f94f375670a (diff)
Catch the Python exception when subprocess.Popen is failing.
For example, if llc cannot be found, the full python stacktrace is displayed and no interesting information are provided. + fail the process when an exception occurs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154665 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/lit.cfg7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index c58935956a..d74bc7bcb5 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -236,8 +236,13 @@ if loadable_module:
# llc knows whether he is compiled with -DNDEBUG.
import subprocess
-llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
+try:
+ llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
stdout = subprocess.PIPE)
+except OSError, why:
+ print "Could not find llc in " + llvm_tools_dir
+ exit(42)
+
if re.search(r'with assertions', llc_cmd.stdout.read()):
config.available_features.add('asserts')
llc_cmd.wait()