diff --git a/clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp b/clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp --- a/clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp @@ -6,6 +6,7 @@ namespace tidy { namespace test { +namespace { class TestCheck : public ClangTidyCheck { public: TestCheck(StringRef Name, ClangTidyContext *Context) @@ -20,17 +21,8 @@ diag(Var->getTypeSpecStartLoc(), "type specifier"); } }; +} // namespace -// FIXME: This test seems to cause a strange linking interference -// with the ValidConfiguration.ValidEnumOptions test on macOS. -// If both tests are enabled, this test will fail as if -// runCheckOnCode() is not invoked at all. Looks like a linker bug. -// For now both tests are disabled on macOS. It is not sufficient -// to only disable the other test because this test keeps failing -// under Address Sanitizer, which may be an indication of more -// such linking interference with other tests and this test -// seems to be in the center of it. -#ifndef __APPLE__ TEST(ClangTidyDiagnosticConsumer, SortsErrors) { std::vector Errors; runCheckOnCode("int a;", &Errors); @@ -38,7 +30,6 @@ EXPECT_EQ("type specifier", Errors[0].Message.Message); EXPECT_EQ("variable", Errors[1].Message.Message); } -#endif } // namespace test } // namespace tidy diff --git a/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp b/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp --- a/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp @@ -118,6 +118,7 @@ EXPECT_TRUE(*Options.UseColor); } +namespace { class TestCheck : public ClangTidyCheck { public: TestCheck(ClangTidyContext *Context) : ClangTidyCheck("test", Context) {} @@ -140,6 +141,7 @@ return Options.getLocalOrGlobal(std::forward(Arguments)...); } }; +} // namespace #define CHECK_VAL(Value, Expected) \ do { \ @@ -222,9 +224,6 @@ #undef CHECK_ERROR_INT } -// FIXME: Figure out why this test causes crashes on mac os. -// See also comments around the ClangTidyDiagnosticConsumer.SortsErrors test. -#ifndef __APPLE__ TEST(ValidConfiguration, ValidEnumOptions) { ClangTidyOptions Options; @@ -276,7 +275,6 @@ #undef CHECK_ERROR_ENUM } -#endif #undef CHECK_VAL #undef CHECK_ERROR