r323517 - [Tooling] Test more APIs of ToolExecutor. NFC.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 26 03:10:32 PST 2018


Author: ioeric
Date: Fri Jan 26 03:10:32 2018
New Revision: 323517

URL: http://llvm.org/viewvc/llvm-project?rev=323517&view=rev
Log:
[Tooling] Test more APIs of ToolExecutor. NFC.

Modified:
    cfe/trunk/unittests/Tooling/ExecutionTest.cpp

Modified: cfe/trunk/unittests/Tooling/ExecutionTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/ExecutionTest.cpp?rev=323517&r1=323516&r2=323517&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/ExecutionTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/ExecutionTest.cpp Fri Jan 26 03:10:32 2018
@@ -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, SimpleActionWit
   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 {




More information about the cfe-commits mailing list