##// END OF EJS Templates
Run all tests for coverage....
Jean-Philippe Lang -
r2946:ded602c89f31
parent child
Show More
@@ -1,42 +1,41
1 1 ### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake
2 2
3 3 namespace :test do
4 4 desc 'Measures test coverage'
5 5 task :coverage do
6 6 rm_f "coverage"
7 7 rm_f "coverage.data"
8 rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib"
9 system("#{rcov} --no-html test/unit/*_test.rb")
10 system("#{rcov} --no-html test/functional/*_test.rb")
11 system("#{rcov} --html test/integration/*_test.rb")
8 rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib --html"
9 files = Dir.glob("test/**/*_test.rb").join(" ")
10 system("#{rcov} #{files}")
12 11 system("open coverage/index.html") if PLATFORM['darwin']
13 12 end
14 13
15 14 namespace :scm do
16 15 namespace :setup do
17 16 desc "Creates directory for test repositories"
18 17 task :create_dir do
19 18 FileUtils.mkdir_p Rails.root + '/tmp/test'
20 19 end
21 20
22 21 supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem]
23 22
24 23 desc "Creates a test subversion repository"
25 24 task :subversion => :create_dir do
26 25 repo_path = "tmp/test/subversion_repository"
27 26 system "svnadmin create #{repo_path}"
28 27 system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"
29 28 end
30 29
31 30 (supported_scms - [:subversion]).each do |scm|
32 31 desc "Creates a test #{scm} repository"
33 32 task scm => :create_dir do
34 33 system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test"
35 34 end
36 35 end
37 36
38 37 desc "Creates all test repositories"
39 38 task :all => supported_scms
40 39 end
41 40 end
42 41 end
General Comments 0
You need to be logged in to leave comments. Login now