summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-01-26 11:10:32 +0000
committerEric Liu <ioeric@google.com>2018-01-26 11:10:32 +0000
commit2a27ebe6702786c859010acd007272067f421553 (patch)
tree7b16f70d789743c19fe0776b64effeb819c0d883
parent6e1dc6811773c76b337fd2ff924b407eb42605bc (diff)
downloadbcm5719-llvm-2a27ebe6702786c859010acd007272067f421553.tar.gz
bcm5719-llvm-2a27ebe6702786c859010acd007272067f421553.zip
[Tooling] Test more APIs of ToolExecutor. NFC.
llvm-svn: 323517
-rw-r--r--clang/unittests/Tooling/ExecutionTest.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/unittests/Tooling/ExecutionTest.cpp b/clang/unittests/Tooling/ExecutionTest.cpp
index 68c4bf25c91..26db8c6d0ea 100644
--- a/clang/unittests/Tooling/ExecutionTest.cpp
+++ b/clang/unittests/Tooling/ExecutionTest.cpp
@@ -46,7 +46,10 @@ public:
}
bool TraverseFunctionDecl(clang::FunctionDecl *Decl) {
- Context->reportResult(Decl->getNameAsString(), "1");
+ Context->reportResult(Decl->getNameAsString(),
+ Context->getRevision() + ":" + Context->getCorpus() +
+ ":" + Context->getCurrentCompilationUnit() +
+ "/1");
return ASTVisitor::TraverseFunctionDecl(Decl);
}
@@ -213,10 +216,12 @@ TEST(StandaloneToolTest, SimpleActionWithResult) {
auto KVs = Executor.getToolResults()->AllKVResults();
ASSERT_EQ(KVs.size(), 1u);
EXPECT_EQ("f", KVs[0].first);
- EXPECT_EQ("1", KVs[0].second);
+ // Currently the standlone executor returns empty corpus, revision, and
+ // compilation unit.
+ EXPECT_EQ("::/1", KVs[0].second);
Executor.getToolResults()->forEachResult(
- [](StringRef, StringRef Value) { EXPECT_EQ("1", Value); });
+ [](StringRef, StringRef Value) { EXPECT_EQ("::/1", Value); });
}
class FixedCompilationDatabaseWithFiles : public CompilationDatabase {
OpenPOWER on IntegriCloud