From e98c2733d2eb48b7919ca37744bbf66996efbaa1 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Mon, 13 Apr 2020 17:27:04 -0400 Subject: [PATCH] [libc++] Remove the ability to run using the internal Lit shell The new format requires using an external shell, and as we transition and we can simplify config.py as we transition to the new format. Also, frankly, I'd be quite surprised if that setting was still working anyway because we have several .sh.cpp tests that likely don't work in Lit's internal shell. --- libcxx/utils/libcxx/test/config.py | 18 ------------------ libcxx/utils/libcxx/test/format.py | 7 +++---- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index 3c18a36..b9085a4 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -76,7 +76,6 @@ class Configuration(object): self.use_system_cxx_lib = False self.use_clang_verify = False self.long_tests = None - self.execute_external = False def get_lit_conf(self, name, default=None): val = self.lit_config.params.get(name, None) @@ -133,7 +132,6 @@ class Configuration(object): self.configure_cxx_library_root() self.configure_use_clang_verify() self.configure_use_thread_safety() - self.configure_execute_external() self.configure_ccache() self.configure_compile_flags() self.configure_link_flags() @@ -177,7 +175,6 @@ class Configuration(object): return LibcxxTestFormat( self.cxx, self.use_clang_verify, - self.execute_external, self.executor, exec_env=self.exec_env) @@ -346,21 +343,6 @@ class Configuration(object): self.config.available_features.add('thread-safety') self.lit_config.note("enabling thread-safety annotations") - def configure_execute_external(self): - # 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 the - # default value. Otherwise we ask the target_info. - use_lit_shell_default = os.environ.get('LIT_USE_INTERNAL_SHELL') - if use_lit_shell_default is not None: - use_lit_shell_default = use_lit_shell_default != '0' - else: - use_lit_shell_default = self.target_info.use_lit_shell_default() - # Check for the command line parameter using the default value if it is - # not present. - use_lit_shell = self.get_lit_bool('use_lit_shell', - use_lit_shell_default) - self.execute_external = not use_lit_shell - def configure_ccache(self): use_ccache_default = os.environ.get('LIBCXX_USE_CCACHE') is not None use_ccache = self.get_lit_bool('use_ccache', use_ccache_default) diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py index 0ec68e9..7ad7d0a 100644 --- a/libcxx/utils/libcxx/test/format.py +++ b/libcxx/utils/libcxx/test/format.py @@ -35,11 +35,10 @@ class LibcxxTestFormat(object): FOO.sh.cpp - A test that uses LIT's ShTest format. """ - def __init__(self, cxx, use_verify_for_fail, execute_external, + def __init__(self, cxx, use_verify_for_fail, executor, exec_env): self.cxx = copy.deepcopy(cxx) self.use_verify_for_fail = use_verify_for_fail - self.execute_external = execute_external self.executor = executor self.exec_env = dict(exec_env) @@ -126,7 +125,7 @@ class LibcxxTestFormat(object): tmpDir, tmpBase = lit.TestRunner.getTempPaths(test) substitutions = lit.TestRunner.getDefaultSubstitutions( - test, tmpDir, tmpBase, normalize_slashes=self.execute_external) + test, tmpDir, tmpBase, normalize_slashes=True) # Apply substitutions in FILE_DEPENDENCIES markup data_files = lit.TestRunner.applySubstitutions(test.file_dependencies, substitutions, @@ -172,7 +171,7 @@ class LibcxxTestFormat(object): return lit.Test.UNSUPPORTED, 'ShTest format not yet supported' test.config.environment = self.executor.merge_environments(os.environ, self.exec_env) return lit.TestRunner._runShTest(test, lit_config, - self.execute_external, script, + True, script, tmpBase) elif is_fail_test: return self._evaluate_fail_test(test, test_cxx, parsers) -- 2.7.4