r194494 - Add test for injecting diagnostic consumers into a ClangTool.

jahanian fjahanian at apple.com
Tue Nov 12 11:11:16 PST 2013


Test is failing on Wondows buildbot.
Failing Tests (1):
      Clang-Unit :: Tooling/Release/ToolingTests.exe/ClangToolTest.InjectDiagnosticConsumerInBuildASTs
- Fariborz

On Nov 12, 2013, at 9:53 AM, Manuel Klimek <klimek at google.com> wrote:

> Author: klimek
> Date: Tue Nov 12 11:53:18 2013
> New Revision: 194494
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=194494&view=rev
> Log:
> Add test for injecting diagnostic consumers into a ClangTool.
> 
> As suggested by pcc on 194226.
> 
> Modified:
>    cfe/trunk/unittests/Tooling/ToolingTest.cpp
> 
> Modified: cfe/trunk/unittests/Tooling/ToolingTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/ToolingTest.cpp?rev=194494&r1=194493&r2=194494&view=diff
> ==============================================================================
> --- cfe/trunk/unittests/Tooling/ToolingTest.cpp (original)
> +++ cfe/trunk/unittests/Tooling/ToolingTest.cpp Tue Nov 12 11:53:18 2013
> @@ -321,5 +321,17 @@ TEST(ClangToolTest, InjectDiagnosticCons
>   EXPECT_EQ(1u, Consumer.NumDiagnosticsSeen);
> }
> 
> +TEST(ClangToolTest, InjectDiagnosticConsumerInBuildASTs) {
> +  FixedCompilationDatabase Compilations("/", std::vector<std::string>());
> +  ClangTool Tool(Compilations, std::vector<std::string>(1, "/a.cc"));
> +  Tool.mapVirtualFile("/a.cc", "int x = undeclared;");
> +  TestDiagnosticConsumer Consumer;
> +  Tool.setDiagnosticConsumer(&Consumer);
> +  std::vector<ASTUnit*> ASTs;
> +  Tool.buildASTs(ASTs);
> +  EXPECT_EQ(1u, ASTs.size());
> +  EXPECT_EQ(1u, Consumer.NumDiagnosticsSeen);
> +}
> +
> } // end namespace tooling
> } // end namespace clang
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131112/dca12bb3/attachment.html>


More information about the cfe-commits mailing list