Permalink
Browse files

Use SimpleCov to generate code coverage reports

  • Loading branch information...
1 parent 7a7802b commit de4f812e2acb992d98bd4bb0cc5b0b6bf1455dbd @programble programble committed Apr 20, 2013
Showing with 37 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +6 −0 Gemfile.lock
  3. +1 −0 apricot.gemspec
  4. +29 −0 spec/spec_helper.rb
View
@@ -1,3 +1,4 @@
*.rbc
.rbx
*.gem
+coverage
View
@@ -8,6 +8,7 @@ GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.3)
+ multi_json (1.3.6)
rake (10.0.4)
redcard (1.1.0)
rspec (2.13.0)
@@ -18,6 +19,10 @@ GEM
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
+ simplecov (0.7.1)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.7.1)
+ simplecov-html (0.7.1)
PLATFORMS
ruby
@@ -26,3 +31,4 @@ DEPENDENCIES
apricot!
rake (~> 10.0.3)
rspec (~> 2.13.0)
+ simplecov (~> 0.7.0)
View
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake", "~> 10.0.3"
s.add_development_dependency "rspec", "~> 2.13.0"
+ s.add_development_dependency "simplecov", "~> 0.7.0"
end
View
@@ -1,4 +1,33 @@
require 'bundler/setup'
require 'rspec'
+
+require 'simplecov'
+
+SimpleCov.start do
+ add_filter 'spec/'
+ add_filter 'kernel/' # SimpleCov doesn't understand Apricot code
+
+ add_group 'Compiler' do |src|
+ ['code_loader.rb',
+ 'compiler.rb',
+ 'errors.rb',
+ 'generator.rb',
+ 'reader.rb'].any? {|f| src.filename.end_with? "apricot/#{f}" }
+ end
+ add_group 'AST', 'ast'
+ add_group 'Special Forms', 'special_forms'
+ add_group 'Runtime' do |src|
+ ['boot.rb',
+ 'cons.rb',
+ 'identifier.rb',
+ 'list.rb',
+ 'macroexpand.rb',
+ 'misc.rb',
+ 'namespace.rb',
+ 'ruby_ext.rb',
+ 'seq.rb'].any? {|f| src.filename.end_with? "apricot/#{f}" }
+ end
+end
+
require 'apricot'
include Apricot

0 comments on commit de4f812

Please sign in to comment.