From c6846a812b27b0ba343c63839eeb3655c1d679cc Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 19 Nov 2018 19:36:28 +0000 Subject: [PATCH] Fix clang test suite on Windows by reverting part of r347216 Otherwise, the clang analyzer tests fail on Windows when attempting to unpickle AnalyzerTest objects in the worker processes. The pattern of, add to path, import, remove from path, serialize, deserialize, doesn't work. Once something gets added to the path, if we want to move it across the wire for multiprocessing, we need to keep the module on sys.path. llvm-svn: 347254 --- lldb/lit/lit.cfg.py | 1 + llvm/utils/lit/lit/TestingConfig.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lldb/lit/lit.cfg.py b/lldb/lit/lit.cfg.py index 536f2e0..e1db762 100644 --- a/lldb/lit/lit.cfg.py +++ b/lldb/lit/lit.cfg.py @@ -11,6 +11,7 @@ from lit.llvm import llvm_config from lit.llvm.subst import FindTool from lit.llvm.subst import ToolSubst +site.addsitedir(os.path.dirname(__file__)) from helper import toolchain # name: The name of this test suite. diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py index b70f18e..038a468 100644 --- a/llvm/utils/lit/lit/TestingConfig.py +++ b/llvm/utils/lit/lit/TestingConfig.py @@ -85,9 +85,7 @@ class TestingConfig: cfg_globals['config'] = self cfg_globals['lit_config'] = litConfig cfg_globals['__file__'] = path - original_sys_path = list(sys.path) try: - sys.path.insert(0, os.path.dirname(path)) exec(compile(data, path, 'exec'), cfg_globals, None) if litConfig.debug: litConfig.note('... loaded config %r' % path) @@ -102,7 +100,6 @@ class TestingConfig: litConfig.fatal( 'unable to parse config file %r, traceback: %s' % ( path, traceback.format_exc())) - sys.path = original_sys_path self.finish(litConfig) def __init__(self, parent, name, suffixes, test_format, -- 2.7.4