diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-10-02 16:02:00 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-10-02 16:23:00 +0900 |
commit | 84cbce3d880f0d6a51ccf3622b8d1e79132b9a0e (patch) | |
tree | dea59cf2be73dd88c7fe14f2a6d7346a650c5e40 | |
parent | 99d3043bd8e7705cb5ec1772080667981bd07a36 (diff) | |
download | ruby-84cbce3d880f0d6a51ccf3622b8d1e79132b9a0e.tar.gz |
Enable checkers on parallel test.
parallel test (`make test-all TESTS=-j8`) runs tests on specified
number of processes. However, some test checkers written in
`runner.rb` are not loaded. This fix enable these checkers on
parallel tests.
See also: https://github.com/ruby/ruby/pull/2508
-rw-r--r-- | tool/lib/iseq_loader_checker.rb | 6 | ||||
-rw-r--r-- | tool/lib/test/unit/parallel.rb | 5 | ||||
-rw-r--r-- | tool/test/runner.rb | 8 |
3 files changed, 14 insertions, 5 deletions
diff --git a/tool/lib/iseq_loader_checker.rb b/tool/lib/iseq_loader_checker.rb index e7cfc79521..3f07b3a999 100644 --- a/tool/lib/iseq_loader_checker.rb +++ b/tool/lib/iseq_loader_checker.rb @@ -39,7 +39,11 @@ class RubyVM::InstructionSequence end opt = ENV['RUBY_ISEQ_DUMP_DEBUG'] - puts "RUBY_ISEQ_DUMP_DEBUG = #{opt}" if opt + + if opt && caller.any?{|e| /test\/runner\.rb/ =~ e} + puts "RUBY_ISEQ_DUMP_DEBUG = #{opt}" if opt + end + CHECK_TO_A = 'to_a' == opt CHECK_TO_BINARY = 'to_binary' == opt diff --git a/tool/lib/test/unit/parallel.rb b/tool/lib/test/unit/parallel.rb index 730d7a7f3d..12600676db 100644 --- a/tool/lib/test/unit/parallel.rb +++ b/tool/lib/test/unit/parallel.rb @@ -2,6 +2,11 @@ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../.." require 'test/unit' +require "profile_test_all" if ENV.key?('RUBY_TEST_ALL_PROFILE') +require "tracepointchecker" +require "zombie_hunter" +require "iseq_loader_checker" + module Test module Unit class Worker < Runner # :nodoc: diff --git a/tool/test/runner.rb b/tool/test/runner.rb index 1ee4fdf8c6..708d654935 100644 --- a/tool/test/runner.rb +++ b/tool/test/runner.rb @@ -5,10 +5,10 @@ $LOAD_PATH.unshift File.expand_path("../lib", __dir__) require 'test/unit' -require_relative "../lib/profile_test_all" if ENV.key?('RUBY_TEST_ALL_PROFILE') -require_relative "../lib/tracepointchecker" -require_relative "../lib/zombie_hunter" -require_relative "../lib/iseq_loader_checker" +require "profile_test_all" if ENV.key?('RUBY_TEST_ALL_PROFILE') +require "tracepointchecker" +require "zombie_hunter" +require "iseq_loader_checker" require_relative "../test-coverage.rb" if ENV.key?('COVERAGE') case $0 |