Skip to content

Commit

Permalink
[lit] Do not run Python tests w/ LLDB_DISABLE_PYTHON
Browse files Browse the repository at this point in the history
Skip all Python-based tests as unsupported when LLDB_DISABLE_PYTHON is
enabled.  Otherwise, those tests simply fail being unable to import lldb
module.

Differential Revision: https://reviews.llvm.org/D47812

llvm-svn: 334080
  • Loading branch information
mgorny committed Jun 6, 2018
1 parent 62b34fa commit 6dde836
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lldb/lit/CMakeLists.txt
Expand Up @@ -46,6 +46,7 @@ endif(BUILD_SHARED_LIBS)

# the value is not canonicalized within LLVM
llvm_canonicalize_cmake_booleans(
LLDB_DISABLE_PYTHON
LLVM_ENABLE_ZLIB)

configure_lit_site_cfg(
Expand Down
1 change: 1 addition & 0 deletions lldb/lit/Suite/lit.site.cfg.in
Expand Up @@ -13,6 +13,7 @@ config.target_triple = "@TARGET_TRIPLE@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py"
config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
config.lldb_disable_python = @LLDB_DISABLE_PYTHON@


# Additional dotest arguments can be passed to lit by providing a
Expand Down
3 changes: 3 additions & 0 deletions lldb/lit/Suite/lldbtest.py
Expand Up @@ -37,6 +37,9 @@ def execute(self, test, litConfig):
if litConfig.noExecute:
return lit.Test.PASS, ''

if test.config.lldb_disable_python:
return (lit.Test.UNSUPPORTED, 'Python module disabled')

if test.config.unsupported:
return (lit.Test.UNSUPPORTED, 'Test is unsupported')

Expand Down

0 comments on commit 6dde836

Please sign in to comment.