[clang-tools-extra] 69924cc - Remove redundant lit config already handled in llvm_config. NFCI
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 10 14:11:33 PST 2022
Author: Sam McCall
Date: 2022-03-10T23:11:01+01:00
New Revision: 69924ccf7a328f5f9bcc7073f38fa608a0dbfe2c
URL: https://github.com/llvm/llvm-project/commit/69924ccf7a328f5f9bcc7073f38fa608a0dbfe2c
DIFF: https://github.com/llvm/llvm-project/commit/69924ccf7a328f5f9bcc7073f38fa608a0dbfe2c.diff
LOG: Remove redundant lit config already handled in llvm_config. NFCI
This logic duplicates lit.llvm.initialize, which we're already calling
(in lit.site.cfg.py.in).
The equivalent logic was removed from clang in d4401d354a938dd366bf but
never cleaned up here.
Added:
Modified:
clang-tools-extra/test/lit.cfg.py
Removed:
################################################################################
diff --git a/clang-tools-extra/test/lit.cfg.py b/clang-tools-extra/test/lit.cfg.py
index 858e42ace2a82..5c3934fb0b162 100644
--- a/clang-tools-extra/test/lit.cfg.py
+++ b/clang-tools-extra/test/lit.cfg.py
@@ -8,39 +8,18 @@
import lit.formats
import lit.util
+from lit.llvm import llvm_config
+
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
config.name = 'Clang Tools'
-# Tweak PATH for Win32
-if platform.system() == 'Windows':
- # Seek sane tools in directories and set to $PATH.
- path = getattr(config, 'lit_tools_dir', None)
- path = lit_config.getToolsPath(path,
- config.environment['PATH'],
- ['cmp.exe', 'grep.exe', 'sed.exe'])
- if path is not None:
- path = os.path.pathsep.join((path,
- config.environment['PATH']))
- config.environment['PATH'] = path
-
-# Choose between lit's internal shell pipeline runner and a real shell. If
-# LIT_USE_INTERNAL_SHELL is in the environment, we use that as an override.
-use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
-if use_lit_shell:
- # 0 is external, "" is default, and everything else is internal.
- execute_external = (use_lit_shell == "0")
-else:
- # Otherwise we default to internal on Windows and external elsewhere, as
- # bash on Windows is usually very slow.
- execute_external = (not sys.platform in ['win32'])
-
# testFormat: The test format to use to interpret tests.
#
# For now we require '&&' between commands, until they get globally killed and
# the test runner updated.
-config.test_format = lit.formats.ShTest(execute_external)
+config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c', '.cpp', '.hpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s',
@@ -103,10 +82,6 @@
# Set available features we allow tests to conditionalize on.
#
-# Shell execution
-if execute_external:
- config.available_features.add('shell')
-
# Exclude MSYS due to transforming '/' to 'X:/mingwroot/'.
if not platform.system() in ['Windows'] or not execute_external:
config.available_features.add('shell-preserves-root')
More information about the cfe-commits
mailing list