summaryrefslogtreecommitdiff
path: root/test/profile_test_all.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-19 08:43:13 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-19 08:43:13 +0000
commite4f51f80d08a34318ae9f10d0d8591faaf786f9d (patch)
tree40b5d9a333688bcfa2a4e0697e21b90dfbd2cf95 /test/profile_test_all.rb
parent7f9f6c3122ecf320af00e3602619c404d9772046 (diff)
* 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
Diffstat (limited to 'test/profile_test_all.rb')
-rw-r--r--test/profile_test_all.rb17
1 files changed, 12 insertions, 5 deletions
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