Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
Adds Snapshot tests + CI (#332)
Browse files Browse the repository at this point in the history
* Re-organizes and simplified project structure
Integrates Application sample project into same workspace as a new target
Adds snapshot testing infra + snapshots all Application cases

* Renames snapshot references directory

* Tweaks the sample project to update the status bar style appropriately

* Integrates Colors sample project into same workspace as a new target

* Deletes old examples. Don't need them anymore.

* Adds travis and codecov yml files, for setting up the CI

* Adds Dangerfile

* Wrong path!

* Ignores the entire project directory, so only the lib source is checked-in for codecov

* Adds codecov and travis badges in README

* Codecov path correction
  • Loading branch information
Ignacio Romero Zurbuchen authored May 1, 2017
1 parent e612d4a commit 0043d58
Show file tree
Hide file tree
Showing 1,231 changed files with 4,389 additions and 17,221 deletions.
19 changes: 19 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
codecov:
token:

coverage:
precision: 2
round: nearest
range: 70...100
ignore:
- ./DZNEmptyDataSet/.*

status:
project: true
patch: true
changes: false

comment:
layout: "header, diff, tree, changes"
behavior: default
branches: master
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
osx_image: xcode8.1
language: objective-c
sudo: required

cache:
- bundler
- cocoapods

before_install:
- bundle install
- bundle exec danger

env:
global:
- LANG=en_US.UTF-8

- WORKSPACE="DZNEmptyDataSet/DZNEmptyDataSet.xcworkspace"
- IOS_SCHEME="DZNEmptyDataSet"
- IOS_SDK="iphonesimulator10.0"

matrix:
- DESTINATION="OS=10.1,name=iPhone 7" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"

script:
- xcodebuild clean build test -scheme "$SCHEME" -workspace "$WORKSPACE" SDK="$IOS_SDK" -destination "$DESTINATION" -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES

after_success:
- bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.backgroundColor = [UIColor whiteColor];
self.window.backgroundColor = [UIColor whiteColor];

return YES;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ typedef NS_ENUM(NSUInteger, ApplicationType) {

- (instancetype)initWithDictionary:(NSDictionary *)dict;

+ (NSArray *)applicationsFromJSONAtPath:(NSString *)path;
+ (NSArray *)applicationsFromJSON:(id)JSON;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,35 @@ @implementation Application

- (instancetype)initWithDictionary:(NSDictionary *)dict
{
if (!dict) {
return nil;
}

self = [super init];
if (self) {
self.displayName = [dict objectForKey:@"display_name"];
self.developerName = [dict objectForKey:@"developer_name"];
self.identifier = [dict objectForKey:@"identifier"];
self.displayName = dict[@"display_name"];
self.developerName = dict[@"developer_name"];
self.identifier = dict[@"identifier"];
}
return self;
}

+ (NSArray *)applicationsFromJSONAtPath:(NSString *)path
{
NSData *data = [NSData dataWithContentsOfFile:path];
NSArray *JSON = [[NSJSONSerialization JSONObjectWithData:data options:kNilOptions|NSJSONWritingPrettyPrinted error:nil] mutableCopy];

return [self applicationsFromJSON:JSON];
}

+ (NSArray *)applicationsFromJSON:(id)JSON
{
NSMutableArray *objects = [NSMutableArray new];

for (NSDictionary *dictionary in JSON) {
Application *obj = [[Application alloc] initWithDictionary:dictionary];
[objects addObject:obj];
}

return objects;
}

- (void)setDisplayName:(NSString *)displayName
{
_displayName = displayName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
Expand All @@ -24,6 +40,18 @@
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "icon-57.png",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
Expand All @@ -36,6 +64,16 @@
"filename" : "[email protected]",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
Expand All @@ -60,6 +98,30 @@
"filename" : "icon-40@2x~ipad.png",
"scale" : "2x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "icon-50~ipad.png",
"scale" : "1x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "icon-50@2x~ipad.png",
"scale" : "2x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "icon-72~ipad.png",
"scale" : "1x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "icon-72@2x~ipad.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit 0043d58

Please sign in to comment.