Skip to content

Commit de12a6f

Browse files
authored
Adding OCMock as gitmodule for building tests. (#1478)
*Moved OCMock to .gitmodules to make Carthage users' download more lightweight. *Updated all test targets to build and link OCMock. *Fixed many of the broken tests that have crashed or failed due to OCMock version. *Updated facebook dependency version *Circle and Travis build fixes across all platforms and for nightly build. Co-authored-by: @drdaz
1 parent 43faa78 commit de12a6f

File tree

16 files changed

+131
-281
lines changed

16 files changed

+131
-281
lines changed

.circleci/config.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ aliases:
66
- &prepare
77
|
88
git submodule update --init --recursive
9-
gem install bundler
9+
sudo gem install bundler
1010
bundle install
1111
- &filter-only-master
1212
branches:
@@ -19,7 +19,6 @@ jobs:
1919
<<: *defaults
2020
steps:
2121
- checkout
22-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
2322
- run: *prepare
2423
- run: bundle exec rake test:ios
2524
- run: bash <(curl -s https://codecov.io/bash)
@@ -29,7 +28,6 @@ jobs:
2928
<<: *defaults
3029
steps:
3130
- checkout
32-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
3331
- run: *prepare
3432
- run:
3533
name: "Create and set the default keychain"
@@ -49,7 +47,6 @@ jobs:
4947
<<: *defaults
5048
steps:
5149
- checkout
52-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
5350
- run: *prepare
5451
- run: bundle exec rake test:facebook_utils:ios
5552
- run: bash <(curl -s https://codecov.io/bash)
@@ -59,7 +56,6 @@ jobs:
5956
<<: *defaults
6057
steps:
6158
- checkout
62-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
6359
- run: *prepare
6460
- run: bundle exec rake test:twitter_utils:ios
6561
- run: bash <(curl -s https://codecov.io/bash)
@@ -69,7 +65,6 @@ jobs:
6965
<<: *defaults
7066
steps:
7167
- checkout
72-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
7368
- run: *prepare
7469
- run: bundle exec rake test:parseui:all
7570
- run: bash <(curl -s https://codecov.io/bash)
@@ -87,21 +82,18 @@ jobs:
8782
<<: *defaults
8883
steps:
8984
- checkout
90-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
9185
- run: *prepare
9286
- run: ./Scripts/jazzy.sh
9387
carthage:
9488
<<: *defaults
9589
steps:
9690
- checkout
97-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
9891
- run: *prepare
9992
- run: bundle exec rake test:carthage
10093
cocoapods:
10194
<<: *defaults
10295
steps:
10396
- checkout
104-
- run: echo 'chruby ruby-2.6' >> ~/.bash_profile
10597
- run: *prepare
10698
- run: bundle exec rake test:cocoapods
10799

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
## Build generated
55
build/
66
DerivedData
7+
OCMock.framework
78

89
## Various settings
910
*.pbxuser

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "Carthage/Checkouts/facebook-objc-sdk"]
88
path = Carthage/Checkouts/facebook-objc-sdk
99
url = https://github.com/facebook/facebook-objc-sdk.git
10+
[submodule "Carthage/Checkouts/OCMock"]
11+
path = Carthage/Checkouts/OCMock
12+
url = https://github.com/erikdoe/OCMock.git

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "facebook/facebook-objc-sdk" "v5.13.1"
1+
github "facebook/facebook-objc-sdk" "v5.15.1"
22
github "parse-community/Bolts-ObjC" "1.9.1"

Carthage/Checkouts/OCMock

Submodule OCMock added at 62fd0b2

Parse/Parse.xcodeproj/project.pbxproj

Lines changed: 8 additions & 76 deletions
Large diffs are not rendered by default.

Parse/Parse/Internal/PFApplication.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ - (id)init {
3939
if (self) {
4040
#if TARGET_OS_IOS || TARGET_OS_TV
4141
if (@available(iOS 1.0, tvOS 10.0, *)) {
42-
[self.systemApplication addObserver:self forKeyPath:@"applicationIconBadgeNumber" options:NSKeyValueObservingOptionNew context:nil];
43-
_iconBadgeNumber = self.systemApplication.applicationIconBadgeNumber;
42+
dispatch_async(dispatch_get_main_queue(), ^{
43+
[self.systemApplication addObserver:self forKeyPath:@"applicationIconBadgeNumber" options:NSKeyValueObservingOptionNew context:nil];
44+
self->_iconBadgeNumber = self.systemApplication.applicationIconBadgeNumber;
45+
});
4446
}
4547
#endif
4648
}

Parse/Tests/Other/StoreKitMocking/PFTestSKProductsRequest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ - (void)start {
6767
- (void)cancel {
6868
}
6969

70-
@end
70+
@end

Parse/Tests/Unit/FileControllerTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ - (void)testDownloadStreamSharesOperations {
340340
BFTaskCompletionSource *taskCompletionSource = [BFTaskCompletionSource taskCompletionSource];
341341
__block PFProgressBlock progressBlock = nil;
342342

343-
id mockedCommandRunner = [mockedDataSource commandRunner];
344-
OCMStub([mockedCommandRunner runFileDownloadCommandAsyncWithFileURL:tempPath
343+
id<PFCommandRunning> commandRunner = [mockedDataSource commandRunner];
344+
OCMStub([commandRunner runFileDownloadCommandAsyncWithFileURL:tempPath
345345
targetFilePath:[OCMArg isNotNil]
346346
cancellationToken:nil
347347
progressBlock:[OCMArg checkWithBlock:^BOOL(id obj) {

0 commit comments

Comments
 (0)