From: Motohiro KOSAKI Date: 2011-11-11T13:13:00+09:00 Subject: [ruby-dev:44857] [ruby-trunk - Feature #5612] bootstraptestをCtrl-Cで止まるようにしたい Issue #5612 has been updated by Motohiro KOSAKI. バグってた。こうかな? diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb index df58ca5..eaed292 100755 --- a/bootstraptest/runner.rb +++ b/bootstraptest/runner.rb @@ -169,6 +169,8 @@ def show_progress(message = '') $stderr.puts if @verbose error faildesc, message end +rescue Interrupt + raise Interrupt rescue Exception => err $stderr.print 'E' $stderr.puts if @verbose @@ -342,6 +344,7 @@ def get_result_string(src, opt = '') begin `#{@ruby} -W0 #{opt} #{filename}` ensure + raise Interrupt if $?.signaled? && $?.termsig == Signal.list["INT"] raise CoreDumpError, "core dumped" if $? and $?.coredump? end else ---------------------------------------- Feature #5612: bootstraptestをCtrl-Cで止まるようにしたい http://redmine.ruby-lang.org/issues/5612 Author: Motohiro KOSAKI Status: Open Priority: Normal Assignee: Category: Target version: タイトルのとおりですが、make test が途中でやめたくなっても(テストを始めた所でバグに気づくとかよくありますよね?) Ctrl-Cが効かなくてイライラします。 ようするにSEGVを 'E' にするために、握りつぶしてる箇所に手を入れるだけな気がするので、 以下のパッチで十分なように思うのですがどうでしょうか diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb index df58ca5..a34b55c 100755 --- a/bootstraptest/runner.rb +++ b/bootstraptest/runner.rb @@ -169,6 +169,8 @@ def show_progress(message = '') $stderr.puts if @verbose error faildesc, message end +rescue Interrupt + raise Interrupt rescue Exception => err $stderr.print 'E' $stderr.puts if @verbose @@ -342,6 +344,7 @@ def get_result_string(src, opt = '') begin `#{@ruby} -W0 #{opt} #{filename}` ensure + raise Interrupt if $?.signaled? && $?.termsig == :INT raise CoreDumpError, "core dumped" if $? and $?.coredump? end else -- http://redmine.ruby-lang.org