aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/CompilationDatabaseTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Tooling/CompilationDatabaseTest.cpp')
-rw-r--r--clang/unittests/Tooling/CompilationDatabaseTest.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/clang/unittests/Tooling/CompilationDatabaseTest.cpp b/clang/unittests/Tooling/CompilationDatabaseTest.cpp
index 3314ecd..89763f9 100644
--- a/clang/unittests/Tooling/CompilationDatabaseTest.cpp
+++ b/clang/unittests/Tooling/CompilationDatabaseTest.cpp
@@ -92,16 +92,32 @@ TEST(JSONCompilationDatabase, GetAllFiles) {
expected_files.push_back(std::string(PathStorage.str()));
llvm::sys::path::native("//net/file1", PathStorage);
expected_files.push_back(std::string(PathStorage.str()));
+ llvm::sys::path::native("//net/dir/file3", PathStorage);
+ expected_files.push_back(std::string(PathStorage.str()));
EXPECT_EQ(expected_files,
- getAllFiles("[{\"directory\":\"//net/dir\","
- "\"command\":\"command\","
- "\"file\":\"file1\"},"
- " {\"directory\":\"//net/dir\","
- "\"command\":\"command\","
- "\"file\":\"../file1\"},"
- " {\"directory\":\"//net/dir\","
- "\"command\":\"command\","
- "\"file\":\"file2\"}]",
+ getAllFiles(R"json(
+ [
+ {
+ "directory": "//net/dir",
+ "command": "command",
+ "file": "file1"
+ },
+ {
+ "directory": "//net/dir",
+ "command": "command",
+ "file": "../file1"
+ },
+ {
+ "directory": "//net/dir",
+ "command": "command",
+ "file": "file2"
+ },
+ {
+ "directory": "//net/dir",
+ "command": "command",
+ "file": "//net/dir/foo/../file3"
+ }
+ ])json",
ErrorMessage, JSONCommandLineSyntax::Gnu))
<< ErrorMessage;
}