diff options
author | Andrew Ng <anng.sw@gmail.com> | 2017-05-08 08:55:38 +0000 |
---|---|---|
committer | Andrew Ng <anng.sw@gmail.com> | 2017-05-08 08:55:38 +0000 |
commit | 8d4aa1d832373da32c4b0f91624d8f66e6c5e5b8 (patch) | |
tree | 469e126a06d10ffd47f772429dd0fd1d4ce588ab /test/Unit/lit.cfg | |
parent | c571744eac2b64565cf6acb829ab649656b7af89 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Unit/lit.cfg')
-rw-r--r-- | test/Unit/lit.cfg | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg index 30a5d3fab82..dac0bf829ba 100644 --- a/test/Unit/lit.cfg +++ b/test/Unit/lit.cfg @@ -43,6 +43,10 @@ if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir): 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. |