From 4a3080bea3ec788d1a0a70df561a8cbd98b83188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Wed, 4 Mar 2026 03:24:39 -0800 Subject: [PATCH] Add test for parsing interfaces with deprecated attributes (#55771) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55771 Adding tests for parsing interfaces with deprecated attributes and extending the doxygen test config with `__attribute__` predefined macro. ## Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D94343118 fbshipit-source-id: 2fb2f8307f324533033ea1df2f266a785dc81de7 --- .../tests/snapshots/.doxygen.config.template | 2 +- .../snapshot.api | 4 ++++ .../should_handle_method_with_attribute/test.h | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/snapshot.api create mode 100644 scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/test.h diff --git a/scripts/cxx-api/tests/snapshots/.doxygen.config.template b/scripts/cxx-api/tests/snapshots/.doxygen.config.template index 9a4e9b94f37..a01a146395a 100644 --- a/scripts/cxx-api/tests/snapshots/.doxygen.config.template +++ b/scripts/cxx-api/tests/snapshots/.doxygen.config.template @@ -2442,7 +2442,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = FOLLY_PACK_PUSH="" FOLLY_PACK_POP="" FOLLY_PACK_ATTR="" __attribute__(x)="" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/snapshot.api b/scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/snapshot.api new file mode 100644 index 00000000000..bf63be61569 --- /dev/null +++ b/scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/snapshot.api @@ -0,0 +1,4 @@ +interface RCTTestInterface { + public virtual NSArray * interfaceDeprecatedMethod:(id param); + public virtual void normalMethod:(NSString * name); +} diff --git a/scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/test.h b/scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/test.h new file mode 100644 index 00000000000..4e8157aa7ef --- /dev/null +++ b/scripts/cxx-api/tests/snapshots/should_handle_method_with_attribute/test.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +@interface RCTTestInterface + +- (void)normalMethod:(NSString *)name; + +- (NSArray *)interfaceDeprecatedMethod:(id)param __attribute__((deprecated("This method is deprecated."))); + +@end