[windows] Use the temporal directory for root of VFS tests.

The VFS tests were using Unix absolute paths, which does not play well
when Windows see them as relative to the current drive letter.

By using the temporal directory, both Windows and Unix can use the same
paths and avoid the problem.

Additionally, a couple of inputs have to be transformed into the native
path format, because sourcekitd-test compares the inputs as strings, and
they need to match exactly. So the source file and the name of the VFS
entries are transformed into native using the helper from LLVM support.
This commit is contained in:
Daniel Rodríguez Troitiño
2019-11-13 17:45:38 -08:00
parent db9c2ed3a4
commit a1a891e47a
13 changed files with 62 additions and 55 deletions

View File

@@ -439,6 +439,7 @@ static FrontendInputsAndOutputs resolveSymbolicLinksInInputs(
llvm::SmallString<128> newFilename;
if (auto err = FileSystem->getRealPath(input.file(), newFilename))
newFilename = input.file();
llvm::sys::path::native(newFilename);
bool newIsPrimary = input.isPrimary() ||
(!PrimaryFile.empty() && PrimaryFile == newFilename);
if (newIsPrimary) {