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

ruby-changes:26841

From: naruse <ko1@a...>
Date: Tue, 22 Jan 2013 11:35:57 +0900 (JST)
Subject: [ruby-changes:26841] naruse:r38893 (trunk): Sync output message

naruse	2013-01-22 11:35:48 +0900 (Tue, 22 Jan 2013)

  New Revision: 38893

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

  Log:
    Sync output message
    
    * sync $stdout to ensure outputting on expected SEGV.
      this caused failure:
      http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20130121T230101Z.log.html.gz
    * check result of invoke_ruby
    * use assert_operator

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

Index: test/ruby/test_fiber.rb
===================================================================
--- test/ruby/test_fiber.rb	(revision 38892)
+++ test/ruby/test_fiber.rb	(revision 38893)
@@ -282,7 +282,7 @@ class TestFiber < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_fiber.rb#L282
     env = {}
     env['RUBY_FIBER_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size
     env['RUBY_FIBER_MACHINE_STACK_SIZE'] = machine_stack_size.to_s if machine_stack_size
-    out, = EnvUtil.invoke_ruby([env, '-e', script], '', true, true)
+    out, err = EnvUtil.invoke_ruby([env, '-e', script], '', true, true)
     use_length ? out.length : out
   end
 
@@ -297,25 +297,25 @@ class TestFiber < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_fiber.rb#L297
     assert(h_default[:fiber_machine_stack_size] <= h_large[:fiber_machine_stack_size])
 
     # check VM machine stack size
-    script = 'def rec; print "."; rec; end; Fiber.new{rec}.resume'
+    script = '$stdout.sync=true; def rec; print "."; rec; end; Fiber.new{rec}.resume'
     size_default = invoke_rec script, nil, nil
-    assert(size_default > 0, size_default.to_s)
+    assert_operator(size_default, :>, 0)
     size_0 = invoke_rec script, 0, nil
-    assert(size_default > size_0, [size_default, size_0].inspect)
+    assert_operator(size_default, :>, size_0)
     size_large = invoke_rec script, 1024 * 1024 * 10, nil
-    assert(size_default < size_large, [size_default, size_large].inspect)
+    assert_operator(size_default, :<, size_large)
 
     return if /mswin|mingw/ =~ RUBY_PLATFORM
 
     # check machine stack size
     # Note that machine stack size may not change size (depend on OSs)
-    script = 'def rec; print "."; 1.times{1.times{1.times{rec}}}; end; Fiber.new{rec}.resume'
+    script = '$stdout.sync=true; def rec; print "."; 1.times{1.times{1.times{rec}}}; end; Fiber.new{rec}.resume'
     vm_stack_size = 1024 * 1024
     size_default = invoke_rec script, vm_stack_size, nil
     size_0 = invoke_rec script, vm_stack_size, 0
-    assert(size_default >= size_0, [size_default, size_0].inspect)
+    assert_operator(size_default, :>=, size_0)
     size_large = invoke_rec script, vm_stack_size, 1024 * 1024 * 10
-    assert(size_default <= size_large, [size_default, size_large].inspect)
+    assert_operator(size_default, :<=, size_large)
   end
 end
 

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

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