ruby-changes:58083
From: Koichi <ko1@a...>
Date: Wed, 2 Oct 2019 16:50:02 +0900 (JST)
Subject: [ruby-changes:58083] 84cbce3d88 (master): Enable checkers on parallel test.
https://git.ruby-lang.org/ruby.git/commit/?id=84cbce3d88 From 84cbce3d880f0d6a51ccf3622b8d1e79132b9a0e Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Wed, 2 Oct 2019 16:02:00 +0900 Subject: 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 diff --git a/tool/lib/iseq_loader_checker.rb b/tool/lib/iseq_loader_checker.rb index e7cfc79..3f07b3a 100644 --- a/tool/lib/iseq_loader_checker.rb +++ b/tool/lib/iseq_loader_checker.rb @@ -39,7 +39,11 @@ class RubyVM::InstructionSequence https://github.com/ruby/ruby/blob/trunk/tool/lib/iseq_loader_checker.rb#L39 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 730d7a7..1260067 100644 --- a/tool/lib/test/unit/parallel.rb +++ b/tool/lib/test/unit/parallel.rb @@ -2,6 +2,11 @@ https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/parallel.rb#L2 $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 1ee4fdf..708d654 100644 --- a/tool/test/runner.rb +++ b/tool/test/runner.rb @@ -5,10 +5,10 @@ $LOAD_PATH.unshift File.expand_path("../lib", __dir__) https://github.com/ruby/ruby/blob/trunk/tool/test/runner.rb#L5 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/