mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/profile_test_all.rb: add `failed?' information.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7f9f6c3122
commit
e4f51f80d0
2 changed files with 16 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Aug 19 17:41:49 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* test/profile_test_all.rb: add `failed?' information.
|
||||
|
||||
Mon Aug 19 17:00:53 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* process.c (retry_fork): retry with GC if ENOMEM occurred, to free
|
||||
|
|
|
@ -34,8 +34,15 @@ class MiniTest::Unit::TestCase
|
|||
TEST_ALL_PROFILE_PROCS << b
|
||||
end
|
||||
|
||||
add 'memsize_of_all', *GC.stat.keys do |result|
|
||||
add 'failed?' do |result, tc|
|
||||
result << (tc.passed? ? 0 : 1)
|
||||
end
|
||||
|
||||
add 'memsize_of_all' do |result, *|
|
||||
result << ObjectSpace.memsize_of_all
|
||||
end
|
||||
|
||||
add *GC.stat.keys do |result, *|
|
||||
GC.stat(TEST_ALL_PROFILE_GC_STAT_HASH)
|
||||
result.concat TEST_ALL_PROFILE_GC_STAT_HASH.values
|
||||
end
|
||||
|
@ -44,9 +51,9 @@ class MiniTest::Unit::TestCase
|
|||
return unless FileTest.exist?(file)
|
||||
regexp = /(#{fields.join("|")}):\s*(\d+) kB/
|
||||
# check = {}; fields.each{|e| check[e] = true}
|
||||
add *fields do |result|
|
||||
add *fields do |result, *|
|
||||
text = File.read(file)
|
||||
text.gsub(regexp){
|
||||
text.scan(regexp){
|
||||
# check.delete $1
|
||||
result << $2
|
||||
''
|
||||
|
@ -59,7 +66,7 @@ class MiniTest::Unit::TestCase
|
|||
add_proc_meminfo '/proc/self/status', %w(VmPeak VmSize VmHWM VmRSS)
|
||||
|
||||
if FileTest.exist?('/proc/self/statm')
|
||||
add *%w(size resident share text lib data dt) do |result|
|
||||
add *%w(size resident share text lib data dt) do |result, *|
|
||||
result.concat File.read('/proc/self/statm').split(/\s+/)
|
||||
end
|
||||
end
|
||||
|
@ -67,7 +74,7 @@ class MiniTest::Unit::TestCase
|
|||
def memprofile_test_all_result_result
|
||||
result = ["#{self.class}\##{self.__name__.to_s.gsub(/\s+/, '')}"]
|
||||
TEST_ALL_PROFILE_PROCS.each{|proc|
|
||||
proc.call(result)
|
||||
proc.call(result, self)
|
||||
}
|
||||
result.join("\t")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue