Skip to content

Commit

Permalink
Catch the Python exception when subprocess.Popen is failing.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sylvestre committed Apr 13, 2012
1 parent 8fc7d5c commit e92077f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit e92077f

Please sign in to comment.