From 0aa7c21a00b9e7597f83da5cfbb41177b55a6ca3 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Thu, 4 Oct 2007 19:41:37 +0000 Subject: [PATCH] ActionItem85: running all tests under rcov --- lib/tasks/test_rcov.rake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/tasks/test_rcov.rake b/lib/tasks/test_rcov.rake index 565aeb4..216085a 100644 --- a/lib/tasks/test_rcov.rake +++ b/lib/tasks/test_rcov.rake @@ -20,10 +20,12 @@ namespace :test do desc "Run all tests with Rcov to measure coverage" task :rcov do |t| - puts "Generating full test coverage report..." - test_tasks = Rake::Task.tasks.select{ |t| t.comment && [ 'test:units', 'test:functionals', 'test:integration' ].include?(t.name) } - for test_task in test_tasks - Rake::Task[test_task.name + ':rcov'].invoke - end + require 'rbconfig' + + tests = Dir.glob(File.join(RAILS_ROOT, 'test', '*', '*_test.rb')) + outdir = File.join(RAILS_ROOT, 'coverage') + test_loader = File.join(Config::CONFIG['rubylibdir'], 'rake', 'rake_test_loader.rb') + + system("rcov", '-o', outdir, '-T', '-x', 'rubygems/*,rcov*', '--rails', '-Ilib:test', test_loader, *tests) end end -- libgit2 0.21.2