};
auto BarPath = testPath("foo/bar.h", llvm::sys::path::Style::posix);
+ BarPath = llvm::sys::path::convert_to_slash(BarPath);
Parm.Path = BarPath;
// Non-absolute MountPoint without a directory raises an error.
Frag = GetFrag("", "foo");
ASSERT_FALSE(Conf.Index.External);
auto FooPath = testPath("foo/", llvm::sys::path::Style::posix);
+ FooPath = llvm::sys::path::convert_to_slash(FooPath);
// Ok when relative.
Frag = GetFrag(testRoot(), "foo/");
compileAndApply();
// File outside MountPoint, no index.
auto BazPath = testPath("bar/baz.h", llvm::sys::path::Style::posix);
+ BazPath = llvm::sys::path::convert_to_slash(BazPath);
Parm.Path = BazPath;
Frag = GetFrag("", FooPath.c_str());
compileAndApply();
// File under MountPoint, index should be set.
BazPath = testPath("foo/baz.h", llvm::sys::path::Style::posix);
+ BazPath = llvm::sys::path::convert_to_slash(BazPath);
Parm.Path = BazPath;
Frag = GetFrag("", FooPath.c_str());
compileAndApply();
}
std::string testPath(PathRef File, llvm::sys::path::Style Style) {
- assert(llvm::sys::path::is_relative(File, Style));
+ assert(llvm::sys::path::is_relative(File) && "FileName should be relative");
+
+ llvm::SmallString<32> NativeFile = File;
+ llvm::sys::path::native(NativeFile, Style);
llvm::SmallString<32> Path;
- llvm::sys::path::append(Path, testRoot(), File);
- llvm::sys::path::native(Path, Style);
+ llvm::sys::path::append(Path, Style, testRoot(), NativeFile);
return std::string(Path.str());
}