diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-01-09 16:33:16 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-01-09 16:33:16 +0000 |
commit | e9e76079745dc2eb9de11badacaa9665a2c39511 (patch) | |
tree | 857919aeb16f0c71e2ad4d94ae7c938839c4cfe8 /clang/unittests/Basic/VirtualFileSystemTest.cpp | |
parent | 88c163460cbe0cad01eef47cceb4f607261b9e66 (diff) | |
download | llvm-e9e76079745dc2eb9de11badacaa9665a2c39511.zip llvm-e9e76079745dc2eb9de11badacaa9665a2c39511.tar.gz llvm-e9e76079745dc2eb9de11badacaa9665a2c39511.tar.bz2 |
[vfs] Normalize working directory if requested.
FixedCompilationDatabase sets the working dir to "." by default. For
chdir(".") this is a noop but this lead to InMemoryFileSystem to create
bogus paths. Fixes PR25327.
llvm-svn: 257260
Diffstat (limited to 'clang/unittests/Basic/VirtualFileSystemTest.cpp')
-rw-r--r-- | clang/unittests/Basic/VirtualFileSystemTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Basic/VirtualFileSystemTest.cpp b/clang/unittests/Basic/VirtualFileSystemTest.cpp index ac07035..b72b757 100644 --- a/clang/unittests/Basic/VirtualFileSystemTest.cpp +++ b/clang/unittests/Basic/VirtualFileSystemTest.cpp @@ -657,6 +657,12 @@ TEST_F(InMemoryFileSystemTest, WorkingDirectory) { Stat = FS.status("c"); ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString(); + + NormalizedFS.setCurrentWorkingDirectory("/b/c"); + NormalizedFS.setCurrentWorkingDirectory("."); + ASSERT_EQ("/b/c", NormalizedFS.getCurrentWorkingDirectory().get()); + NormalizedFS.setCurrentWorkingDirectory(".."); + ASSERT_EQ("/b", NormalizedFS.getCurrentWorkingDirectory().get()); } // NOTE: in the tests below, we use '//root/' as our root directory, since it is |