From e4f51f80d08a34318ae9f10d0d8591faaf786f9d Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 19 Aug 2013 08:43:13 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ test/profile_test_all.rb | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71412156d3..7a2828820a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 19 17:41:49 2013 Koichi Sasada + + * test/profile_test_all.rb: add `failed?' information. + Mon Aug 19 17:00:53 2013 Nobuyoshi Nakada * process.c (retry_fork): retry with GC if ENOMEM occurred, to free diff --git a/test/profile_test_all.rb b/test/profile_test_all.rb index 005a5731c4..08de7bb129 100644 --- a/test/profile_test_all.rb +++ b/test/profile_test_all.rb @@ -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