summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-02-27 14:28:02 +0000
committerAlexander Kornienko <alexfh@google.com>2014-02-27 14:28:02 +0000
commit098871609f7a15b4992bd3ae5552b9d144ff38a1 (patch)
treefd48e9729d896778eeba61b08140bc1b9e4030ff /clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
parent527aa5052d2816f13368a5c0b1465b7e413a8d0c (diff)
downloadbcm5719-llvm-098871609f7a15b4992bd3ae5552b9d144ff38a1.tar.gz
bcm5719-llvm-098871609f7a15b4992bd3ae5552b9d144ff38a1.zip
Made the ClangTidyTest helper class independent of the testing framework.
Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2895 llvm-svn: 202399
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
index 48433f4fbd8..476ab39fe23 100644
--- a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
@@ -1,30 +1,36 @@
#include "ClangTidyTest.h"
#include "google/GoogleTidyModule.h"
+#include "gtest/gtest.h"
namespace clang {
namespace tidy {
+namespace test {
-typedef ClangTidyTest<ExplicitConstructorCheck> ExplicitConstructorCheckTest;
+#define EXPECT_NO_CHANGES(Check, Code) \
+ EXPECT_EQ(Code, runCheckOnCode<Check>(Code))
-TEST_F(ExplicitConstructorCheckTest, SingleArgumentConstructorsOnly) {
- expectNoChanges("class C { C(); };");
- expectNoChanges("class C { C(int i, int j); };");
+TEST(ExplicitConstructorCheckTest, SingleArgumentConstructorsOnly) {
+ EXPECT_NO_CHANGES(ExplicitConstructorCheck, "class C { C(); };");
+ EXPECT_NO_CHANGES(ExplicitConstructorCheck, "class C { C(int i, int j); };");
}
-TEST_F(ExplicitConstructorCheckTest, Basic) {
+TEST(ExplicitConstructorCheckTest, Basic) {
EXPECT_EQ("class C { explicit C(int i); };",
- runCheckOn("class C { C(int i); };"));
+ runCheckOnCode<ExplicitConstructorCheck>("class C { C(int i); };"));
}
-TEST_F(ExplicitConstructorCheckTest, DefaultParameters) {
+TEST(ExplicitConstructorCheckTest, DefaultParameters) {
EXPECT_EQ("class C { explicit C(int i, int j = 0); };",
- runCheckOn("class C { C(int i, int j = 0); };"));
+ runCheckOnCode<ExplicitConstructorCheck>(
+ "class C { C(int i, int j = 0); };"));
}
-TEST_F(ExplicitConstructorCheckTest, OutOfLineDefinitions) {
+TEST(ExplicitConstructorCheckTest, OutOfLineDefinitions) {
EXPECT_EQ("class C { explicit C(int i); }; C::C(int i) {}",
- runCheckOn("class C { C(int i); }; C::C(int i) {}"));
+ runCheckOnCode<ExplicitConstructorCheck>(
+ "class C { C(int i); }; C::C(int i) {}"));
}
+} // namespace test
} // namespace tidy
} // namespace clang
OpenPOWER on IntegriCloud