mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -189,10 +189,10 @@ private:
|
||||
} // anonymous namespace
|
||||
|
||||
TEST_F(CursorInfoTest, FileNotExist) {
|
||||
const char *DocName = "/test.swift";
|
||||
const char *DocName = "test.swift";
|
||||
const char *Contents =
|
||||
"let foo = 0\n";
|
||||
const char *Args[] = { "/<not-existent-file>" };
|
||||
const char *Args[] = { "<not-existent-file>" };
|
||||
|
||||
open(DocName, Contents);
|
||||
auto FooOffs = findOffset("foo =", Contents);
|
||||
@@ -205,7 +205,7 @@ static const char *ExpensiveInit =
|
||||
"[0:0,0:0,0:0,0:0,0:0,0:0,0:0]";
|
||||
|
||||
TEST_F(CursorInfoTest, EditAfter) {
|
||||
const char *DocName = "/test.swift";
|
||||
const char *DocName = "test.swift";
|
||||
const char *Contents =
|
||||
"let value = foo\n"
|
||||
"let foo = 0\n";
|
||||
@@ -240,7 +240,7 @@ TEST_F(CursorInfoTest, EditAfter) {
|
||||
}
|
||||
|
||||
TEST_F(CursorInfoTest, EditBefore) {
|
||||
const char *DocName = "/test.swift";
|
||||
const char *DocName = "test.swift";
|
||||
const char *Contents =
|
||||
"let foo = 0\n"
|
||||
"let value = foo;\n";
|
||||
@@ -277,7 +277,7 @@ TEST_F(CursorInfoTest, EditBefore) {
|
||||
}
|
||||
|
||||
TEST_F(CursorInfoTest, CursorInfoMustWaitDueDeclLoc) {
|
||||
const char *DocName = "/test.swift";
|
||||
const char *DocName = "test.swift";
|
||||
const char *Contents =
|
||||
"let value = foo\n"
|
||||
"let foo = 0\n";
|
||||
@@ -307,7 +307,7 @@ TEST_F(CursorInfoTest, CursorInfoMustWaitDueDeclLoc) {
|
||||
}
|
||||
|
||||
TEST_F(CursorInfoTest, CursorInfoMustWaitDueOffset) {
|
||||
const char *DocName = "/test.swift";
|
||||
const char *DocName = "test.swift";
|
||||
const char *Contents =
|
||||
"let value = foo\n"
|
||||
"let foo = 0\n";
|
||||
@@ -337,7 +337,7 @@ TEST_F(CursorInfoTest, CursorInfoMustWaitDueOffset) {
|
||||
}
|
||||
|
||||
TEST_F(CursorInfoTest, CursorInfoMustWaitDueToken) {
|
||||
const char *DocName = "/test.swift";
|
||||
const char *DocName = "test.swift";
|
||||
const char *Contents =
|
||||
"let value = foo\n"
|
||||
"let foo = 0\n";
|
||||
@@ -368,7 +368,7 @@ TEST_F(CursorInfoTest, CursorInfoMustWaitDueToken) {
|
||||
}
|
||||
|
||||
TEST_F(CursorInfoTest, CursorInfoMustWaitDueTokenRace) {
|
||||
const char *DocName = "/test.swift";
|
||||
const char *DocName = "test.swift";
|
||||
const char *Contents = "let value = foo\n"
|
||||
"let foo = 0\n";
|
||||
const char *Args[] = {"-parse-as-library"};
|
||||
|
||||
Reference in New Issue
Block a user