From 6c826efcddba810fdd122e8f78d19a4b4a90e5f0 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Tue, 28 Nov 2017 17:26:28 +0000 Subject: 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 --- test/lit.cfg.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/lit.cfg.py') 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') -- cgit v1.2.3