1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

runner.rb: use class variable

* test/runner.rb (after_teardown): turn zombie traces hash into a
  class variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-06-14 23:13:50 +00:00
parent 045b6e9fb9
commit dcae4b9d42

View file

@ -19,15 +19,16 @@ require_relative 'profile_test_all' if ENV.has_key?('RUBY_TEST_ALL_PROFILE')
module Test::Unit
module ZombieHunter
@@zombie_traces = Hash.new(0)
def after_teardown
super
assert_empty(Process.waitall)
# detect zombie traces.
zombie_traces = Hash.new(0)
TracePoint.stat.each{|key, (activated, deleted)|
old, zombie_traces[key] = zombie_traces[key], activated
assert_equal(old, activated, "The number of active trace events (#{key}) should not increase.")
old, @@zombie_traces[key] = @@zombie_traces[key], activated
assert_equal(old, activated, "The number of active trace events (#{key}) should not increase")
# puts "TracePoint - deleted: #{deleted}" if deleted > 0
}
end