[前][次][番号順一覧][スレッド一覧]

ruby-changes:28439

From: nobu <ko1@a...>
Date: Sat, 27 Apr 2013 09:02:31 +0900 (JST)
Subject: [ruby-changes:28439] nobu:r40491 (trunk): test_syntax.rb: split test_syntax

nobu	2013-04-27 09:02:21 +0900 (Sat, 27 Apr 2013)

  New Revision: 40491

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40491

  Log:
    test_syntax.rb: split test_syntax
    
    * test/ruby/test_syntax.rb (test_syntax): split to improve throuthput
      by reducing objects.

  Modified files:
    trunk/test/ruby/test_syntax.rb

Index: test/ruby/test_syntax.rb
===================================================================
--- test/ruby/test_syntax.rb	(revision 40490)
+++ test/ruby/test_syntax.rb	(revision 40491)
@@ -2,17 +2,23 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L2
 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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]