[llvm] r302409 - [Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.

Andrew Ng via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 01:55:39 PDT 2017


Author: anng
Date: Mon May  8 03:55:38 2017
New Revision: 302409

URL: http://llvm.org/viewvc/llvm-project?rev=302409&view=rev
Log:
[Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.

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

Modified:
    llvm/trunk/test/Unit/lit.cfg

Modified: llvm/trunk/test/Unit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Unit/lit.cfg?rev=302409&r1=302408&r2=302409&view=diff
==============================================================================
--- llvm/trunk/test/Unit/lit.cfg (original)
+++ llvm/trunk/test/Unit/lit.cfg Mon May  8 03:55:38 2017
@@ -43,6 +43,10 @@ if sys.platform in ['win32', 'cygwin'] a
     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.




More information about the llvm-commits mailing list