Skip to content

Commit

Permalink
Moved NoMemoryError hook to Test::Unit::AutoRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jul 24, 2019
1 parent 82ae462 commit a850be6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 4 additions & 0 deletions tool/lib/test/unit.rb
Expand Up @@ -1135,6 +1135,10 @@ def run
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)
Expand Down
8 changes: 1 addition & 7 deletions tool/test/runner.rb
Expand Up @@ -35,10 +35,4 @@
require_relative "#{tool_dir}/test-coverage.rb"
end

begin
exit Test::Unit::AutoRunner.run(true, src_testdir)
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
exit Test::Unit::AutoRunner.run(true, src_testdir)

0 comments on commit a850be6

Please sign in to comment.