mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merges r29280 from trunk into ruby_1_9_2 and adds a minimal regression
test. -- * lib/tracer.rb: count only non-internal libraries in stack trace, ignoring custom_require. [ruby-core:31858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1c1c514a67
commit
c53b4f562b
4 changed files with 27 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Sep 17 08:30:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/tracer.rb: count only non-internal libraries in stack trace,
|
||||
ignoring custom_require. [ruby-core:31858]
|
||||
|
||||
Thu Sep 16 08:30:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* sprintf.c (rb_f_sprintf): fix rdoc. pointed out by Tomoyuki
|
||||
|
|
|
@ -190,6 +190,6 @@ if $0 == __FILE__
|
|||
ARGV.shift
|
||||
Tracer.on
|
||||
require $0
|
||||
elsif caller.size <= 1
|
||||
elsif caller.count {|bt| /\A<internal:[^<>]+>:/ !~ bt} <= 1
|
||||
Tracer.on
|
||||
end
|
||||
|
|
20
test/test_tracer.rb
Normal file
20
test/test_tracer.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
require 'test/unit'
|
||||
require_relative 'ruby/envutil'
|
||||
|
||||
class TestTracer < Test::Unit::TestCase
|
||||
include EnvUtil
|
||||
|
||||
def test_work_with_e
|
||||
assert_in_out_err(%w[-rtracer -e 1]) do |(*lines),|
|
||||
case lines.size
|
||||
when 2
|
||||
assert_match %r[#0:<internal:lib/rubygems/custom_require>:\d+:Kernel:<: -], lines[0]
|
||||
when 1
|
||||
# do nothing
|
||||
else
|
||||
flunk 'unexpected output from `ruby -rtracer -e 1`'
|
||||
end
|
||||
assert_equal "#0:-e:1::-: 1", lines[1]
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
#define RUBY_VERSION "1.9.2"
|
||||
#define RUBY_PATCHLEVEL 46
|
||||
#define RUBY_PATCHLEVEL 47
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
#define RUBY_VERSION_MINOR 9
|
||||
#define RUBY_VERSION_TEENY 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue