1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Moved NoMemoryError hook to Test::Unit::AutoRunner

This commit is contained in:
Nobuyoshi Nakada 2019-07-24 11:04:26 +09:00
parent 82ae462113
commit a850be68a5
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 5 additions and 7 deletions

View file

@ -1135,6 +1135,10 @@ module Test
abort @options.banner abort @options.banner
end end
@runner.run(@argv) || true @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 end
def self.run(*args) def self.run(*args)

View file

@ -35,10 +35,4 @@ if ENV['COVERAGE']
require_relative "#{tool_dir}/test-coverage.rb" require_relative "#{tool_dir}/test-coverage.rb"
end end
begin exit Test::Unit::AutoRunner.run(true, src_testdir)
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