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:
parent
11f3da8e9d
commit
d2710ba866
7 changed files with 56 additions and 18 deletions
|
@ -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)
|
8
test/ripper/test_files_ext.rb
Normal file
8
test/ripper/test_files_ext.rb
Normal 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
|
14
test/ripper/test_files_lib.rb
Normal file
14
test/ripper/test_files_lib.rb
Normal 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
|
8
test/ripper/test_files_sample.rb
Normal file
8
test/ripper/test_files_sample.rb
Normal 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
|
8
test/ripper/test_files_test.rb
Normal file
8
test/ripper/test_files_test.rb
Normal 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
|
9
test/ripper/test_files_test_1.rb
Normal file
9
test/ripper/test_files_test_1.rb
Normal 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
|
9
test/ripper/test_files_test_2.rb
Normal file
9
test/ripper/test_files_test_2.rb
Normal 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
|
Loading…
Reference in a new issue