Skip to content

Commit

Permalink
Fix code coverage to only show files under test?
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelengland committed Jun 6, 2014
1 parent d8c0ad0 commit 0c0b543
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 21 additions & 0 deletions Example/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'rake/clean'

def pods; 'Pods'; end
def podfile_lock; 'Podfile.lock'; end
def build; 'build'; end
def workspace; 'Colors'; end

CLOBBER.include(podfile_lock)
CLOBBER.include(pods)

CLEAN.include(build)

task :default => :test

file podfile_lock do
sh 'pod install'
end

task :test => podfile_lock do
sh "xctool build -scheme #{workspace}-iOS -workspace #{workspace}.xcworkspace -sdk iphonesimulator OBJROOT=#{build} SHARED_PRECOMPS_DIR=#{build}"
end
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def subfolders; ['Spec']; end
def subfolders; ['Spec', 'Example']; end

def subperform(command)
subfolders.each do |subfolder|
Expand All @@ -25,6 +25,6 @@ task :test do
end

task :coverage do
options = subfolders.map { |subfolder| "-E '.*/#{subfolder}/.*'" }.join(' ')
sh "coveralls #{options}"
excludes = ['.*/Classes/.*\.h'] + subfolders.map { |subfolder| ".*/#{subfolder}/.*" }
sh "coveralls #{excludes.map { |exclude| "-E '#{exclude}'" }.join(' ')}"
end

0 comments on commit 0c0b543

Please sign in to comment.