summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-27 00:02:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-27 00:02:21 +0000
commit825a892330a0a9829011c59eabb212da31761711 (patch)
tree2bb24889e852fe6c6f933e858490ea04a592d071 /test
parente38b66fc982044e40ec2122809d96b07cba1dd7b (diff)
test_syntax.rb: split test_syntax
* test/ruby/test_syntax.rb (test_syntax): split to improve throuthput by reducing objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 895a4569fd..34bd1e0191 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -2,17 +2,23 @@ require 'test/unit'
require_relative 'envutil'
class TestSyntax < Test::Unit::TestCase
- def test_syntax
+ def assert_syntax_files(test)
srcdir = File.expand_path("../../..", __FILE__)
+ srcdir = File.join(srcdir, test)
assert_separately(%W[--disable-gem -r#{__dir__}/envutil - #{srcdir}],
- __FILE__, __LINE__, <<-eom, timeout: Float::INFINITY)
+ __FILE__, __LINE__, <<-'eom', timeout: Float::INFINITY)
dir = ARGV.shift
- for script in Dir["\#{dir}/{lib,sample,ext,test}/**/*.rb"].sort
+ for script in Dir["#{dir}/**/*.rb"].sort
assert_valid_syntax(IO::read(script), script)
end
eom
end
+ def test_syntax_lib; assert_syntax_files("lib"); end
+ def test_syntax_sample; assert_syntax_files("sample"); end
+ def test_syntax_ext; assert_syntax_files("ext"); end
+ def test_syntax_test; assert_syntax_files("test"); end
+
def test_defined_empty_argument
bug8220 = '[ruby-core:53999] [Bug #8220]'
assert_ruby_status(%w[--disable-gem], 'puts defined? ()', bug8220)