From 8dd1c0eec1bcdd975fb34df8427abcc869565624 Mon Sep 17 00:00:00 2001 From: Karsten Sperling Date: Wed, 24 Jan 2024 20:11:36 +1300 Subject: [PATCH] Build MatterTests and dft with MTR_NO_AVAILABILITY=1 --- .../Framework/CHIPTests/MTRSwiftDeviceTests.swift | 10 ---------- .../Framework/CHIPTests/MTRSwiftPairingTests.swift | 10 ---------- .../Framework/Matter.xcodeproj/project.pbxproj | 12 ++++++++++++ 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift b/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift index e33a03d920fa3b..061f093ce9ce79 100644 --- a/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift +++ b/src/darwin/Framework/CHIPTests/MTRSwiftDeviceTests.swift @@ -17,11 +17,6 @@ var sController: MTRDeviceController? = nil var sTestKeys: MTRTestKeys? = nil -// Because we are using things from Matter.framework that are flagged -// as only being available starting with macOS 13.3, we need to flag our -// code with the same availabiluty annotation. -@available(macOS, introduced: 13.3) -@available(iOS, introduced: 16.4) class MTRSwiftDeviceTestControllerDelegate : NSObject, MTRDeviceControllerDelegate { let expectation: XCTestExpectation @@ -97,11 +92,6 @@ class MTRSwiftDeviceTestDelegate : NSObject, MTRDeviceDelegate { } -// Because we are using things from Matter.framework that are flagged -// as only being available starting with macOS 14.4, we need to flag our -// code with the same availability annotation. -@available(macOS, introduced: 14.4) -@available(iOS, introduced: 17.4) class MTRSwiftDeviceTests : XCTestCase { static var sStackInitRan : Bool = false static var sNeedsStackShutdown : Bool = true diff --git a/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift b/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift index 5d88db56277631..001a3fe3150d01 100644 --- a/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift +++ b/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift @@ -11,11 +11,6 @@ struct PairingConstants { static let timeoutInSeconds : UInt16 = 3 } -// Because we are using things from Matter.framework that are flagged -// as only being available starting with macOS 13.3, we need to flag our -// code with the same availabiluty annotation. -@available(macOS, introduced: 13.3) -@available(iOS, introduced: 16.4) class MTRSwiftPairingTestControllerDelegate : NSObject, MTRDeviceControllerDelegate { let expectation: XCTestExpectation @@ -47,11 +42,6 @@ class MTRSwiftPairingTestControllerDelegate : NSObject, MTRDeviceControllerDeleg } class MTRSwiftPairingTests : XCTestCase { - // Because we are using things from Matter.framework that are flagged - // as only being available starting with macOS 13.3, we need to flag our - // code with the same availabiluty annotation. - @available(macOS, introduced: 13.3) - @available(iOS, introduced: 16.4) func test001_BasicPairing() { let factory = MTRDeviceControllerFactory.sharedInstance() diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 5445a8ac21f55f..72565dd46f127f 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -1848,11 +1848,13 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", CHIP_HAVE_CONFIG_H, "CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=", CONFIG_BUILD_FOR_HOST_UNIT_TEST, "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", "CONFIG_USE_INTERACTIVE_MODE=1", + "MTR_NO_AVAILABILITY=1", ); "HEADER_SEARCH_PATHS[arch=*]" = ( "$(CHIP_ROOT)/examples/darwin-framework-tool", @@ -1924,11 +1926,13 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", CHIP_HAVE_CONFIG_H, "CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=", CONFIG_BUILD_FOR_HOST_UNIT_TEST, "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", "CONFIG_USE_INTERACTIVE_MODE=1", + "MTR_NO_AVAILABILITY=1", ); "HEADER_SEARCH_PATHS[arch=*]" = ( "$(CHIP_ROOT)/examples//darwin-framework-tool", @@ -2143,6 +2147,10 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "MTR_NO_AVAILABILITY=1", + ); "HEADER_SEARCH_PATHS[arch=*]" = "$(PROJECT_DIR)/../../../src"; INFOPLIST_FILE = CHIPTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -2311,6 +2319,10 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "MTR_NO_AVAILABILITY=1", + ); "HEADER_SEARCH_PATHS[arch=*]" = "$(PROJECT_DIR)/../../../src"; INFOPLIST_FILE = CHIPTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = (