Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
feat: update OCMock library from pre compiled to xcframework (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedbashir committed Nov 21, 2023
1 parent eeb90aa commit 3dcb965
Show file tree
Hide file tree
Showing 115 changed files with 8,391 additions and 103 deletions.
104 changes: 104 additions & 0 deletions Libraries/OCMock/OCMock.xcframework/Info.plist
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>OCMock.framework/Versions/A/OCMock</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>OCMock.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>OCMock.framework/OCMock</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OCMock.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>OCMock.framework/OCMock</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>watchos-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OCMock.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>OCMock.framework/OCMock</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>OCMock.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>OCMock.framework/OCMock</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OCMock.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2019 Erik Doernenburg and contributors
* Copyright (c) 2009-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2019 Erik Doernenburg and contributors
* Copyright (c) 2009-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
Expand All @@ -16,7 +16,7 @@

#import <Foundation/Foundation.h>

@interface OCMArg : NSObject
@interface OCMArg : NSObject

// constraining arguments

Expand All @@ -37,7 +37,7 @@
+ (id *)setTo:(id)value;
+ (void *)setToValue:(NSValue *)value;
+ (id)invokeBlock;
+ (id)invokeBlockWithArgs:(id)first,... NS_REQUIRES_NIL_TERMINATION;
+ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION;

+ (id)defaultValue;

Expand All @@ -49,10 +49,5 @@

#define OCMOCK_ANY [OCMArg any]

#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#define OCMOCK_VALUE(variable) \
#define OCMOCK_VALUE(variable) \
({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; })
#else
#define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))]
#endif

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007-2019 Erik Doernenburg and contributors
* Copyright (c) 2007-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
Expand All @@ -16,8 +16,7 @@

#import <Foundation/Foundation.h>


@interface OCMConstraint : NSObject
@interface OCMConstraint : NSObject

+ (instancetype)constraint;
- (BOOL)evaluate:(id)value;
Expand All @@ -43,29 +42,30 @@

@interface OCMIsNotEqualConstraint : OCMConstraint
{
@public
id testValue;
@public
id testValue;
}

@end

@interface OCMInvocationConstraint : OCMConstraint
{
@public
NSInvocation *invocation;
@public
NSInvocation *invocation;
}

@end

@interface OCMBlockConstraint : OCMConstraint
{
BOOL (^block)(id);
BOOL (^block)(id);
}

- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block;

@end


#ifndef OCM_DISABLE_SHORT_SYNTAX
#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self]
#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)]
#endif
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Erik Doernenburg and contributors
* Copyright (c) 2014-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
Expand All @@ -25,3 +25,4 @@


OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType);
OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Erik Doernenburg and contributors
* Copyright (c) 2014-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
Expand All @@ -15,14 +15,13 @@
*/

#import <Foundation/Foundation.h>
#import "OCMFunctions.h"

#import <OCMock/OCMFunctions.h>

@interface OCMLocation : NSObject
{
id testCase;
NSString *file;
NSUInteger line;
id testCase;
NSString *file;
NSUInteger line;
}

+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Erik Doernenburg and contributors
* Copyright (c) 2014-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
Expand All @@ -17,14 +17,16 @@
#import <Foundation/Foundation.h>

@class OCMLocation;
@class OCMQuantifier;
@class OCMRecorder;
@class OCMStubRecorder;
@class OCMockObject;


@interface OCMMacroState : NSObject
{
id recorder;
OCMRecorder *recorder;
BOOL invocationDidThrow;
}

+ (void)beginStubMacro;
Expand All @@ -37,13 +39,17 @@
+ (OCMStubRecorder *)endRejectMacro;

+ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation;
+ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier;
+ (void)endVerifyMacro;

+ (OCMMacroState *)globalState;

- (void)setRecorder:(id)aRecorder;
- (id)recorder;
- (void)setRecorder:(OCMRecorder *)aRecorder;
- (OCMRecorder *)recorder;

- (void)switchToClassMethod;

- (void)setInvocationDidThrow:(BOOL)flag;
- (BOOL)invocationDidThrow;

@end
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2016-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

#import <Foundation/Foundation.h>

@interface OCMQuantifier : NSObject
{
NSUInteger expectedCount;
}

+ (instancetype)never;
+ (instancetype)exactly:(NSUInteger)count;
+ (instancetype)atLeast:(NSUInteger)count;
+ (instancetype)atMost:(NSUInteger)count;

- (BOOL)isValidCount:(NSUInteger)count;

- (NSString *)description;

@end


#define OCMNever() ([OCMQuantifier never])
#define OCMTimes(n) ([OCMQuantifier exactly:(n)])
#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)])
#define OCMAtMost(n) ([OCMQuantifier atMost:(n)])

#ifndef OCM_DISABLE_SHORT_QSYNTAX
#define never() OCMNever()
#define times(n) OCMTimes(n)
#define atLeast(n) OCMAtLeast(n)
#define atMost(n) OCMAtMost(n)
#endif
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Erik Doernenburg and contributors
* Copyright (c) 2014-2021 Erik Doernenburg and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use these files except in compliance with the License. You may obtain
Expand All @@ -24,16 +24,18 @@
{
OCMockObject *mockObject;
OCMInvocationMatcher *invocationMatcher;
BOOL wasUsed;
BOOL didRecordInvocation;
BOOL shouldReturnMockFromInit;
}

- (instancetype)init;
- (instancetype)initWithMockObject:(OCMockObject *)aMockObject;

- (void)setMockObject:(OCMockObject *)aMockObject;
- (void)setShouldReturnMockFromInit:(BOOL)flag;

- (OCMInvocationMatcher *)invocationMatcher;
- (BOOL)wasUsed;
- (BOOL)didRecordInvocation;

- (id)classMethod;
- (id)ignoringNonObjectArgs;
Expand All @@ -43,6 +45,6 @@
@interface OCMRecorder (Properties)

#define ignoringNonObjectArgs() _ignoringNonObjectArgs()
@property (nonatomic, readonly) OCMRecorder *(^ _ignoringNonObjectArgs)(void);
@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void);

@end

0 comments on commit 3dcb965

Please sign in to comment.