[cfe-commits] [PATCH] Tests for formatter diagnostics + custom DiagnosticConsumer in API.

Daniel Jasper djasper at google.com
Sat Jan 12 23:14:22 PST 2013



================
Comment at: unittests/Format/FormatTest.cpp:117
@@ +116,3 @@
+  template <typename Iter>
+  void markMessages(DiagnosticsEngine::Level Level, Iter Begin, Iter End,
+                    ExpectedDiagnostics ExpectedDiags,
----------------
This stuff looks very generic. Should we consider putting it together with the DiagnosticsEngine, so it can be used in tests for other packages? I mean in a follow-up commit .. Maybe ask dgregor..

================
Comment at: unittests/Format/FormatTest.cpp:33
@@ -20,2 +32,3 @@
   std::string format(llvm::StringRef Code, unsigned Offset, unsigned Length,
+                     ExpectedDiagnostics ExpectedDiags,
                      const FormatStyle &Style) {
----------------
How about creating the TextDiagnosticsBuffer as member variable of FormatTest and moving checkDiagnostics-call into each test? I think it does not add much boilerplate to each test (as you need to declare the ExpectedDiags-Array anyway) and is a bit less convoluted.


http://llvm-reviews.chandlerc.com/D290

BRANCH
  svn

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list