fdeazeve updated this revision to Diff 459348. fdeazeve edited the summary of this revision. fdeazeve added a comment.
Reworded commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133639/new/ https://reviews.llvm.org/D133639 Files: lldb/test/API/lit.cfg.py Index: lldb/test/API/lit.cfg.py =================================================================== --- lldb/test/API/lit.cfg.py +++ lldb/test/API/lit.cfg.py @@ -91,6 +91,13 @@ This allows us to check if the attribute exists before trying to access it.""" return getattr(config, attr, None) +def is_configured_and_true(attr): + """Returns true if and only if the configuration attribute exists and it is + set to'1'. + + This is useful when checking CMake variables that have been cannonicalized to + 0/1.""" + return getattr(config, attr, None) == '1' def delete_module_cache(path): """Clean the module caches in the test build directory. @@ -171,7 +178,7 @@ dotest_cmd += ['--env', 'LLVM_TOOLS_DIR=' + config.llvm_tools_dir] # If we have a just-built libcxx, prefer it over the system one. -if is_configured('has_libcxx') and platform.system() != 'Windows': +if is_configured_and_true('has_libcxx') and platform.system() != 'Windows': if is_configured('llvm_include_dir') and is_configured('llvm_libs_dir'): dotest_cmd += ['--libcxx-include-dir', os.path.join(config.llvm_include_dir, 'c++', 'v1')] dotest_cmd += ['--libcxx-library-dir', config.llvm_libs_dir]
Index: lldb/test/API/lit.cfg.py =================================================================== --- lldb/test/API/lit.cfg.py +++ lldb/test/API/lit.cfg.py @@ -91,6 +91,13 @@ This allows us to check if the attribute exists before trying to access it.""" return getattr(config, attr, None) +def is_configured_and_true(attr): + """Returns true if and only if the configuration attribute exists and it is + set to'1'. + + This is useful when checking CMake variables that have been cannonicalized to + 0/1.""" + return getattr(config, attr, None) == '1' def delete_module_cache(path): """Clean the module caches in the test build directory. @@ -171,7 +178,7 @@ dotest_cmd += ['--env', 'LLVM_TOOLS_DIR=' + config.llvm_tools_dir] # If we have a just-built libcxx, prefer it over the system one. -if is_configured('has_libcxx') and platform.system() != 'Windows': +if is_configured_and_true('has_libcxx') and platform.system() != 'Windows': if is_configured('llvm_include_dir') and is_configured('llvm_libs_dir'): dotest_cmd += ['--libcxx-include-dir', os.path.join(config.llvm_include_dir, 'c++', 'v1')] dotest_cmd += ['--libcxx-library-dir', config.llvm_libs_dir]
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits