##// END OF EJS Templates
scm: mercurial: add unit test for copied file (#7064)....
scm: mercurial: add unit test for copied file (#7064). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4636 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r4433:4695754d2a77
r4516:1bf33bb61959
Show More
testing.rake
68 lines | 2.3 KiB | text/x-ruby | RubyLexer
Eric Davis
Added rake tasks to generate rcov code coverage reports. rake -T test:coverage to see them all...
r1743 ### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake
Eric Davis
Codified instructions from RUNNING_TESTS as rake tasks for convenience...
r2258 namespace :test do
Jean-Philippe Lang
Add test:coverage task....
r2897 desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
rm_f "coverage.data"
Jean-Philippe Lang
Run all tests for coverage....
r2946 rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib --html"
files = Dir.glob("test/**/*_test.rb").join(" ")
system("#{rcov} #{files}")
Jean-Philippe Lang
Add test:coverage task....
r2897 system("open coverage/index.html") if PLATFORM['darwin']
end
Jean-Philippe Lang
Adds tasks to run scm tests: test:scm:units, test:scm:functionals and test:scm....
r4432 desc 'Run unit and functional scm tests'
task :scm do
errors = %w(test:scm:units test:scm:functionals).collect do |task|
begin
Rake::Task[task].invoke
nil
rescue => e
task
end
end.compact
abort "Errors running #{errors.to_sentence(:locale => :en)}!" if errors.any?
end
Eric Davis
Codified instructions from RUNNING_TESTS as rake tasks for convenience...
r2258 namespace :scm do
namespace :setup do
desc "Creates directory for test repositories"
task :create_dir do
FileUtils.mkdir_p Rails.root + '/tmp/test'
end
supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem]
desc "Creates a test subversion repository"
task :subversion => :create_dir do
repo_path = "tmp/test/subversion_repository"
system "svnadmin create #{repo_path}"
system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"
end
(supported_scms - [:subversion]).each do |scm|
desc "Creates a test #{scm} repository"
task scm => :create_dir do
system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test"
end
end
desc "Creates all test repositories"
task :all => supported_scms
end
Jean-Philippe Lang
Adds tasks to run scm tests: test:scm:units, test:scm:functionals and test:scm....
r4432
Rake::TestTask.new(:units => "db:test:prepare") do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb']
end
Rake::Task['test:scm:units'].comment = "Run the scm unit tests"
Rake::TestTask.new(:functionals => "db:test:prepare") do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/functional/repositories*_test.rb']
end
Jean-Philippe Lang
Fixes task description....
r4433 Rake::Task['test:scm:functionals'].comment = "Run the scm functional tests"
Eric Davis
Codified instructions from RUNNING_TESTS as rake tasks for convenience...
r2258 end
end