Skip to content

Commit

Permalink
Added code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Oct 26, 2017
1 parent a52afbe commit 66dc947
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .bundle/config
@@ -0,0 +1,2 @@
---
BUNDLE_WITHOUT: "documentation"
7 changes: 7 additions & 0 deletions .slather.yml
@@ -0,0 +1,7 @@
coverage_service: coveralls
xcodeproj: Layout.xcodeproj
scheme: Layout
source_directory: Layout/*
ignore:
- Layout/Expression.swift
- LayoutTests/*
25 changes: 16 additions & 9 deletions .travis.yml
@@ -1,10 +1,17 @@
language: objective-c
osx_image: xcode8.3

script: xcodebuild test -project Layout.xcodeproj -scheme Layout -destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=10.3.1'
script: xcodebuild test -project Layout.xcodeproj -scheme LayoutTool -sdk macosx

script: xcodebuild -project Layout.xcodeproj -scheme SampleApp -sdk iphonesimulator
script: xcodebuild -project Layout.xcodeproj -scheme Sandbox -sdk iphonesimulator
script: xcodebuild -project Layout.xcodeproj -scheme UIDesigner -sdk iphonesimulator
language: swift
osx_image: xcode9

env:
- LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8
before_install:
- rvm install ruby-2.4.2
install:
- bundle install --without=documentation
script:
- set -o pipefail
- xcodebuild -project Layout.xcodeproj -scheme LayoutTool -sdk macosx test
- xcodebuild -project Layout.xcodeproj -scheme SampleApp -sdk iphonesimulator
- xcodebuild -project Layout.xcodeproj -scheme Sandbox -sdk iphonesimulator
- xcodebuild -project Layout.xcodeproj -scheme UIDesigner -sdk iphonesimulator
- xcodebuild -project Layout.xcodeproj -scheme Layout -destination 'platform=iOS Simulator,name=iPhone 8 Plus,OS=11.0' clean build test | bundle exec xcpretty
after_success: bundle exec slather
4 changes: 4 additions & 0 deletions Gemfile
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'slather'
gem 'xcpretty'
47 changes: 47 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,47 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.5)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
claide (1.0.2)
clamp (0.6.5)
colored2 (3.1.2)
concurrent-ruby (1.0.5)
i18n (0.9.0)
concurrent-ruby (~> 1.0)
mini_portile2 (2.1.0)
minitest (5.10.3)
nanaimo (0.2.3)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
rouge (2.0.7)
slather (2.4.3)
CFPropertyList (~> 2.2)
activesupport (>= 4.0.2, < 5)
clamp (~> 0.6)
nokogiri (>= 1.6, < 1.7)
xcodeproj (~> 1.4)
thread_safe (0.3.6)
tzinfo (1.2.3)
thread_safe (~> 0.1)
xcodeproj (1.5.3)
CFPropertyList (~> 2.3.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)
xcpretty (0.2.8)
rouge (~> 2.0.7)

PLATFORMS
ruby

DEPENDENCIES
slather
xcpretty

BUNDLED WITH
1.15.4
3 changes: 2 additions & 1 deletion Layout.xcodeproj/xcshareddata/xcschemes/Layout.xcscheme
Expand Up @@ -27,7 +27,8 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
8 changes: 7 additions & 1 deletion Layout/RuntimeType.swift
Expand Up @@ -124,9 +124,15 @@ public class RuntimeType: NSObject {
assertionFailure("Empty objCType")
return nil
}
print(OBJC_BOOL_IS_BOOL)
self.availability = availability
switch first {
case "c" where OBJC_BOOL_IS_BOOL == 0, "B":
case "B":
type = .any(Bool.self)
case "c":
if OBJC_BOOL_IS_BOOL == 1 {
fallthrough
}
type = .any(Bool.self)
case "c", "i", "s", "l", "q":
type = .any(Int.self)
Expand Down
1 change: 1 addition & 0 deletions README.md
@@ -1,4 +1,5 @@
[![Travis](https://img.shields.io/travis/schibsted/layout.svg)](https://travis-ci.org/schibsted/layout)
[![Coveralls](https://coveralls.io/repos/github/schibsted/layout/badge.svg)](https://coveralls.io/github/schibsted/layout)
[![Platform](https://img.shields.io/cocoapods/p/Layout.svg?style=flat)](http://cocoadocs.org/docsets/Layout)
[![Swift](https://img.shields.io/badge/swift-3.1-yellow.svg?style=flat)](https://developer.apple.com/swift)
[![Swift](https://img.shields.io/badge/swift-3.2-orange.svg?style=flat)](https://developer.apple.com/swift)
Expand Down

0 comments on commit 66dc947

Please sign in to comment.