[clang-tools-extra] [llvm] [clang-tidy][NFC] Remove the `ObjCModuleTest.cpp` unit test (PR #185832)
Victor Chernyakin via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 01:22:55 PDT 2026
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/185832
These unit tests only duplicate the tests in `clang-tools-extra/test/clang-tidy/checkers/objc/forbidden-subclassing.m`.
>From 8ddb238e92e30b077557e8bc95a2c168720af9b3 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin <chernyakin.victor.j at outlook.com>
Date: Wed, 11 Mar 2026 01:20:11 -0700
Subject: [PATCH] [clang-tidy][NFC] Remove the `ObjCModuleTest.cpp` unit test
---
.../docs/clang-tidy/Contributing.rst | 1 -
.../unittests/clang-tidy/CMakeLists.txt | 1 -
.../unittests/clang-tidy/ObjCModuleTest.cpp | 48 -------------------
.../unittests/clang-tidy/BUILD.gn | 1 -
4 files changed, 51 deletions(-)
delete mode 100644 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 72444480ece0e..a1c93f44cfd9b 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