summaryrefslogtreecommitdiff
path: root/tool/test-bundled-gems.rb
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-10-01 03:13:00 +0900
committerKoichi Sasada <ko1@atdot.net>2021-10-05 02:07:33 +0900
commitbc96a45f12503956e323e6c2a47aa550ca1da3dc (patch)
treec2bffe24d2e5d9ee80c42e00e34f9d437ccbd73b /tool/test-bundled-gems.rb
parentae1da7e1f76cabc6c2d9b45a6c56b1607200147a (diff)
downloadruby-bc96a45f12503956e323e6c2a47aa550ca1da3dc.tar.gz
introduce debug.gem
For the `test-bundled-gems`, make `debug.so` with extconf.rb and `make` command directly because `rake-compiler` assume ruby is installed (but `test-bundled-gems` can run without installation).
Diffstat (limited to 'tool/test-bundled-gems.rb')
-rw-r--r--tool/test-bundled-gems.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/tool/test-bundled-gems.rb b/tool/test-bundled-gems.rb
index 6419ffaa50..ef491f9db4 100644
--- a/tool/test-bundled-gems.rb
+++ b/tool/test-bundled-gems.rb
@@ -1,5 +1,6 @@
require 'rbconfig'
require 'timeout'
+require 'fileutils'
github_actions = ENV["GITHUB_ACTIONS"] == "true"
@@ -40,6 +41,15 @@ File.foreach("#{gem_dir}/bundled_gems") do |line|
test_command << " 'TESTOPTS=-e /test_stub_value_block_args_5__break_if_not_passed|test_no_method_error_on_unexpected_methods/'"
end
+ if gem == "debug"
+ build_dir = 'ext/-test-/gems/debug'
+ FileUtils.mkdir_p(build_dir)
+ extconf_path = File.expand_path('../../gems/src/debug/ext/debug/extconf.rb', __FILE__)
+ system("#{ruby} -C #{build_dir} #{extconf_path}") or raise
+ system("cd #{build_dir} && make extout=../../../../.ext libdir=../../../..") or raise
+ ENV["RUBYLIB"] = [File.expand_path(build_dir + "/.."), ENV.fetch("RUBYLIB", nil)].compact.join(":")
+ end
+
print "[command]" if github_actions
puts test_command
pid = Process.spawn(test_command, "#{/mingw|mswin/ =~ RUBY_PLATFORM ? 'new_' : ''}pgroup": true)