This patch propogates the environment variable SYSTEMDRIVE on Windows when
running the unit tests. This prevents the creation of a directory named
"%SystemDrive%" when running the unit tests from FileSystemTest that use the
function llvm::sys::fs::remove_directories which in turn uses SHFileOperationW.
It is within SHFileOperationW that this environment variable may be used and if
undefined causes the creation of a "%SystemDrive%" directory in the current
directory.
Differential Revision: https://reviews.llvm.org/D32910
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302409
91177308-0d34-0410-b5e6-
96231b3b80d8
config.environment['PATH'] = os.path.pathsep.join((
config.shlibdir, config.environment['PATH']))
+# Win32 may use %SYSTEMDRIVE% during file system shell operations, so propogate.
+if sys.platform == 'win32' and 'SYSTEMDRIVE' in os.environ:
+ config.environment['SYSTEMDRIVE'] = os.environ['SYSTEMDRIVE']
+
###
# Check that the object root is known.