From 5a3c024df0a83d1f64f10f028f1082e67f88c013 Mon Sep 17 00:00:00 2001 From: eregon Date: Tue, 12 Dec 2017 18:43:42 +0000 Subject: Set Thread.report_on_exception=true by default to report exceptions in Threads * [Feature #14143] [ruby-core:83979] * vm.c (vm_init2): Set Thread.report_on_exception to true. * thread.c (thread_start_func_2): Add indication the message is caused by report_on_exception = true. * spec/ruby: Specify the new behavior. * test/ruby/test_thread.rb: Adapt and improve tests for Thread.report_on_exception and Thread#report_on_exception. * test/ruby/test_thread.rb, test/ruby/test_exception.rb: Unset report_on_exception for tests expecting no extra output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/core/thread/report_on_exception_spec.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/ruby/core/thread/report_on_exception_spec.rb b/spec/ruby/core/thread/report_on_exception_spec.rb index 4128dad470..74b7984a32 100644 --- a/spec/ruby/core/thread/report_on_exception_spec.rb +++ b/spec/ruby/core/thread/report_on_exception_spec.rb @@ -2,8 +2,16 @@ require File.expand_path('../../../spec_helper', __FILE__) ruby_version_is "2.4" do describe "Thread.report_on_exception" do - it "defaults to false" do - ruby_exe("p Thread.report_on_exception").should == "false\n" + ruby_version_is "2.4"..."2.5" do + it "defaults to false" do + ruby_exe("p Thread.report_on_exception").should == "false\n" + end + end + + ruby_version_is "2.5" do + it "defaults to true" do + ruby_exe("p Thread.report_on_exception").should == "true\n" + end end end -- cgit v1.2.3