Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix darwin test build when ENABLE_OTA_TESTS == 0. #28959

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/darwin/Framework/CHIPTests/MTROTAProviderTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#undef ENABLE_REAL_OTA_UPDATE_TESTS
#endif

#if ENABLE_OTA_TESTS

static const uint16_t kPairingTimeoutInSeconds = 10;
static const uint16_t kTimeoutInSeconds = 3;
static const uint16_t kTimeoutWithUpdateInSeconds = 60;
Expand Down Expand Up @@ -78,15 +80,12 @@
@class MTROTARequestorAppRunner;

@interface MTROTAProviderTests : XCTestCase
#if ENABLE_OTA_TESTS
- (NSTask *)createTaskForPath:(NSString *)path;
- (NSString *)createImageFromRawImage:(NSString *)rawImage withVersion:(NSNumber *)version;
- (MTRDevice *)commissionDeviceWithPayload:(NSString *)payloadString nodeID:(NSNumber *)nodeID;
- (void)registerRunningRequestor:(MTROTARequestorAppRunner *)requestor;
#endif // ENABLE_OTA_TESTS
@end

#if ENABLE_OTA_TESTS
static unsigned sAppRunnerIndex = 1;

@interface MTROTARequestorAppRunner : NSObject
Expand Down Expand Up @@ -173,7 +172,6 @@ - (void)terminate
}

@end
#endif // ENABLE_OTA_TESTS

@interface MTROTAProviderTestControllerDelegate : NSObject <MTRDeviceControllerDelegate>
@property (nonatomic, readonly) XCTestExpectation * expectation;
Expand Down Expand Up @@ -583,8 +581,6 @@ @implementation MTROTAProviderTests {
NSMutableSet<MTROTARequestorAppRunner *> * _runningRequestors;
}

#if ENABLE_OTA_TESTS

+ (void)tearDown
{
// Global teardown, runs once
Expand Down Expand Up @@ -1573,6 +1569,14 @@ - (void)test999_TearDown
[[self class] shutdownStack];
}

#endif // ENABLE_OTA_TESTS
@end

#else // ENABLE_OTA_TESTS

@interface MTROTAProviderTests : XCTestCase
@end

@implementation MTROTAProviderTests
@end

#endif // ENABLE_OTA_TESTS