summaryrefslogtreecommitdiffstats
path: root/lib/tasks/testing.rake
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-01-12 04:44:01 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-01-12 04:44:01 +0000
commit17d455c72f4d1e4bfab90e8654fe9db120734578 (patch)
tree5c49f838e559bc75c801244cb21088e8d9fc8247 /lib/tasks/testing.rake
parent38b2c5a31784469d62a58622531f2ca8d791e023 (diff)
downloadredmine-17d455c72f4d1e4bfab90e8654fe9db120734578.tar.gz
redmine-17d455c72f4d1e4bfab90e8654fe9db120734578.zip
Codified instructions from RUNNING_TESTS as rake tasks for convenience
Rake tasks are in testing.rake and can be run by `rake test:scm:setup:<scm>` Updated RUNNING_TESTS Contributed by Gerrit Kaiser git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2260 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks/testing.rake')
-rw-r--r--lib/tasks/testing.rake30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake
index 42f756f68..da832b3e7 100644
--- a/lib/tasks/testing.rake
+++ b/lib/tasks/testing.rake
@@ -1,5 +1,35 @@
### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake
+namespace :test do
+ 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
+ end
+end
+
### Inspired by http://blog.labratz.net/articles/2006/12/2/a-rake-task-for-rcov
begin
require 'rcov/rcovtask'