Permalink
Browse files

Fixed rake process exit status. Fixes #1687.

  • Loading branch information...
1 parent a483984 commit d67545bc6382a4eff59b099257a94f0bd77636fa @brixen brixen committed with Michal Bugno May 2, 2012
Showing with 18 additions and 7 deletions.
  1. +18 −7 Rakefile
View
25 Rakefile
@@ -89,10 +89,23 @@ $dlext = RbConfig::CONFIG["DLEXT"]
$CC = ENV['CC']
class SpecRunner
- attr_reader :exit_status
+
+ @at_exit_handler_set = false
+ @at_exit_status = 0
+
+ def self.set_at_exit_handler
+ return if @at_exit_handler_set
+
+ at_exit { exit @at_exit_status }
+ @at_exit_handler_set = true
+ end
+
+ def self.set_at_exit_status(status)
+ @at_exit_status = status
+ end
def initialize
- @exit_status = 0
+ self.class.set_at_exit_handler
unless File.directory? BUILD_CONFIG[:runtime]
# Setting these enables the specs to run when rbx has been configured
@@ -105,7 +118,7 @@ class SpecRunner
ENV.delete("RUBYOPT")
@handler = lambda do |ok, status|
- @exit_status = status.exitstatus unless ok
+ self.class.set_at_exit_status(status.exitstatus) unless ok
end
end
@@ -114,10 +127,6 @@ class SpecRunner
end
end
-spec_runner = SpecRunner.new
-
-at_exit { exit spec_runner.exit_status }
-
task :default => :spec
task :github do
@@ -217,6 +226,8 @@ task :docs do
Rubinius::Documentation.main
end
+spec_runner = SpecRunner.new
+
desc "Run the CI specs in 1.8 mode but do not rebuild on failure"
task :spec18 => %w[build vm:test] do
spec_runner.run "-T -X18"

0 comments on commit d67545b

Please sign in to comment.