]> source.dussan.org Git - redmine.git/commitdiff
Adds tasks to run scm tests: test:scm:units, test:scm:functionals and test:scm.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 20 Dec 2010 18:24:24 +0000 (18:24 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 20 Dec 2010 18:24:24 +0000 (18:24 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4546 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/tasks/testing.rake

index 2028bd15af89e9979439286e48351e05b33cd98e..f4693c00842806cb45beb57e884841e7b76475ff 100644 (file)
@@ -11,6 +11,19 @@ namespace :test do
     system("open coverage/index.html") if PLATFORM['darwin']
   end
 
+  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
+
   namespace :scm do
     namespace :setup do
       desc "Creates directory for test repositories"
@@ -37,5 +50,19 @@ namespace :test do
       desc "Creates all test repositories"
       task :all => supported_scms
     end
+    
+    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
+    Rake::Task['test:scm:functionals'].comment = "Run the scm unit tests"
   end
 end