[clang][Tooling] Sort filenames in test
This commit is contained in:
parent
2da67e8053
commit
eed1f337a1
|
@ -17,6 +17,7 @@
|
|||
#include "llvm/Support/TargetSelect.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include <algorithm>
|
||||
|
||||
namespace clang {
|
||||
namespace tooling {
|
||||
|
@ -62,7 +63,9 @@ static std::vector<std::string> getAllFiles(StringRef JSONDatabase,
|
|||
ADD_FAILURE() << ErrorMessage;
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
return Database->getAllFiles();
|
||||
auto Result = Database->getAllFiles();
|
||||
std::sort(Result.begin(), Result.end());
|
||||
return Result;
|
||||
}
|
||||
|
||||
static std::vector<CompileCommand>
|
||||
|
@ -90,10 +93,10 @@ TEST(JSONCompilationDatabase, GetAllFiles) {
|
|||
expected_files.push_back(std::string(PathStorage.str()));
|
||||
llvm::sys::path::native("//net/dir/file2", PathStorage);
|
||||
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()));
|
||||
llvm::sys::path::native("//net/file1", PathStorage);
|
||||
expected_files.push_back(std::string(PathStorage.str()));
|
||||
EXPECT_EQ(expected_files,
|
||||
getAllFiles(R"json(
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue