[llvm] 5d393ae - [clang-tidy][NFC] Remove the `ObjCModuleTest.cpp` unit test (#185832)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 07:19:48 PDT 2026


Author: Victor Chernyakin
Date: 2026-04-01T07:19:42-07:00
New Revision: 5d393aee10810d18e30027e22ace3a856d72c0a2

URL: https://github.com/llvm/llvm-project/commit/5d393aee10810d18e30027e22ace3a856d72c0a2
DIFF: https://github.com/llvm/llvm-project/commit/5d393aee10810d18e30027e22ace3a856d72c0a2.diff

LOG: [clang-tidy][NFC] Remove the `ObjCModuleTest.cpp` unit test (#185832)

These unit tests only duplicate the tests in
`clang-tools-extra/test/clang-tidy/checkers/objc/forbidden-subclassing.m`.

Added: 
    

Modified: 
    clang-tools-extra/docs/clang-tidy/Contributing.rst
    clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
    llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-tidy/BUILD.gn

Removed: 
    clang-tools-extra/unittests/clang-tidy/ObjCModuleTest.cpp


################################################################################
diff  --git a/clang-tools-extra/docs/clang-tidy/Contributing.rst b/clang-tools-extra/docs/clang-tidy/Contributing.rst
index 79edae5472157..463cfa1bd417c 100644
--- a/clang-tools-extra/docs/clang-tidy/Contributing.rst
+++ b/clang-tools-extra/docs/clang-tidy/Contributing.rst
@@ -120,7 +120,6 @@ The Directory Structure
   |-- ClangTidyTest.h
   |-- GoogleModuleTest.cpp
   |-- LLVMModuleTest.cpp
-  |-- ObjCModuleTest.cpp
       ...
 
 

diff  --git a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
index 167f5d3def06b..26ceb977d27a6 100644
--- a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
@@ -30,7 +30,6 @@ add_extra_unittest(ClangTidyTests
   LLVMModuleTest.cpp
   ModernizeModuleTest.cpp
   NamespaceAliaserTest.cpp
-  ObjCModuleTest.cpp
   OptionsProviderTest.cpp
   OverlappingReplacementsTest.cpp
   UsingInserterTest.cpp

diff  --git a/clang-tools-extra/unittests/clang-tidy/ObjCModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/ObjCModuleTest.cpp
deleted file mode 100644
index 826978b0f3b69..0000000000000
--- a/clang-tools-extra/unittests/clang-tidy/ObjCModuleTest.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//===---- ObjCModuleTest.cpp - clang-tidy ---------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "ClangTidyTest.h"
-#include "gtest/gtest.h"
-#include "objc/ForbiddenSubclassingCheck.h"
-
-using namespace clang::tidy::objc;
-
-namespace clang {
-namespace tidy {
-namespace test {
-
-TEST(ObjCForbiddenSubclassing, AllowedSubclass) {
-  std::vector<ClangTidyError> Errors;
-  runCheckOnCode<ForbiddenSubclassingCheck>(
-      "@interface Foo\n"
-      "@end\n"
-      "@interface Bar : Foo\n"
-      "@end\n",
-      &Errors,
-      "input.m");
-  EXPECT_EQ(0ul, Errors.size());
-}
-
-TEST(ObjCForbiddenSubclassing, ForbiddenSubclass) {
-  std::vector<ClangTidyError> Errors;
-  runCheckOnCode<ForbiddenSubclassingCheck>(
-      "@interface UIImagePickerController\n"
-      "@end\n"
-      "@interface Foo : UIImagePickerController\n"
-      "@end\n",
-      &Errors,
-      "input.m");
-  EXPECT_EQ(1ul, Errors.size());
-  EXPECT_EQ(
-      "Objective-C interface 'Foo' subclasses 'UIImagePickerController', which is not intended to be subclassed",
-      Errors[0].Message.Message);
-}
-
-} // namespace test
-} // namespace tidy
-} // namespace clang

diff  --git a/llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-tidy/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-tidy/BUILD.gn
index e52400e35377c..ca374f865287f 100644
--- a/llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-tidy/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang-tools-extra/unittests/clang-tidy/BUILD.gn
@@ -43,7 +43,6 @@ unittest("ClangTidyTests") {
     "LexerUtilsTest.cpp",
     "ModernizeModuleTest.cpp",
     "NamespaceAliaserTest.cpp",
-    "ObjCModuleTest.cpp",
     "OptionsProviderTest.cpp",
     "OverlappingReplacementsTest.cpp",
     "ReadabilityModuleTest.cpp",


        


More information about the llvm-commits mailing list