mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) r45891,r45893,r45895:
test_beginendblock.rb, test_signal.rb: run with default handler * test/ruby/test_beginendblock.rb (test_propagate_signaled): run with default handler. * test/ruby/test_signal.rb (test_hup_me): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
65b76d92a4
commit
4b1eca7ea0
4 changed files with 10 additions and 4 deletions
|
@ -112,6 +112,7 @@ EOW
|
||||||
ruby = EnvUtil.rubybin
|
ruby = EnvUtil.rubybin
|
||||||
out = IO.popen(
|
out = IO.popen(
|
||||||
[ruby,
|
[ruby,
|
||||||
|
'-e', 'trap(:INT, "DEFAULT")',
|
||||||
'-e', 'STDERR.reopen(STDOUT)',
|
'-e', 'STDERR.reopen(STDOUT)',
|
||||||
'-e', 'at_exit{Process.kill(:INT, $$); sleep 5 }']) {|f|
|
'-e', 'at_exit{Process.kill(:INT, $$); sleep 5 }']) {|f|
|
||||||
timeout(10) {
|
timeout(10) {
|
||||||
|
|
|
@ -255,9 +255,12 @@ EOS
|
||||||
# that signal will be deliverd synchronously.
|
# that signal will be deliverd synchronously.
|
||||||
# This ugly workaround was introduced to don't break
|
# This ugly workaround was introduced to don't break
|
||||||
# compatibility against silly example codes.
|
# compatibility against silly example codes.
|
||||||
|
assert_separately([], <<-RUBY)
|
||||||
|
trap(:HUP, "DEFAULT")
|
||||||
assert_raise(SignalException) {
|
assert_raise(SignalException) {
|
||||||
Process.kill('HUP', Process.pid)
|
Process.kill('HUP', Process.pid)
|
||||||
}
|
}
|
||||||
|
RUBY
|
||||||
bug8137 = '[ruby-dev:47182] [Bug #8137]'
|
bug8137 = '[ruby-dev:47182] [Bug #8137]'
|
||||||
assert_nothing_raised(bug8137) {
|
assert_nothing_raised(bug8137) {
|
||||||
Timeout.timeout(1) {
|
Timeout.timeout(1) {
|
||||||
|
|
|
@ -726,7 +726,7 @@ _eom
|
||||||
bug5757 = '[ruby-dev:44985]'
|
bug5757 = '[ruby-dev:44985]'
|
||||||
t0 = Time.now.to_f
|
t0 = Time.now.to_f
|
||||||
pid = nil
|
pid = nil
|
||||||
cmd = 'r,=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; r.read'
|
cmd = 'Signal.trap(:INT, "DEFAULT"); r,=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; r.read'
|
||||||
opt = {}
|
opt = {}
|
||||||
opt[:new_pgroup] = true if /mswin|mingw/ =~ RUBY_PLATFORM
|
opt[:new_pgroup] = true if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
s, _err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true, opt) do |in_p, out_p, err_p, cpid|
|
s, _err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true, opt) do |in_p, out_p, err_p, cpid|
|
||||||
|
@ -746,6 +746,7 @@ _eom
|
||||||
|
|
||||||
def test_thread_join_in_trap
|
def test_thread_join_in_trap
|
||||||
assert_separately [], <<-'EOS'
|
assert_separately [], <<-'EOS'
|
||||||
|
Signal.trap(:INT, "DEFAULT")
|
||||||
t0 = Thread.current
|
t0 = Thread.current
|
||||||
assert_nothing_raised{
|
assert_nothing_raised{
|
||||||
t = Thread.new {Thread.pass until t0.stop?; Process.kill(:INT, $$)}
|
t = Thread.new {Thread.pass until t0.stop?; Process.kill(:INT, $$)}
|
||||||
|
@ -761,6 +762,7 @@ _eom
|
||||||
|
|
||||||
def test_thread_value_in_trap
|
def test_thread_value_in_trap
|
||||||
assert_separately [], <<-'EOS'
|
assert_separately [], <<-'EOS'
|
||||||
|
Signal.trap(:INT, "DEFAULT")
|
||||||
t0 = Thread.current
|
t0 = Thread.current
|
||||||
t = Thread.new {Thread.pass until t0.stop?; Process.kill(:INT, $$); :normal_end}
|
t = Thread.new {Thread.pass until t0.stop?; Process.kill(:INT, $$); :normal_end}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#define RUBY_VERSION "2.1.2"
|
#define RUBY_VERSION "2.1.2"
|
||||||
#define RUBY_RELEASE_DATE "2014-05-08"
|
#define RUBY_RELEASE_DATE "2014-05-10"
|
||||||
#define RUBY_PATCHLEVEL 95
|
#define RUBY_PATCHLEVEL 96
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2014
|
#define RUBY_RELEASE_YEAR 2014
|
||||||
#define RUBY_RELEASE_MONTH 5
|
#define RUBY_RELEASE_MONTH 5
|
||||||
#define RUBY_RELEASE_DAY 8
|
#define RUBY_RELEASE_DAY 10
|
||||||
|
|
||||||
#include "ruby/version.h"
|
#include "ruby/version.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue