[Support] Tweak path::system_temp_directory() on Windows.
authorPawel Bylica <chfast@gmail.com>
Tue, 17 Nov 2015 16:54:32 +0000 (16:54 +0000)
committerPawel Bylica <chfast@gmail.com>
Tue, 17 Nov 2015 16:54:32 +0000 (16:54 +0000)
commit790e8d91fffa01c1ae5a72d31615f20d78f20404
treed3e0db596d4919065e3b05614e729d494e891ebd
parent03629a3cf4bad6d4eb4ddbd67d918c9556053316
[Support] Tweak path::system_temp_directory() on Windows.

Summary:
This patch changes the behavior of path::system_temp_directory() on Windows to be closer to GetTempPath Windows API call. Enforces path separator to be the native one, makes path absolute, etc. GetTempPath is not used directly because of limitations/implementation bugs on Windows 7.

Windows specific unit tests are added. Most of them runs in separated process with modified environment variables.

This change fixes FileSystemTest.CreateDir unittest that had been failing when run from Unix-like shell on Windows (Unix-like path separator (/) used in env variables).

Reviewers: chapuni, rafael, aaron.ballman

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D14231

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253345 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Windows/Path.inc
unittests/Support/Path.cpp