1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Split test/ripper/test_files.rb to run in parallel

This commit is contained in:
Nobuyoshi Nakada 2019-07-23 05:21:41 +09:00
parent 11f3da8e9d
commit d2710ba866
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
7 changed files with 56 additions and 18 deletions

View file

@ -5,24 +5,6 @@ module TestRipper; end
class TestRipper::Generic < Test::Unit::TestCase
SRCDIR = File.expand_path("../../..", __FILE__)
%w[sample ext].each do |dir|
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir)
end
end
%w[lib test].each do |dir|
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir, "*.rb")
end
Dir["#{SRCDIR}/#{dir}/*/"].each do |dir|
dir = dir[(SRCDIR.length+1)..-2]
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir)
end
end
end
def assert_parse_files(dir, pattern = "**/*.rb")
assert_separately(%W[--disable-gem -rripper - #{SRCDIR}/#{dir} #{pattern}],
__FILE__, __LINE__, "#{<<-"begin;"}\n#{<<-'end;'}", timeout: Float::INFINITY)

View file

@ -0,0 +1,8 @@
require_relative 'assert_parse_files.rb'
class TestRipper::Generic
%w[ext].each do |dir|
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir)
end
end
end

View file

@ -0,0 +1,14 @@
require_relative 'assert_parse_files.rb'
class TestRipper::Generic
%w[lib].each do |dir|
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir, "*.rb")
end
Dir["#{SRCDIR}/#{dir}/*/"].each do |dir|
dir = dir[(SRCDIR.length+1)..-2]
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir)
end
end
end
end

View file

@ -0,0 +1,8 @@
require_relative 'assert_parse_files.rb'
class TestRipper::Generic
%w[sample].each do |dir|
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir)
end
end
end

View file

@ -0,0 +1,8 @@
require_relative 'assert_parse_files.rb'
class TestRipper::Generic
%w[test].each do |dir|
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir, "*.rb")
end
end
end

View file

@ -0,0 +1,9 @@
require_relative 'assert_parse_files.rb'
class TestRipper::Generic
Dir["#{SRCDIR}/test/[-a-n]*/"].each do |dir|
dir = dir[(SRCDIR.length+1)..-2]
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir)
end
end
end

View file

@ -0,0 +1,9 @@
require_relative 'assert_parse_files.rb'
class TestRipper::Generic
Dir["#{SRCDIR}/test/[o-z]*/"].each do |dir|
dir = dir[(SRCDIR.length+1)..-2]
define_method("test_parse_files:#{dir}") do
assert_parse_files(dir)
end
end
end