From 77b69708a1ff4c108d8e0602fa6ee1229ccfcd44 Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 11:22:52 +0300 Subject: [PATCH 01/11] Use slather --- .slather.yml | 5 +++++ .travis.yml | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .slather.yml diff --git a/.slather.yml b/.slather.yml new file mode 100644 index 0000000..3944e1e --- /dev/null +++ b/.slather.yml @@ -0,0 +1,5 @@ +coverage_service: coveralls +xcodeproj: BIObjCHelpers.xcworkspace +ignore: + - ./Example/* + - ./Pods/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index ebb0ed5..f560e50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,12 @@ osx_image: beta-xcode6.3 before_install: - brew update - if brew outdated | grep -qx xctool; then brew upgrade xctool; fi - - sudo easy_install cpp-coveralls + - rvm use $RVM_RUBY_VERSION + +install: + - bundle install --without=documentation --path ../travis_bundle_dir script: - xctool test -workspace BIObjCHelpers.xcworkspace -scheme BIObjCHelpers -sdk iphonesimulator8.3 -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" -after_success: - ./coveralls.rb --exclude-folder ./Example --exclude-folder ./Pods +after_success: slather From 559d196f28e6de6307f7ce70944088171febcb99 Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 11:33:49 +0300 Subject: [PATCH 02/11] Update travis file for slather install --- .travis.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index f560e50..c01b874 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,11 @@ xcode_workspace: BIObjCHelpers.xcworkspace osx_image: beta-xcode6.3 before_install: - - brew update - - if brew outdated | grep -qx xctool; then brew upgrade xctool; fi - - rvm use $RVM_RUBY_VERSION - -install: - - bundle install --without=documentation --path ../travis_bundle_dir + - gem i cocoapods --no-ri --no-rdoc + - gem i slather --no-ri --no-rdoc + - brew uninstall xctool; brew install xctool --HEAD; script: - - xctool test -workspace BIObjCHelpers.xcworkspace -scheme BIObjCHelpers -sdk iphonesimulator8.3 -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" + - xctool test -workspace BIObjCHelpers.xcworkspace -scheme BIObjCHelpers -sdk iphonesimulator8.3 -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" after_success: slather From ec7946f966995c131bfd53034c0068fc4698cd3d Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 11:39:43 +0300 Subject: [PATCH 03/11] Update gemfile --- .travis.yml | 1 - Gemfile | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Gemfile diff --git a/.travis.yml b/.travis.yml index c01b874..95d64b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ xcode_workspace: BIObjCHelpers.xcworkspace osx_image: beta-xcode6.3 before_install: - - gem i cocoapods --no-ri --no-rdoc - gem i slather --no-ri --no-rdoc - brew uninstall xctool; brew install xctool --HEAD; diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..23a1d05 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'slather' \ No newline at end of file From 3ab0bdccf8071b0bc11993adc7b03124258bfcd3 Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 11:43:47 +0300 Subject: [PATCH 04/11] Update travis file --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95d64b6..4f8d8b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,11 @@ xcode_workspace: BIObjCHelpers.xcworkspace osx_image: beta-xcode6.3 before_install: - - gem i slather --no-ri --no-rdoc - - brew uninstall xctool; brew install xctool --HEAD; +- gem i cocoapods --no-ri --no-rdoc +- gem i slather --no-ri --no-rdoc +- brew uninstall xctool; brew install xctool --HEAD; script: - - xctool test -workspace BIObjCHelpers.xcworkspace -scheme BIObjCHelpers -sdk iphonesimulator8.3 -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" +- xctool test -workspace BIObjCHelpers.xcworkspace -scheme BIObjCHelpers -sdk iphonesimulator8.3 -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" after_success: slather From 1b8312aae40ecfc4d8c6f5826c14fad218b0546f Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 11:56:52 +0300 Subject: [PATCH 05/11] Add gem lock file --- Gemfile.lock | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..8244998 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,38 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (4.2.3) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + claide (0.9.1) + clamp (0.6.5) + colored (1.2) + i18n (0.7.0) + json (1.8.3) + mini_portile (0.6.2) + minitest (5.8.0) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) + slather (1.8.1) + clamp (~> 0.6) + nokogiri (~> 1.6.3) + xcodeproj (~> 0.26.2) + thread_safe (0.3.5) + tzinfo (1.2.2) + thread_safe (~> 0.1) + xcodeproj (0.26.3) + activesupport (>= 3) + claide (~> 0.9.1) + colored (~> 1.2) + +PLATFORMS + ruby + +DEPENDENCIES + slather + +BUNDLED WITH + 1.10.6 From c47f1ff28b9946ad84bc75a06534497d020faae8 Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 12:31:36 +0300 Subject: [PATCH 06/11] Update travis file --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4f8d8b8..a254886 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,6 @@ before_install: - brew uninstall xctool; brew install xctool --HEAD; script: -- xctool test -workspace BIObjCHelpers.xcworkspace -scheme BIObjCHelpers -sdk iphonesimulator8.3 -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" +- xctool test -workspace BIObjCHelpers.xcworkspace -scheme BIObjCHelpersTests -sdk iphonesimulator8.3 -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" after_success: slather From fd49984364df745d33cdbfe148a9206f8d594487 Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 12:37:47 +0300 Subject: [PATCH 07/11] Update slather file --- .slather.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.slather.yml b/.slather.yml index 3944e1e..3511547 100644 --- a/.slather.yml +++ b/.slather.yml @@ -1,5 +1,4 @@ coverage_service: coveralls -xcodeproj: BIObjCHelpers.xcworkspace +xcodeproj: BIObjCHelpers.xcodeproj ignore: - - ./Example/* - - ./Pods/* \ No newline at end of file +- "*/Pods/*" \ No newline at end of file From cb283210eb48a11ae4fbf4ff1589b61c54b68d4f Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 12:41:44 +0300 Subject: [PATCH 08/11] Generate test coverage files --- BIObjCHelpers.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BIObjCHelpers.xcodeproj/project.pbxproj b/BIObjCHelpers.xcodeproj/project.pbxproj index abcf3b6..c34db8e 100644 --- a/BIObjCHelpers.xcodeproj/project.pbxproj +++ b/BIObjCHelpers.xcodeproj/project.pbxproj @@ -972,6 +972,8 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -1014,6 +1016,8 @@ ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; From 5b7f40db2f9651421d5bff22bf340aa9ca3f171f Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 12:49:14 +0300 Subject: [PATCH 09/11] Ignore coverage for unit test files --- .slather.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.slather.yml b/.slather.yml index 3511547..099fe42 100644 --- a/.slather.yml +++ b/.slather.yml @@ -1,4 +1,5 @@ coverage_service: coveralls xcodeproj: BIObjCHelpers.xcodeproj ignore: -- "*/Pods/*" \ No newline at end of file +- "*/Pods/*" +- BIObjCHelpersTests/* \ No newline at end of file From 8d059aed8b3e6e27ad0e13833a2b750b950a6e64 Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 12:56:29 +0300 Subject: [PATCH 10/11] Remove coverage.rb file --- coveralls.rb | 136 --------------------------------------------------- 1 file changed, 136 deletions(-) delete mode 100755 coveralls.rb diff --git a/coveralls.rb b/coveralls.rb deleted file mode 100755 index e182aab..0000000 --- a/coveralls.rb +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env ruby - -require 'etc' -require 'fileutils' -require 'find' -require 'optparse' - -# arraw of source subfolders to exclude -excludedFolders = [] -extensionsToProcess = [] -coveralls_cmd = "coveralls" - -excludeHeaders = false - -# create option parser -opts = OptionParser.new -opts.banner = "Usage: coveralls.rb [options]" - -opts.on('-e', '--exclude-folder FOLDER', 'Folder to exclude') do |v| - excludedFolders << v - coveralls_cmd.concat(" -e #{v}") -end - -opts.on('-h', '--exclude-headers', 'Ignores headers') do |v| - excludeHeaders = true -end - -opts.on('-x', '--extension EXT', 'Source file extension to process') do |v| - extensionsToProcess << v - coveralls_cmd.concat(" -x #{v}") -end - -opts.on_tail("-?", "--help", "Show this message") do - puts opts - exit -end - -# parse the options -begin - opts.parse!(ARGV) -rescue OptionParser::InvalidOption => e - puts e - puts opts - exit(1) -end - -# the folders -workingDir = Dir.getwd -derivedDataDir = "#{Etc.getpwuid.dir}/Library/Developer/Xcode/DerivedData/" -outputDir = workingDir + "/gcov" - -# create gcov output folder -FileUtils.mkdir outputDir - -# pattern to get source file from first line of gcov file -GCOV_SOURCE_PATTERN = Regexp.new(/Source:(.*)/) - -# enumerate all gcda files underneath derivedData -Find.find(derivedDataDir) do |gcda_file| - - if gcda_file.match(/\.gcda\Z/) - - #get just the folder name - gcov_dir = File.dirname(gcda_file) - - # cut off absolute working dir to get relative source path - relative_input_path = gcda_file.slice(derivedDataDir.length, gcda_file.length) - puts "\nINPUT: #{relative_input_path}" - - #process the file - result = %x( gcov '#{gcda_file}' -o '#{gcov_dir}' ) - - # filter the resulting output - Dir.glob("*.gcov") do |gcov_file| - - firstLine = File.open(gcov_file).readline - match = GCOV_SOURCE_PATTERN.match(firstLine) - - if (match) - - source_path = match[1] - - puts "source: #{source_path} - #{workingDir}" - - if (source_path.start_with? workingDir) - - # cut off absolute working dir to get relative source path - relative_path = source_path.slice(workingDir.length+1, source_path.length) - - extension = File.extname(relative_path) - extension = extension.slice(1, extension.length-1) - - puts "#{extension}" - - # get the path components - path_comps = relative_path.split(File::SEPARATOR) - - shouldProcess = false - exclusionMsg ="" - - if (excludedFolders.include?(path_comps[0])) - exclusionMsg = "excluded via option" - else - if (excludeHeaders == true && extension == 'h') - exclusionMsg = "excluded header" - else - if (extensionsToProcess.count == 0 || extensionsToProcess.include?(extension)) - shouldProcess = true - else - exclusionMsg = "excluded extension" - shouldProcess = false - end - end - end - - if (shouldProcess) - puts " - process: #{relative_path}" - FileUtils.mv(gcov_file, outputDir) - else - puts " - ignore: #{relative_path} (#{exclusionMsg})" - FileUtils.rm gcov_file - end - else - puts " - ignore: #{gcov_file} (outside source folder)" - FileUtils.rm gcov_file - end - end - end - end -end - -#call the coveralls, exclude some files -system coveralls_cmd - -#clean up -FileUtils.rm_rf outputDir From 2564829af5a81083520058cf8ab0dc46385efe86 Mon Sep 17 00:00:00 2001 From: Bogdan Iusco Date: Mon, 17 Aug 2015 12:57:24 +0300 Subject: [PATCH 11/11] Exclude Example folder for coverage files --- .slather.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.slather.yml b/.slather.yml index 099fe42..0db8048 100644 --- a/.slather.yml +++ b/.slather.yml @@ -2,4 +2,5 @@ coverage_service: coveralls xcodeproj: BIObjCHelpers.xcodeproj ignore: - "*/Pods/*" +- Example/* - BIObjCHelpersTests/* \ No newline at end of file