1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/runner.rb
ko1 769715bda5 * test/profile_test_all.rb: refactoring memory profiling tool for
test-all.
  Add profiling targets /proc/meminfo and /proc/self/status.
* test/runner.rb: accept other than 'true'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-16 08:46:21 +00:00

35 lines
847 B
Ruby

require 'rbconfig'
require 'test/unit'
src_testdir = File.dirname(File.realpath(__FILE__))
$LOAD_PATH << src_testdir
module Gem
end
class Gem::TestCase < MiniTest::Unit::TestCase
@@project_dir = File.dirname($LOAD_PATH.last)
end
ENV["GEM_SKIP"] = ENV["GEM_HOME"] = ENV["GEM_PATH"] = "".freeze
require_relative 'profile_test_all' if ENV.has_key?('RUBY_TEST_ALL_PROFILE')
module Test::Unit
module ZombieHunter
def after_teardown
super
assert_empty(Process.waitall)
end
end
class TestCase
include ZombieHunter
end
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