diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-02-07 10:40:07 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-10 10:34:35 -0800 |
commit | 92acd5d0e7ea25cc829599c6d0d141d39933e59a (patch) | |
tree | 415cc23313aebb34fac1f1279d41527a3882ff04 /railties/lib/rails/test_unit/testing.rake | |
parent | 73fcbaaa788f781a15d1fe7f8fae2e4b53c799fa (diff) | |
download | rails-92acd5d0e7ea25cc829599c6d0d141d39933e59a.tar.gz rails-92acd5d0e7ea25cc829599c6d0d141d39933e59a.tar.bz2 rails-92acd5d0e7ea25cc829599c6d0d141d39933e59a.zip |
Fix that failed tests should exit with a nonzero error code.
Partially reverts 14c89e7285d4e7cd40a542fbc31d9345f60c3aa4.
Hat tip to @tenderlove for paring down the TestTask!
Diffstat (limited to 'railties/lib/rails/test_unit/testing.rake')
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index a23d22d607..290005993a 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -55,7 +55,21 @@ namespace :test do # Placeholder task for other Railtie and plugins to enhance. See Active Record for an example. end - task :run => %w(test:units test:functionals test:integration) + task :run do + errors = %w(test:units test:functionals test:integration).collect do |task| + begin + Rake::Task[task].invoke + nil + rescue => e + { :task => task, :exception => e } + end + end.compact + + if errors.any? + puts errors.map { |e| "Errors running #{e[:task]}! #{e[:exception].inspect}" }.join("\n") + abort + end + end Rake::TestTask.new(:recent => "test:prepare") do |t| since = TEST_CHANGES_SINCE |