ruby-changes:48133
From: hsbt <ko1@a...>
Date: Sat, 21 Oct 2017 18:50:41 +0900 (JST)
Subject: [ruby-changes:48133] hsbt:r60247 (trunk): [EXPERIMENTAL] Added test-bundled-gems task.
hsbt 2017-10-21 18:50:36 +0900 (Sat, 21 Oct 2017) New Revision: 60247 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60247 Log: [EXPERIMENTAL] Added test-bundled-gems task. `test-bundled-gems` invoke test suite of bundled gems with build environment. Added files: trunk/tool/fetch-bundled_gems.rb Modified files: trunk/.gitignore trunk/Makefile.in trunk/gems/bundled_gems trunk/tool/make-snapshot Index: gems/bundled_gems =================================================================== --- gems/bundled_gems (revision 60246) +++ gems/bundled_gems (revision 60247) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems#L1 -did_you_mean 1.1.2 -minitest 5.10.3 -net-telnet 0.1.1 -power_assert 1.1.0 -rake 12.1.0 -test-unit 3.2.5 -xmlrpc 0.3.0 +did_you_mean 1.1.2 https://github.com/yuki24/did_you_mean +minitest 5.10.3 https://github.com/seattlerb/minitest +net-telnet 0.1.1 https://github.com/ruby/net-telnet +power_assert 1.1.0 https://github.com/k-tsj/power_assert +rake 12.1.0 https://github.com/ruby/rake +test-unit 3.2.5 https://github.com/test-unit/test-unit +xmlrpc 0.3.0 https://github.com/ruby/xmlrpc Index: .gitignore =================================================================== --- .gitignore (revision 60246) +++ .gitignore (revision 60247) @@ -180,6 +180,7 @@ lcov*.info https://github.com/ruby/ruby/blob/trunk/.gitignore#L180 # /gems /gems/*.gem +/gems/src /gems/*-* # /spec/bundler Index: Makefile.in =================================================================== --- Makefile.in (revision 60246) +++ Makefile.in (revision 60247) @@ -474,6 +474,20 @@ ext/extinit.$(OBJEXT): ext/extinit.c $(S https://github.com/ruby/ruby/blob/trunk/Makefile.in#L474 enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP) +test-bundled-gems-precheck: $(arch)-fake.rb programs + +yes-test-bundled-gems-prepare: test-bundled-gems-precheck + $(Q) $(BASERUBY) $(srcdir)/tool/fetch-bundled_gems.rb $(srcdir) + $(XRUBY) -C "$(srcdir)" bin/gem install --no-ri --no-rdoc \ + --install-dir spec/rspec --conservative 'minitest:~> 5' 'test-unit' 'rake' 'hoe' 'yard' 'packnga' + +test-bundled-gems: $(TEST_RUNNABLE)-test-bundled-gems +yes-test-bundled-gems: yes-test-bundled-gems-prepare + for gem in minitest test-unit xmlrpc net-telnet did_you_mean power_assert rake; do \ + $(XRUBY) -C $(srcdir)/gems/src/$$gem -Ilib ../../../spec/rspec/bin/rake; \ + done +no-test-bundled-gems: + test-bundler-precheck: $(arch)-fake.rb programs yes-test-bundler-prepare: test-bundler-precheck Index: tool/make-snapshot =================================================================== --- tool/make-snapshot (revision 60246) +++ tool/make-snapshot (revision 60247) @@ -369,7 +369,8 @@ _touch-unicode-files: https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L369 if File.exist?("gems/bundled_gems") gems = Dir.glob("gems/*.gem") gems -= File.readlines("gems/bundled_gems").map {|line| - 'gems/'+line.split(' ').join('-')+'.gem' + n, v, _ = line.split(' ') + "gems/#{n}-#{v}.gem" } FileUtils.rm_f(gems) else Index: tool/fetch-bundled_gems.rb =================================================================== --- tool/fetch-bundled_gems.rb (nonexistent) +++ tool/fetch-bundled_gems.rb (revision 60247) @@ -0,0 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/tool/fetch-bundled_gems.rb#L1 +require 'fileutils' + +File.readlines("#{ARGV[0]}/gems/bundled_gems").each do |gem| + n, v, u = gem.split + + v = "v" + v + + case n + when "minitest" + v = "master" + when "test-unit" + v = v[1..-1] + end + + FileUtils.mkdir_p "#{ARGV[0]}/gems/src" + `#{ARGV[0]}/tool/git-refresh -C #{ARGV[0]}/gems/src --branch #{v} #{u} #{n}` +end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/