summaryrefslogtreecommitdiff
path: root/tool/test-bundled-gems.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-08-25 02:49:49 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-08-25 11:13:17 +0900
commitb44741f5dcb2903496832bffce09100e28356864 (patch)
treed1af41da6286babd87a665b17c4133858c121a1e /tool/test-bundled-gems.rb
parent716624660bad5550b19ec7a2b46fd760ebd9a272 (diff)
downloadruby-b44741f5dcb2903496832bffce09100e28356864.tar.gz
tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf
Formerly, TypeProf was tested with the latest RBS code during `make test-bundled-gems`. However, when a new version of rbs is released, and if it is incompatible with TypeProf, `make test-bundled-gems` starts failing, which was annoying. By this change, TypeProf is tested with the bundled version of RBS.
Diffstat (limited to 'tool/test-bundled-gems.rb')
-rw-r--r--tool/test-bundled-gems.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/tool/test-bundled-gems.rb b/tool/test-bundled-gems.rb
index d4c45332ab..6419ffaa50 100644
--- a/tool/test-bundled-gems.rb
+++ b/tool/test-bundled-gems.rb
@@ -20,6 +20,11 @@ File.foreach("#{gem_dir}/bundled_gems") do |line|
test_command = "#{ruby} -C #{gem_dir}/src/#{gem} -Ilib #{rake} test"
first_timeout = 600 # 10min
+ if gem == "typeprof"
+ raise "need to run rbs test suite before typeprof" unless File.readable?("#{gem_dir}/src/rbs/lib/rbs/parser.rb")
+ ENV["RUBYLIB"] = ["#{gem_dir}/src/rbs/lib", ENV.fetch("RUBYLIB", nil)].compact.join(":")
+ end
+
if gem == "rbs"
racc = File.realpath("../../libexec/racc", __FILE__)
pid = Process.spawn("#{ruby} -C #{gem_dir}/src/#{gem} -Ilib #{racc} -v -o lib/rbs/parser.rb lib/rbs/parser.y")