summaryrefslogtreecommitdiff
path: root/test/lit.cfg.py
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-11-28 17:26:28 +0000
committerAdam Nemet <anemet@apple.com>2017-11-28 17:26:28 +0000
commit6c826efcddba810fdd122e8f78d19a4b4a90e5f0 (patch)
tree533b052deca68e6852db7bbfa669359e7b858b0a /test/lit.cfg.py
parenta4ec08b6fd62577a5c0e9ddd3c131e223c0672b8 (diff)
Add opt-viewer testing
Detects whether we have the Python modules (pygments, yaml) required by opt-viewer and hooks this up to REQUIRES. This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer testing). It's also related to https://github.com/apple/swift/pull/12938 and the idea is to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake. Differential Revision: https://reviews.llvm.org/D40202 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lit.cfg.py')
-rw-r--r--test/lit.cfg.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lit.cfg.py b/test/lit.cfg.py
index e956bb74f5a..06a23536a8c 100644
--- a/test/lit.cfg.py
+++ b/test/lit.cfg.py
@@ -123,6 +123,7 @@ if config.have_ocamlopt:
ocamlopt_command = '%s ocamlopt -cclib -L%s -cclib -Wl,-rpath,%s %s' % (
config.ocamlfind_executable, config.llvm_lib_dir, config.llvm_lib_dir, config.ocaml_flags)
+opt_viewer_cmd = '%s %s/tools/opt-viewer/opt-viewer.py' % (sys.executable, config.llvm_src_root)
tools = [
ToolSubst('%lli', FindTool('lli'), post='.', extra_args=lli_args),
@@ -132,6 +133,7 @@ tools = [
ToolSubst('%ld64', ld64_cmd, unresolved='ignore'),
ToolSubst('%ocamlc', ocamlc_command, unresolved='ignore'),
ToolSubst('%ocamlopt', ocamlopt_command, unresolved='ignore'),
+ ToolSubst('%opt-viewer', opt_viewer_cmd),
]
# FIXME: Why do we have both `lli` and `%lli` that do slightly different things?
@@ -286,3 +288,6 @@ if config.have_libxar:
if config.llvm_libxml2_enabled == '1':
config.available_features.add('libxml2')
+
+if config.have_opt_viewer_modules:
+ config.available_features.add('have_opt_viewer_modules')