[前][次][番号順一覧][スレッド一覧]

ruby-changes:30540

From: ko1 <ko1@a...>
Date: Mon, 19 Aug 2013 17:43:34 +0900 (JST)
Subject: [ruby-changes:30540] ko1:r42619 (trunk): * test/profile_test_all.rb: add `failed?' information.

ko1	2013-08-19 17:43:13 +0900 (Mon, 19 Aug 2013)

  New Revision: 42619

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42619

  Log:
    * test/profile_test_all.rb: add `failed?' information.

  Modified files:
    trunk/ChangeLog
    trunk/test/profile_test_all.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42618)
+++ ChangeLog	(revision 42619)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Aug 19 17:41:49 2013  Koichi Sasada  <ko1@a...>
+
+	* test/profile_test_all.rb: add `failed?' information.
+
 Mon Aug 19 17:00:53 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* process.c (retry_fork): retry with GC if ENOMEM occurred, to free
Index: test/profile_test_all.rb
===================================================================
--- test/profile_test_all.rb	(revision 42618)
+++ test/profile_test_all.rb	(revision 42619)
@@ -34,8 +34,15 @@ class MiniTest::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/profile_test_all.rb#L34
     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 https://github.com/ruby/ruby/blob/trunk/test/profile_test_all.rb#L51
     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 https://github.com/ruby/ruby/blob/trunk/test/profile_test_all.rb#L66
   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 https://github.com/ruby/ruby/blob/trunk/test/profile_test_all.rb#L74
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]