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

ruby-changes:17626

From: nobu <ko1@a...>
Date: Sat, 30 Oct 2010 08:51:04 +0900 (JST)
Subject: [ruby-changes:17626] Ruby:r29634 (trunk): property.

nobu	2010-10-30 08:50:57 +0900 (Sat, 30 Oct 2010)

  New Revision: 29634

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

  Log:
    property.

  Modified files:
    trunk/test/profile_test_all.rb

Index: test/profile_test_all.rb
===================================================================
--- test/profile_test_all.rb	(revision 29633)
+++ test/profile_test_all.rb	(revision 29634)
@@ -1,52 +1,52 @@
-require 'objspace'
-
-#
-# purpose:
-#  Profile memory usage of each tests.
-#
-# usage:
-#   RUBY_TEST_ALL_PROFILE=true make test-all
-#
-# output:
-#   ./test_all_profile
-#
-# collected information:
-#   - ObjectSpace.memsize_of_all
-#   - GC.stat
-#   - /proc/self/statm (if it exists)
-#
-
-class MiniTest::Unit::TestCase
-  alias orig_run run
-
-  $test_all_profile_out = open('test_all_profile', 'w')
-  $test_all_profile_gc_stat_hash = {}
-
-  if FileTest.exist?('/proc/self/statm')
-    # for Linux (only?)
-    $test_all_profile_out.puts "name\tmemsize_of_all\t" +
-                                 (GC.stat.keys +
-                                  %w(size resident share text lib data dt)).join("\t")
-
-    def memprofile_test_all_result_result
-      "#{self.class}\##{self.__name__}\t" \
-      "#{ObjectSpace.memsize_of_all}\t" \
-      "#{GC.stat($test_all_profile_gc_stat_hash).values.join("\t")}\t" \
-      "#{File.read('/proc/self/statm').split(/\s+/).join("\t")}"
-    end
-  else
-    $test_all_profile_out.puts "name\tmemsize_of_alls\t" + GC.stat.keys.join("\t")
-    def memprofile_test_all_result_result
-      "#{self.class}\##{self.__name__}\t" \
-      "#{ObjectSpace.memsize_of_all}\t" \
-      "#{GC.stat($test_all_profile_gc_stat_hash).values.join("\t")}"
-    end
-  end
-
-  def run runner
-    result = orig_run(runner)
-    $test_all_profile_out.puts memprofile_test_all_result_result
-    $test_all_profile_out.flush
-    result
-  end
-end
+require 'objspace'
+
+#
+# purpose:
+#  Profile memory usage of each tests.
+#
+# usage:
+#   RUBY_TEST_ALL_PROFILE=true make test-all
+#
+# output:
+#   ./test_all_profile
+#
+# collected information:
+#   - ObjectSpace.memsize_of_all
+#   - GC.stat
+#   - /proc/self/statm (if it exists)
+#
+
+class MiniTest::Unit::TestCase
+  alias orig_run run
+
+  $test_all_profile_out = open('test_all_profile', 'w')
+  $test_all_profile_gc_stat_hash = {}
+
+  if FileTest.exist?('/proc/self/statm')
+    # for Linux (only?)
+    $test_all_profile_out.puts "name\tmemsize_of_all\t" +
+                                 (GC.stat.keys +
+                                  %w(size resident share text lib data dt)).join("\t")
+
+    def memprofile_test_all_result_result
+      "#{self.class}\##{self.__name__}\t" \
+      "#{ObjectSpace.memsize_of_all}\t" \
+      "#{GC.stat($test_all_profile_gc_stat_hash).values.join("\t")}\t" \
+      "#{File.read('/proc/self/statm').split(/\s+/).join("\t")}"
+    end
+  else
+    $test_all_profile_out.puts "name\tmemsize_of_alls\t" + GC.stat.keys.join("\t")
+    def memprofile_test_all_result_result
+      "#{self.class}\##{self.__name__}\t" \
+      "#{ObjectSpace.memsize_of_all}\t" \
+      "#{GC.stat($test_all_profile_gc_stat_hash).values.join("\t")}"
+    end
+  end
+
+  def run runner
+    result = orig_run(runner)
+    $test_all_profile_out.puts memprofile_test_all_result_result
+    $test_all_profile_out.flush
+    result
+  end
+end

Property changes on: test/profile_test_all.rb
___________________________________________________________________
Added: svn:eol-style
   + LF


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

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