Chromium Code Reviews| Index: tests_lit/lit.cfg |
| diff --git a/tests_lit/lit.cfg b/tests_lit/lit.cfg |
| index 1233a76d4fbf7e8d0ebbe2b2af7096320e0c0819..4dbe9791042d049f64198778e2b072cd39f3bd17 100644 |
| --- a/tests_lit/lit.cfg |
| +++ b/tests_lit/lit.cfg |
| @@ -39,7 +39,7 @@ import sys |
| import lit.formats |
| sys.path.insert(0, 'pydir') |
| -from utils import FindBaseNaCl |
| +from utils import FindBaseNaCl, shellcmd |
| from ifatts import GetFileAttributes |
| # name: The name of this test suite. |
| @@ -69,18 +69,26 @@ llvmbinpath = os.path.abspath(os.environ.get('LLVM_BIN_PATH')) |
| # Define the location of the llvm2ice tool. |
| llvm2icetool = os.path.join(bin_root, 'llvm2ice') |
| -llvm2icetoolatts = os.path.join(bin_root, 'llvm2ice.build_atts') |
| +llvm2iceatts = shellcmd(' '.join([llvm2icetool, '--build-atts']), |
| + echo=False).split() |
| # Add build attributes of llvm2ice tool to the set of available features. |
| -config.available_features.update(GetFileAttributes(llvm2icetoolatts)) |
| - |
| -# Base command for testing build attributes |
| -if_atts_base = [os.path.join(pydir, 'ifatts.py'), llvm2icetoolatts] |
| -if_atts_cmd = if_atts_base + ['--command'] |
| -ifl2i_atts_cmd = if_atts_base + ['--att=allow_llvm_ir', '--command'] |
| -iflc2i_atts_cmd = if_atts_base + ['--att=allow_llvm_ir', |
| - '--att=allow_llvm_ir_as_input', |
| - '--command'] |
| +config.available_features.update(llvm2iceatts) |
| + |
| +def if_cond_flag(Value): |
| + if Value: |
|
Jim Stichnoth
2014/10/29 21:29:37
return '--cond=true' if Value else '--cond=false'
Karl
2014/10/29 21:55:27
Done.
|
| + return '--cond=true' |
| + else: |
| + return '--cond=false' |
| + |
| +# shell conditional commands. |
| +if_atts = [os.path.join(pydir, 'if.py')] |
| +if_atts_cmd = (if_atts + ['--have=' + att for att in llvm2iceatts] + |
|
Jim Stichnoth
2014/10/29 21:29:37
remove parens
Karl
2014/10/29 21:55:27
The parens were added because the instruction cros
|
| + ['--command']) |
| +ifl2i_atts_cmd = if_atts + [if_cond_flag('allow_llvm_ir' in llvm2iceatts), |
| + '--command'] |
| +iflc2i_atts_cmd = if_atts + [if_cond_flag('allow_llvm_ir_as_input' |
| + in llvm2iceatts), '--command'] |
| # Base command for running llvm2ice |
| llvm2ice_cmd = [os.path.join(pydir, 'run-llvm2ice.py'), |
| @@ -129,3 +137,4 @@ def dbg(s): |
| dbg('bin_root = %s' % bin_root) |
| dbg('llvmbinpath = %s' % llvmbinpath) |
| +dbg("Build attributes = %s" % llvm2iceatts) |