aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Hardy <packagethief@gmail.com>2009-08-27 14:04:08 -0400
committerJeremy Kemper <jeremy@bitsweat.net>2009-08-27 11:20:51 -0700
commitc10396b1426fcddea35d88fe865846b8aaab5de4 (patch)
tree58794ac054cd6ab916fc2860a51218a867e8347f
parentba5995dcd983498aea342fd06ccb6337f3bd15ab (diff)
downloadrails-c10396b1426fcddea35d88fe865846b8aaab5de4.tar.gz
rails-c10396b1426fcddea35d88fe865846b8aaab5de4.tar.bz2
rails-c10396b1426fcddea35d88fe865846b8aaab5de4.zip
When running multiple test tasks, don't abort early if one produces failures
[#3107 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
-rw-r--r--activerecord/Rakefile32
1 files changed, 26 insertions, 6 deletions
diff --git a/activerecord/Rakefile b/activerecord/Rakefile
index c4971e88b0..a9e4a92e37 100644
--- a/activerecord/Rakefile
+++ b/activerecord/Rakefile
@@ -24,17 +24,37 @@ PKG_FILES = FileList[
"lib/**/*", "test/**/*", "examples/**/*", "doc/**/*", "[A-Z]*", "install.rb", "Rakefile"
].exclude(/\bCVS\b|~$/)
+def run_without_aborting(*tasks)
+ errors = []
+
+ tasks.each do |task|
+ begin
+ Rake::Task[task].invoke
+ rescue Exception
+ errors << task
+ end
+ end
+
+ abort "Errors running #{errors.join(', ')}" if errors.any?
+end
desc 'Run mysql, sqlite, and postgresql tests by default'
task :default => :test
desc 'Run mysql, sqlite, and postgresql tests'
-task :test => defined?(JRUBY_VERSION) ?
- %w(test_jdbcmysql test_jdbcsqlite3 test_jdbcpostgresql) :
- %w(test_mysql test_sqlite3 test_postgresql)
-task :isolated_test => defined?(JRUBY_VERSION) ?
- %w(isolated_test_jdbcmysql isolated_test_jdbcsqlite3 isolated_test_jdbcpostgresql) :
- %w(isolated_test_mysql isolated_test_sqlite3 isolated_test_postgresql)
+task :test do
+ tasks = defined?(JRUBY_VERSION) ?
+ %w(test_jdbcmysql test_jdbcsqlite3 test_jdbcpostgresql) :
+ %w(test_mysql test_sqlite3 test_postgresql)
+ run_without_aborting(*tasks)
+end
+
+task :isolated_test do
+ tasks = defined?(JRUBY_VERSION) ?
+ %w(isolated_test_jdbcmysql isolated_test_jdbcsqlite3 isolated_test_jdbcpostgresql) :
+ %w(isolated_test_mysql isolated_test_sqlite3 isolated_test_postgresql)
+ run_without_aborting(*tasks)
+end
%w( mysql postgresql sqlite3 firebird db2 oracle sybase openbase frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb ).each do |adapter|
Rake::TestTask.new("test_#{adapter}") { |t|