summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-25 14:29:15 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-25 16:57:37 +0900
commitf5ea05481017d34a1ebdc0eec32ef10254420ee5 (patch)
treef891f5fc5ea6b20fdea1ba8af39999d887007fbe /tool
parentd8e90f555817146d17ec82a55360b6d69c649d67 (diff)
Moved NoMemoryError hook
Moved NoMemoryError hook from AutoRunner.run to Runner#run, so it will work even in non-autorunning mode.
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/test/unit.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 146d6bb3c7..9cded97a33 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -1072,6 +1072,14 @@ module Test
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
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)