Skip to content

Commit

Permalink
tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mame committed Aug 25, 2021
1 parent 7166246 commit b44741f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common.mk
Expand Up @@ -1372,7 +1372,7 @@ no-test-bundled-gems-prepare: no-test-bundled-gems-precheck
yes-test-bundled-gems-prepare: yes-test-bundled-gems-precheck
$(ACTIONS_GROUP)
$(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
--install-dir .bundle --conservative "bundler" "minitest:~> 5" "test-unit" "rake" "hoe" "yard" "pry" "packnga" "rexml" "json-schema" "rbs"
--install-dir .bundle --conservative "bundler" "minitest:~> 5" "test-unit" "rake" "hoe" "yard" "pry" "packnga" "rexml" "json-schema"
$(ACTIONS_ENDGROUP)

PREPARE_BUNDLED_GEMS = test-bundled-gems-prepare
Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Expand Up @@ -11,5 +11,5 @@ net-pop 0.1.1 https://github.com/ruby/net-pop
net-smtp 0.2.1 https://github.com/ruby/net-smtp
matrix 0.4.2 https://github.com/ruby/matrix
prime 0.1.2 https://github.com/ruby/prime
typeprof 0.15.2 https://github.com/ruby/typeprof
rbs 1.5.1 https://github.com/ruby/rbs
typeprof 0.15.2 https://github.com/ruby/typeprof
5 changes: 5 additions & 0 deletions tool/test-bundled-gems.rb
Expand Up @@ -20,6 +20,11 @@
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")
Expand Down

0 comments on commit b44741f

Please sign in to comment.