2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2004-11-20 08:58:20 -05:00
|
|
|
require 'rbconfig'
|
2008-10-15 00:16:28 -04:00
|
|
|
|
2012-06-08 03:19:38 -04:00
|
|
|
src_testdir = File.dirname(File.realpath(__FILE__))
|
2011-03-09 17:32:29 -05:00
|
|
|
$LOAD_PATH << src_testdir
|
2019-06-29 06:43:47 -04:00
|
|
|
tool_dir = File.join src_testdir, "..", "tool"
|
|
|
|
$LOAD_PATH.unshift "#{tool_dir}/lib"
|
2014-05-17 02:26:51 -04:00
|
|
|
|
2015-04-04 08:31:31 -04:00
|
|
|
# Get bundled gems on load path
|
|
|
|
Dir.glob("#{src_testdir}/../gems/*/*.gemspec")
|
|
|
|
.reject {|f| f =~ /minitest|test-unit|power_assert/ }
|
|
|
|
.map {|f| $LOAD_PATH.unshift File.join(File.dirname(f), "lib") }
|
|
|
|
|
2014-05-17 02:26:51 -04:00
|
|
|
require 'test/unit'
|
|
|
|
|
2011-07-08 19:39:42 -04:00
|
|
|
module Gem
|
|
|
|
end
|
2011-03-21 21:59:18 -04:00
|
|
|
class Gem::TestCase < MiniTest::Unit::TestCase
|
|
|
|
@@project_dir = File.dirname($LOAD_PATH.last)
|
|
|
|
end
|
2008-10-19 11:59:35 -04:00
|
|
|
|
2012-11-30 19:34:01 -05:00
|
|
|
ENV["GEM_SKIP"] = ENV["GEM_HOME"] = ENV["GEM_PATH"] = "".freeze
|
2012-07-11 23:32:28 -04:00
|
|
|
|
2019-06-29 06:43:47 -04:00
|
|
|
require_relative "#{tool_dir}/lib/profile_test_all" if ENV.has_key?('RUBY_TEST_ALL_PROFILE')
|
|
|
|
require_relative "#{tool_dir}/lib/tracepointchecker"
|
|
|
|
require_relative "#{tool_dir}/lib/zombie_hunter"
|
|
|
|
require_relative "#{tool_dir}/lib/iseq_loader_checker"
|
2013-06-19 03:47:07 -04:00
|
|
|
|
2014-09-02 03:59:18 -04:00
|
|
|
if ENV['COVERAGE']
|
2019-07-01 19:00:29 -04:00
|
|
|
require_relative "#{tool_dir}/test-coverage.rb"
|
2014-09-02 03:59:18 -04:00
|
|
|
end
|
|
|
|
|
2013-07-30 02:52:48 -04:00
|
|
|
begin
|
|
|
|
exit Test::Unit::AutoRunner.run(true, src_testdir)
|
2013-07-30 08:30:30 -04:00
|
|
|
rescue NoMemoryError
|
2013-07-31 03:07:03 -04:00
|
|
|
system("cat /proc/meminfo") if File.exist?("/proc/meminfo")
|
2013-08-01 13:11:27 -04:00
|
|
|
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")
|
2013-07-30 02:52:48 -04:00
|
|
|
raise
|
|
|
|
end
|