[PATCH] Made the ClangTidyTest helper class independent of the testing framework.

Manuel Klimek klimek at google.com
Thu Feb 27 05:54:44 PST 2014



================
Comment at: unittests/clang-tidy/ClangTidyTest.h:31
@@ -31,4 +30,3 @@
     Check->setContext(&Context);
-    EXPECT_TRUE(
-        tooling::runToolOnCode(new TestPPAction(*Check, &Context), Code));
+    tooling::runToolOnCode(new TestPPAction(*Check, &Context), Code);
     ast_matchers::MatchFinder Finder;
----------------
Instead of ignoring return values, I'd prefer to explicitly return the empty string.

================
Comment at: unittests/clang-tidy/GoogleModuleTest.cpp:8
@@ -6,3 +7,3 @@
 
-typedef ClangTidyTest<ExplicitConstructorCheck> ExplicitConstructorCheckTest;
+#define EXPECT_NO_CHANGES(test, code) EXPECT_EQ(code, test.runCheckOn(code))
 
----------------
Since this probably already destroys the __FILE__ magic, I'd just make it a function.


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



More information about the cfe-commits mailing list