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

ruby-changes:56658

From: Nobuyoshi <ko1@a...>
Date: Thu, 25 Jul 2019 17:01:05 +0900 (JST)
Subject: [ruby-changes:56658] Nobuyoshi Nakada: f5ea054810 (master): Moved NoMemoryError hook

https://git.ruby-lang.org/ruby.git/commit/?id=f5ea054810

From f5ea05481017d34a1ebdc0eec32ef10254420ee5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 25 Jul 2019 14:29:15 +0900
Subject: Moved NoMemoryError hook

Moved NoMemoryError hook from AutoRunner.run to Runner#run, so
it will work even in non-autorunning mode.

diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 146d6bb..9cded97 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -1072,6 +1072,14 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L1072
       include Test::Unit::TimeoutOption
       include Test::Unit::RunCount
 
+      def run(argv)
+        super
+      rescue NoMemoryError
+        system("cat /proc/meminfo") if File.exist?("/proc/meminfo")
+        system("ps x -opid,args,%cpu,%mem,nlwp,rss,vsz,wchan,stat,start,time,etime,blocked,caught,ignored,pending,f") if File.exist?("/bin/ps")
+        raise
+      end
+
       class << self; undef autorun; end
 
       @@stop_auto_run = false
@@ -1135,10 +1143,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L1143
           abort @options.banner
         end
         @runner.run(@argv) || true
-      rescue NoMemoryError
-        system("cat /proc/meminfo") if File.exist?("/proc/meminfo")
-        system("ps x -opid,args,%cpu,%mem,nlwp,rss,vsz,wchan,stat,start,time,etime,blocked,caught,ignored,pending,f") if File.exist?("/bin/ps")
-        raise
       end
 
       def self.run(*args)
-- 
cgit v0.10.2


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

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