aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/Rakefile
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-13 01:06:53 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-13 11:43:03 -0700
commitfa5da8ad54d68ea0484825845eb6f6a8e8bca361 (patch)
tree3542a3bad41218803a29da6ee0741b3a5a3acc45 /activerecord/Rakefile
parenta7ccc7c79fa69cea3b7d19bcaa4df3c2932238d8 (diff)
downloadrails-fa5da8ad54d68ea0484825845eb6f6a8e8bca361.tar.gz
rails-fa5da8ad54d68ea0484825845eb6f6a8e8bca361.tar.bz2
rails-fa5da8ad54d68ea0484825845eb6f6a8e8bca361.zip
isolated_test task
Diffstat (limited to 'activerecord/Rakefile')
-rw-r--r--activerecord/Rakefile20
1 files changed, 14 insertions, 6 deletions
diff --git a/activerecord/Rakefile b/activerecord/Rakefile
index 5905c67e29..892d52f30d 100644
--- a/activerecord/Rakefile
+++ b/activerecord/Rakefile
@@ -33,20 +33,28 @@ task :test => defined?(JRUBY_VERSION) ?
%w(test_jdbcmysql test_jdbcsqlite3 test_jdbcpostgresql) :
%w(test_mysql test_sqlite3 test_postgresql)
-for adapter in %w( mysql postgresql sqlite sqlite3 firebird db2 oracle sybase openbase frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb )
+%w( mysql postgresql sqlite sqlite3 firebird db2 oracle sybase openbase frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb ).each do |adapter|
Rake::TestTask.new("test_#{adapter}") { |t|
- if adapter =~ /jdbc/
- t.libs << "test" << "test/connections/jdbc_#{adapter}"
- else
- t.libs << "test" << "test/connections/native_#{adapter}"
- end
+ connection_path = "test/connections/#{adapter =~ /jdbc/ ? 'jdbc' : 'native'}_#{adapter}"
adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z]+/]
+ t.libs << "test" << connection_path
t.test_files=Dir.glob( "test/cases/**/*_test{,_#{adapter_short}}.rb" ).sort
t.verbose = true
}
+ task "isolated_test_#{adapter}" do
+ connection_path = "test/connections/#{adapter =~ /jdbc/ ? 'jdbc' : 'native'}_#{adapter}"
+ adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z]+/]
+ puts [adapter, adapter_short, connection_path].inspect
+ ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
+ Dir["test/cases/**/*_test{,_#{adapter_short}}.rb"].all? do |file|
+ system(ruby, "-Ilib:test:#{connection_path}", file)
+ end or raise "Failures"
+ end
+
namespace adapter do
task :test => "test_#{adapter}"
+ task :isolated_test => "isolated_test_#{adapter}"
end
end