ruby-changes:26318
From: naruse <ko1@a...>
Date: Fri, 14 Dec 2012 10:38:28 +0900 (JST)
Subject: [ruby-changes:26318] naruse:r38370 (trunk): Use assert_separately to speed up slow tests
naruse 2012-12-14 10:38:12 +0900 (Fri, 14 Dec 2012) New Revision: 38370 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38370 Log: Use assert_separately to speed up slow tests These speed will slow down when there are many objects like test-all. Modified files: trunk/test/objspace/test_objspace.rb trunk/test/ruby/test_gc.rb Index: test/ruby/test_gc.rb =================================================================== --- test/ruby/test_gc.rb (revision 38369) +++ test/ruby/test_gc.rb (revision 38370) @@ -120,6 +120,7 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L120 end def test_profiler_clear + assert_separately %w[--disable-gem], __FILE__, __LINE__, <<-'eom' GC::Profiler.enable GC.start @@ -131,8 +132,7 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L132 assert_equal(200, GC::Profiler.raw_data.size) GC::Profiler.clear assert_equal(0, GC::Profiler.raw_data.size) - ensure - GC::Profiler.disable + eom end def test_finalizing_main_thread Index: test/objspace/test_objspace.rb =================================================================== --- test/objspace/test_objspace.rb (revision 38369) +++ test/objspace/test_objspace.rb (revision 38370) @@ -70,6 +70,7 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L70 end def test_reachable_objects_from + assert_separately %w[--disable-gem -robjspace], __FILE__, __LINE__, <<-'eom' assert_equal(nil, ObjectSpace.reachable_objects_from(nil)) assert_equal([Array, 'a', 'b', 'c'], ObjectSpace.reachable_objects_from(['a', 'b', 'c'])) @@ -91,9 +92,11 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L92 end } assert_operator(max, :>=, 1_001, "1000 elems + Array class") + eom end def test_reachable_objects_size + assert_separately %w[--disable-gem -robjspace], __FILE__, __LINE__, <<-'eom' ObjectSpace.each_object{|o| ObjectSpace.reachable_objects_from(o).each{|reached_obj| size = ObjectSpace.memsize_of(reached_obj) @@ -101,5 +104,6 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L104 assert_operator(size, :>=, 0) } } + eom end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/