-
Notifications
You must be signed in to change notification settings - Fork 280
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
iOS Test target #484
Merged
Merged
iOS Test target #484
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
aa5d916
Add ObjectiveGit-iOSTests target
phatblat 0e8da3f
Merge branch 'master' into ben/libgit2-build
phatblat c8e012f
Remove libgit2-iOS target dependency on OpenSSL-iOS
phatblat 5146dbc
Add a few more specs to iOS Tests target
phatblat fd1b8c3
Add SSZipArchive 0.3.2
phatblat 84e8d28
Disable some warnings to get SSZipArchive to build :(
phatblat ceb22b0
Link iOS Tests target with libz
phatblat 556856f
Fix SSZipArchive import and failure detection
phatblat 1032e0f
I can haz path
phatblat 02499f0
Add all tests to iOS target
phatblat 80f0103
Import SSZipArchive.h only on iOS
phatblat ce17fde
Merge branch 'master' into ben/ios-test-target
ecd93b2
Merge branch 'master' into ben/ios-test-target
phatblat 60547af
Remove extra #import SSZipArchive.h
b9778f2
Create group for SSZipArchive sources
phatblat 94971e1
Xcode really wants to update the BlueprintIdentifier on the iOS scheme
phatblat 2712c2a
Add specific iOS simulator destination
phatblat 15f906c
Quote sdkflag
phatblat f57aca5
Tabs
phatblat c9da387
Clean up header search paths for iOSTests
phatblat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
github "jspahrsummers/xcconfigs" >= 0.7.1 | ||
github "Quick/Quick" ~> 0.3 | ||
github "Quick/Nimble" ~> 0.4 | ||
github "ZipArchive/ZipArchive" ~> 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
github "Quick/Nimble" "v0.4.2" | ||
github "Quick/Quick" "v0.3.1" | ||
github "ZipArchive/ZipArchive" "v0.3.2" | ||
github "jspahrsummers/xcconfigs" "0.7.2" |
Submodule ZipArchive
added at
60312c
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ | |
#import "QuickSpec+GTFixtures.h" | ||
#import <objc/runtime.h> | ||
|
||
#if TARGET_OS_IPHONE | ||
#import "SSZipArchive.h" | ||
#endif | ||
|
||
static const NSInteger FixturesErrorUnzipFailed = 666; | ||
|
||
static NSString * const FixturesErrorDomain = @"com.objectivegit.Fixtures"; | ||
|
@@ -95,6 +99,24 @@ - (NSString *)pathForFixtureRepositoryNamed:(NSString *)repositoryName { | |
} | ||
|
||
- (BOOL)unzipFile:(NSString *)member fromArchiveAtPath:(NSString *)zipPath intoDirectory:(NSString *)destinationPath error:(NSError **)error { | ||
|
||
#if TARGET_OS_IPHONE | ||
// iOS: unzip in-process using SSZipArchive | ||
// | ||
// system() and NSTask() are not available when running tests in the iOS simulator | ||
|
||
BOOL success = [SSZipArchive unzipFileAtPath:zipPath toDestination:destinationPath overwrite:YES password:nil error:error]; | ||
|
||
if (!success) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: it looks like there's a mix of tabs/spaces here. |
||
NSLog(@"Unzip failed"); | ||
return NO; | ||
} | ||
|
||
return YES; | ||
|
||
#else | ||
// OS X: shell out to unzip using NSTask | ||
|
||
NSTask *task = [[NSTask alloc] init]; | ||
task.launchPath = @"/usr/bin/unzip"; | ||
task.arguments = @[ @"-qq", @"-d", destinationPath, zipPath, [member stringByAppendingString:@"*"] ]; | ||
|
@@ -108,6 +130,9 @@ - (BOOL)unzipFile:(NSString *)member fromArchiveAtPath:(NSString *)zipPath intoD | |
} | ||
|
||
return success; | ||
|
||
#endif | ||
|
||
} | ||
|
||
#pragma mark API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to use SSZipArchive on both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would certainly make things cleaner. My only concern is speed. The iOS tests are quite a bit slower than the Mac tests and I'm not sure why. I'll experiment with using SSZipArchive for the Mac tests to see if they slow down or not.