Commit 0aa7c21a00b9e7597f83da5cfbb41177b55a6ca3
1 parent
7ff5ef27
Exists in
staging
and in
42 other branches
ActionItem85: running all tests under rcov
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@620 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
7 additions
and
5 deletions
Show diff stats
lib/tasks/test_rcov.rake
... | ... | @@ -20,10 +20,12 @@ |
20 | 20 | namespace :test do |
21 | 21 | desc "Run all tests with Rcov to measure coverage" |
22 | 22 | task :rcov do |t| |
23 | - puts "Generating full test coverage report..." | |
24 | - test_tasks = Rake::Task.tasks.select{ |t| t.comment && [ 'test:units', 'test:functionals', 'test:integration' ].include?(t.name) } | |
25 | - for test_task in test_tasks | |
26 | - Rake::Task[test_task.name + ':rcov'].invoke | |
27 | - end | |
23 | + require 'rbconfig' | |
24 | + | |
25 | + tests = Dir.glob(File.join(RAILS_ROOT, 'test', '*', '*_test.rb')) | |
26 | + outdir = File.join(RAILS_ROOT, 'coverage') | |
27 | + test_loader = File.join(Config::CONFIG['rubylibdir'], 'rake', 'rake_test_loader.rb') | |
28 | + | |
29 | + system("rcov", '-o', outdir, '-T', '-x', 'rubygems/*,rcov*', '--rails', '-Ilib:test', test_loader, *tests) | |
28 | 30 | end |
29 | 31 | end | ... | ... |