diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-22 02:35:48 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-22 02:35:48 +0000 |
commit | b536e31faac5121f44ab0b53a901a6e7784bce59 (patch) | |
tree | 0c7bc29d0e823debb7960455ce087e13900269d9 | |
parent | 385ef8e5c24b0e28ef88346725380c7e26bf427a (diff) | |
download | ruby-b536e31faac5121f44ab0b53a901a6e7784bce59.tar.gz |
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
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_fiber.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 9ebf697941..dcf1fca50a 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -282,7 +282,7 @@ class TestFiber < Test::Unit::TestCase 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 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 |