Skip to content

Commit 826af40

Browse files
committed
Renamed XCTest preprocessor define. Using it for the watchOS build.
1 parent 7c0eddc commit 826af40

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

Source/OCMock.xcodeproj/project.pbxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,8 +2055,8 @@
20552055
ENABLE_STRICT_OBJC_MSGSEND = YES;
20562056
GCC_NO_COMMON_BLOCKS = YES;
20572057
GCC_PREPROCESSOR_DEFINITIONS = (
2058-
"DEBUG=1",
20592058
"$(inherited)",
2059+
OCM_DISABLE_XCTEST_FEATURES,
20602060
);
20612061
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
20622062
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
@@ -2094,6 +2094,7 @@
20942094
ENABLE_NS_ASSERTIONS = NO;
20952095
ENABLE_STRICT_OBJC_MSGSEND = YES;
20962096
GCC_NO_COMMON_BLOCKS = YES;
2097+
GCC_PREPROCESSOR_DEFINITIONS = OCM_DISABLE_XCTEST_FEATURES;
20972098
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
20982099
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
20992100
INFOPLIST_FILE = "OCMock/OCMock-Info.plist";

Source/OCMock/OCMFunctions.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#import <objc/runtime.h>
18-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
18+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
1919
#import <XCTest/XCTest.h>
2020
#endif
2121
#import "OCClassMockObject.h"
@@ -475,7 +475,7 @@ void OCMReportFailure(OCMLocation *loc, NSString *description)
475475
{
476476
id testCase = [loc testCase];
477477
#ifdef __IPHONE_14_0 // this is actually a test for Xcode 12; see issue #472
478-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
478+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
479479
if((testCase != nil) && [testCase respondsToSelector:@selector(recordIssue:)])
480480
{
481481
XCTSourceCodeLocation *xctloc = [[[XCTSourceCodeLocation alloc] initWithFilePath:[loc file] lineNumber:[loc line]] autorelease];

Source/OCMock/OCMStubRecorder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#import <objc/runtime.h>
2121

22-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
22+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
2323
@class XCTestExpectation;
2424
#endif
2525

@@ -33,7 +33,7 @@
3333
- (id)andDo:(void (^)(NSInvocation *invocation))block;
3434
- (id)andForwardToRealObject;
3535

36-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
36+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
3737
- (id)andFulfill:(XCTestExpectation *)expectation;
3838
#endif
3939

@@ -67,7 +67,7 @@
6767
#define andForwardToRealObject() _andForwardToRealObject()
6868
@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void);
6969

70-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
70+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
7171
#define andFulfill(anExpectation) _andFulfill(anExpectation)
7272
@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *);
7373
#endif

Source/OCMock/OCMStubRecorder.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#import "OCMNotificationPoster.h"
2525
#import "OCMRealObjectForwarder.h"
2626

27-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
27+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
2828
#import <XCTest/XCTest.h>
2929
#endif
3030

@@ -101,7 +101,7 @@ - (id)andForwardToRealObject
101101
return self;
102102
}
103103

104-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
104+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
105105
- (id)andFulfill:(XCTestExpectation *)expectation
106106
{
107107
return [self andDo:^(NSInvocation *invocation) {
@@ -198,7 +198,7 @@ @implementation OCMStubRecorder (Properties)
198198
return (id)[[theBlock copy] autorelease];
199199
}
200200

201-
#if !TARGET_OS_WATCH && !defined(OCM_DISABLE_XCTEST_SUPPORT)
201+
#if !defined(OCM_DISABLE_XCTEST_FEATURES)
202202

203203
@dynamic _andFulfill;
204204

Source/OCMockTests/OCMQuantifierTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ - (void)setUp
4949
expectFailure = NO;
5050
}
5151

52-
#if defined(__IPHONE_14_0) && !defined(OCM_DISABLE_XCTEST_SUPPORT) // this is actually a test for Xcode 12; see issue #472
52+
#if defined(__IPHONE_14_0) && !defined(OCM_DISABLE_XCTEST_FEATURES) // this is actually a test for Xcode 12; see issue #472
5353

5454
- (void)recordIssue:(XCTIssue *)issue
5555
{

Source/OCMockTests/OCMockObjectMacroTests.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ @interface OCMockObjectMacroTests : XCTestCase
108108

109109
@implementation OCMockObjectMacroTests
110110

111-
#if defined(__IPHONE_14_0) && !defined(OCM_DISABLE_XCTEST_SUPPORT) // this is actually a test for Xcode 12; see issue #472
111+
#if defined(__IPHONE_14_0) && !defined(OCM_DISABLE_XCTEST_FEATURES) // this is actually a test for Xcode 12; see issue #472
112112

113113
- (void)recordIssue:(XCTIssue *)issue
114114
{
@@ -306,7 +306,7 @@ - (NSString *)stringValueForTesting
306306
return @"TEST_STRING_FROM_TESTCASE";
307307
}
308308

309-
#ifndef OCM_DISABLE_XCTEST_SUPPORT
309+
#ifndef OCM_DISABLE_XCTEST_FEATURES
310310

311311
- (void)testFulfillsExpectation
312312
{
@@ -580,7 +580,7 @@ - (void)testReturnsCorrectObjectFromInitMethodCalledOnRecorderInsideMacro
580580
OCMStub([[mock andThrow:nil] initWithString:OCMOCK_ANY]);
581581
OCMStub([[mock andPost:nil] initWithString:OCMOCK_ANY]);
582582
OCMStub([[mock andCall:nil onObject:nil] initWithString:OCMOCK_ANY]);
583-
#ifndef OCM_DISABLE_XCTEST_SUPPORT
583+
#ifndef OCM_DISABLE_XCTEST_FEATURES
584584
OCMStub([[mock andFulfill:nil] initWithString:OCMOCK_ANY]);
585585
#endif
586586
OCMStub([[mock andDo:nil] initWithString:OCMOCK_ANY]);

0 commit comments

Comments
 (0)