diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-01 15:14:08 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-01 15:14:08 +0000 |
commit | 682e5bef212eec00a1c430f19106e05c4a176419 (patch) | |
tree | 8aafd6280441fff2e42b02038b392835edb0ad5d /test | |
parent | 4d3df433e9c638e1824832edf8a6e87ffd2741ea (diff) |
merge revision(s) 39932,39934,39935,39937,39955,40491:
Use assert_separately to speed up on test-all
This creates large string and it pressure GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_syntax.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index cbaae5a249..384c9bd378 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -2,14 +2,23 @@ require 'test/unit' require_relative 'envutil' class TestSyntax < Test::Unit::TestCase - def test_syntax - assert_nothing_raised(Exception) do - for script in Dir[File.expand_path("../../../{lib,sample,ext,test}/**/*.rb", __FILE__)].sort + 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) + dir = ARGV.shift + for script in Dir["#{dir}/**/*.rb"].sort assert_valid_syntax(IO::read(script), script) end - 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) |