From 1cdfdb6d3f861fb4c382bb9cc4401e6bb4520c6e Mon Sep 17 00:00:00 2001 From: Luca Serpico Date: Wed, 6 May 2015 15:07:17 +0100 Subject: [PATCH 1/4] Do tests using xctool --- .xctool-args | 6 ++++++ Rakefile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .xctool-args diff --git a/.xctool-args b/.xctool-args new file mode 100644 index 0000000..2b341bf --- /dev/null +++ b/.xctool-args @@ -0,0 +1,6 @@ +[ + "-workspace", "IGHTMLQuery.xcworkspace", + "-scheme", "IGHTMLQuery", + "-configuration", "Debug", + "-sdk", "iphonesimulator", +] \ No newline at end of file diff --git a/Rakefile b/Rakefile index 1af92c9..947c519 100644 --- a/Rakefile +++ b/Rakefile @@ -14,7 +14,7 @@ end desc "Run tests" task :test do - system("xcodebuild -workspace IGHTMLQuery.xcworkspace -scheme IGHTMLQuery -sdk iphonesimulator test") + exec('xctool GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES clean test') end task :default => :build \ No newline at end of file From b01368f3c5c90769077f1e03e5dbcdc48745e878 Mon Sep 17 00:00:00 2001 From: Luca Serpico Date: Wed, 6 May 2015 15:08:26 +0100 Subject: [PATCH 2/4] Generate coverage stats using slather/Coveralls --- .slather.yml | 4 ++ .travis.yml | 3 +- Gemfile | 6 ++- Gemfile.lock | 40 +++++++++++++++++++ IGHTMLQuery.xcodeproj/project.pbxproj | 4 ++ .../xcschemes/IGHTMLQuery.xcscheme | 6 ++- Podfile.lock | 2 +- 7 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 .slather.yml diff --git a/.slather.yml b/.slather.yml new file mode 100644 index 0000000..f291e35 --- /dev/null +++ b/.slather.yml @@ -0,0 +1,4 @@ +ci_service: travis_ci +coverage_service: coveralls +xcodeproj: IGHTMLQuery.xcodeproj +source_directory: ./IGHTMLQuery/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d8c7436..a1358fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,5 @@ before_install: - export LANG=en_US.UTF-8 - bundle install - pod install -script: xcodebuild -workspace IGHTMLQuery.xcworkspace -scheme IGHTMLQuery -sdk iphonesimulator test | xcpretty -c; exit ${PIPESTATUS[0]} +script: rake test +after_success: slather diff --git a/Gemfile b/Gemfile index d34262a..3afe179 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,8 @@ gem "rake" gem "opal" gem "opal-sprockets" gem "cocoapods" -gem "xcpretty" \ No newline at end of file +gem "xcpretty" +gem 'minitest' +gem 'slather' +gem 'coveralls' +gem 'activesupport' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index f6b851c..080f56f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,6 +8,7 @@ GEM thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) claide (0.8.1) + clamp (0.6.4) cocoapods (0.36.1) activesupport (>= 3.2.15) claide (~> 0.8.1) @@ -34,16 +35,31 @@ GEM netrc (= 0.7.8) cocoapods-try (0.4.3) colored (1.2) + coveralls (0.8.1) + json (~> 1.8) + rest-client (>= 1.6.8, < 2) + simplecov (~> 0.10.0) + term-ansicolor (~> 1.3) + thor (~> 0.19.1) + docile (1.1.5) + domain_name (0.5.24) + unf (>= 0.0.5, < 1.0.0) escape (0.0.4) fuzzy_match (2.0.4) hike (1.2.3) + http-cookie (1.0.2) + domain_name (~> 0.5) i18n (0.7.0) json (1.8.2) + mime-types (2.5) + mini_portile (0.6.2) minitest (5.5.1) molinillo (0.2.2) multi_json (1.11.0) nap (0.8.0) netrc (0.7.8) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) opal (0.5.5) source_map opal-sprockets (0.3.0) @@ -52,6 +68,19 @@ GEM open4 (1.3.4) rack (1.6.0) rake (10.4.2) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + simplecov (0.10.0) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + slather (1.7.0) + clamp (~> 0.6) + nokogiri (~> 1.6.3) + xcodeproj (~> 0.23.0) source_map (3.0.1) json sprockets (2.12.3) @@ -59,10 +88,17 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) + term-ansicolor (1.3.0) + tins (~> 1.0) + thor (0.19.1) thread_safe (0.3.5) tilt (1.4.1) + tins (1.5.1) tzinfo (1.2.2) thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.1) xcodeproj (0.23.1) activesupport (>= 3) colored (~> 1.2) @@ -72,8 +108,12 @@ PLATFORMS ruby DEPENDENCIES + activesupport cocoapods + coveralls + minitest opal opal-sprockets rake + slather xcpretty diff --git a/IGHTMLQuery.xcodeproj/project.pbxproj b/IGHTMLQuery.xcodeproj/project.pbxproj index 1a06c62..d1c983d 100644 --- a/IGHTMLQuery.xcodeproj/project.pbxproj +++ b/IGHTMLQuery.xcodeproj/project.pbxproj @@ -578,6 +578,8 @@ COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -615,6 +617,8 @@ COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; diff --git a/IGHTMLQuery.xcodeproj/xcshareddata/xcschemes/IGHTMLQuery.xcscheme b/IGHTMLQuery.xcodeproj/xcshareddata/xcschemes/IGHTMLQuery.xcscheme index 30ea2a0..d6bbfe0 100644 --- a/IGHTMLQuery.xcodeproj/xcshareddata/xcschemes/IGHTMLQuery.xcscheme +++ b/IGHTMLQuery.xcodeproj/xcshareddata/xcschemes/IGHTMLQuery.xcscheme @@ -58,7 +58,8 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> - + - + Date: Wed, 6 May 2015 15:48:04 +0100 Subject: [PATCH 3/4] Added badges --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0d899a2..b46c1ac 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ + +# IGHTMLQuery +--- + +[![CI Status](http://img.shields.io/travis/serluca/IGHTMLQuery.svg?style=flat)](https://travis-ci.org/serluca/IGHTMLQuery) +[![Coverage Status](https://coveralls.io/repos/serluca/IGHTMLQuery/badge.svg?branch=master)](https://coveralls.io/r/serluca/IGHTMLQuery?branch=master) + + + + # What is it? IGHTMLQuery is a lightweight XML/HTML parser for iOS, built on top of libxml. It is inspired by jQuery and nokogiri. Consider following snippets: From ff70bab8961ca225d8626b64a56562ed5485de3b Mon Sep 17 00:00:00 2001 From: Luca Serpico Date: Wed, 6 May 2015 15:50:59 +0100 Subject: [PATCH 4/4] README updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b46c1ac..c86fc6f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # IGHTMLQuery ---- + [![CI Status](http://img.shields.io/travis/serluca/IGHTMLQuery.svg?style=flat)](https://travis-ci.org/serluca/IGHTMLQuery) [![Coverage Status](https://coveralls.io/repos/serluca/IGHTMLQuery/badge.svg?branch=master)](https://coveralls.io/r/serluca/IGHTMLQuery?branch=master)