[PATCH] D84453: [clang-tidy] Suppress one unittest on macOS.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 27 22:38:13 PDT 2020


NoQ updated this revision to Diff 281112.
NoQ retitled this revision from "[clang-tidy] Suppress one unittest under ASan." to "[clang-tidy] Suppress one unittest on macOS.".
NoQ added a comment.

Update comments with the updated investigation details.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84453/new/

https://reviews.llvm.org/D84453

Files:
  clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
  clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp


Index: clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
===================================================================
--- clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
+++ clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
@@ -223,6 +223,7 @@
 }
 
 // FIXME: Figure out why this test causes crashes on mac os.
+// See also comments around the ClangTidyDiagnosticConsumer.SortsErrors test.
 #ifndef __APPLE__
 TEST(ValidConfiguration, ValidEnumOptions) {
 
Index: clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
===================================================================
--- clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
+++ clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
@@ -21,6 +21,16 @@
   }
 };
 
+// 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<ClangTidyError> Errors;
   runCheckOnCode<TestCheck>("int a;", &Errors);
@@ -28,6 +38,7 @@
   EXPECT_EQ("type specifier", Errors[0].Message.Message);
   EXPECT_EQ("variable", Errors[1].Message.Message);
 }
+#endif
 
 } // namespace test
 } // namespace tidy


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84453.281112.patch
Type: text/x-patch
Size: 1741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200728/1d090f2e/attachment-0001.bin>


More information about the cfe-commits mailing list