diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-10 16:50:15 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-10 16:50:15 -0800 |
commit | bbb3e5a858b2d078b2af7516a583fa12f3edb565 (patch) | |
tree | 980814745eb39f4a771a50ee8b3c3947f8485c17 | |
parent | e02bff2634d94c07780884cae83b258d3f3a9a0e (diff) | |
download | rails-bbb3e5a858b2d078b2af7516a583fa12f3edb565.tar.gz rails-bbb3e5a858b2d078b2af7516a583fa12f3edb565.tar.bz2 rails-bbb3e5a858b2d078b2af7516a583fa12f3edb565.zip |
Unify test:isolated across components and run by default at toplevel
-rw-r--r-- | Rakefile | 4 | ||||
-rw-r--r-- | actionmailer/Rakefile | 12 | ||||
-rwxr-xr-x | activemodel/Rakefile | 12 | ||||
-rw-r--r-- | activerecord/Rakefile | 12 | ||||
-rw-r--r-- | activeresource/Rakefile | 15 | ||||
-rw-r--r-- | railties/Rakefile | 20 |
6 files changed, 42 insertions, 33 deletions
@@ -10,9 +10,9 @@ Dir["#{File.dirname(__FILE__)}/*/lib/*/version.rb"].each do |version_path| end desc 'Run all tests by default' -task :default => :test +task :default => %w(test test:isolated) -%w(test isolated_test rdoc pgem package release gem gemspec).each do |task_name| +%w(test test:isolated rdoc pgem package release gem gemspec).each do |task_name| desc "Run #{task_name} task for all projects" task task_name do errors = [] diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile index 140661ecb0..1a7ece5068 100644 --- a/actionmailer/Rakefile +++ b/actionmailer/Rakefile @@ -27,11 +27,13 @@ Rake::TestTask.new { |t| t.warning = true } -task :isolated_test do - ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) - Dir.glob("test/*_test.rb").all? do |file| - system(ruby, '-Ilib:test', file) - end or raise "Failures" +namespace :test do + task :isolated do + ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) + Dir.glob("test/*_test.rb").all? do |file| + system(ruby, '-Ilib:test', file) + end or raise "Failures" + end end # Generate the RDoc documentation diff --git a/activemodel/Rakefile b/activemodel/Rakefile index a63e1982b9..1f4a8466c9 100755 --- a/activemodel/Rakefile +++ b/activemodel/Rakefile @@ -19,11 +19,13 @@ Rake::TestTask.new do |t| t.warning = true end -task :isolated_test do - ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) - Dir.glob("#{dir}/test/**/*_test.rb").all? do |file| - system(ruby, '-w', "-I#{dir}/lib", "-I#{dir}/test", file) - end or raise "Failures" +namespace :test do + task :isolated do + ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) + Dir.glob("#{dir}/test/**/*_test.rb").all? do |file| + system(ruby, '-w', "-I#{dir}/lib", "-I#{dir}/test", file) + end or raise "Failures" + end end diff --git a/activerecord/Rakefile b/activerecord/Rakefile index f7585f789b..2511f13fed 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -49,11 +49,13 @@ task :test do 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) +namespace :test do + task :isolated 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 end %w( mysql postgresql sqlite3 firebird db2 oracle sybase openbase frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb ).each do |adapter| diff --git a/activeresource/Rakefile b/activeresource/Rakefile index 834d4c0c59..6566e84d4c 100644 --- a/activeresource/Rakefile +++ b/activeresource/Rakefile @@ -35,15 +35,16 @@ Rake::TestTask.new { |t| t.warning = true } -task :isolated_test do - ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) - activesupport_path = "#{File.dirname(__FILE__)}/../activesupport/lib" - Dir.glob("test/**/*_test.rb").all? do |file| - system(ruby, '-w', "-Ilib:test:#{activesupport_path}", file) - end or raise "Failures" +namespace :test do + task :isolated do + ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) + activesupport_path = "#{File.dirname(__FILE__)}/../activesupport/lib" + Dir.glob("test/**/*_test.rb").all? do |file| + system(ruby, '-w', "-Ilib:test:#{activesupport_path}", file) + end or raise "Failures" + end end - # Generate the RDoc documentation Rake::RDocTask.new { |rdoc| diff --git a/railties/Rakefile b/railties/Rakefile index 1280ad7f06..e6f698fc74 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -22,21 +22,23 @@ RUBY_FORGE_USER = "webster132" task :default => :test +task :test => 'test:isolated' ## This is required until the regular test task ## below passes. It's not ideal, but at least ## we can see the failures -task :test do - dir = ENV["TEST_DIR"] || "**" - Dir["test/#{dir}/*_test.rb"].all? do |file| - next true if file.include?("fixtures") - ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) - system(ruby, '-Itest', "-I#{File.dirname(__FILE__)}/../activesupport/lib", file) - end or raise "Failures" +namespace :test do + task :isolated do + dir = ENV["TEST_DIR"] || "**" + Dir["test/#{dir}/*_test.rb"].all? do |file| + next true if file.include?("fixtures") + ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) + system(ruby, '-Itest', "-I#{File.dirname(__FILE__)}/../activesupport/lib", file) + end or raise "Failures" + end end -task :isolated_test => :test -Rake::TestTask.new("regular_test") do |t| +Rake::TestTask.new('test:regular') do |t| t.libs << 'test' << "#{File.dirname(__FILE__)}/../activesupport/lib" t.pattern = 'test/**/*_test.rb' t.warning = true |