Index: tests_lit/lit.cfg |
diff --git a/tests_lit/lit.cfg b/tests_lit/lit.cfg |
index 1233a76d4fbf7e8d0ebbe2b2af7096320e0c0819..3b7bf5c4d910fff351ef3ea4db177633f4591617 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,23 @@ 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)) |
+config.available_features.update(llvm2iceatts) |
-# 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'] |
+def if_cond_flag(Value): |
+ return '--cond=true' if Value else '--cond=false' |
+ |
+# shell conditional commands. |
+if_atts = [os.path.join(pydir, 'if.py')] |
+if_atts_cmd = if_atts + ['--have=' + att |
+ for att in llvm2iceatts] + ['--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 +134,4 @@ def dbg(s): |
dbg('bin_root = %s' % bin_root) |
dbg('llvmbinpath = %s' % llvmbinpath) |
+dbg("Build attributes = %s" % llvm2iceatts) |