* test/ruby/test_thread.rb: fix typos.
* test/ruby/envutil.rb (rubyexec): move Open3.popen3 call into timeout block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c8d27afcd6
commit
9b694aaa85
@ -1,3 +1,10 @@
|
|||||||
|
Thu Apr 24 23:00:58 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
|
* test/ruby/test_thread.rb: fix typos.
|
||||||
|
|
||||||
|
* test/ruby/envutil.rb (rubyexec): move Open3.popen3 call into timeout
|
||||||
|
block.
|
||||||
|
|
||||||
Thu Apr 24 22:34:52 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
Thu Apr 24 22:34:52 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* test/ruby/test_comparable.rb: new tests for Comparable, to achieve
|
* test/ruby/test_comparable.rb: new tests for Comparable, to achieve
|
||||||
|
@ -43,6 +43,8 @@ module EnvUtil
|
|||||||
c = "C"
|
c = "C"
|
||||||
env = {}
|
env = {}
|
||||||
LANG_ENVS.each {|lc| env[lc], ENV[lc] = ENV[lc], c}
|
LANG_ENVS.each {|lc| env[lc], ENV[lc] = ENV[lc], c}
|
||||||
|
stdin = stdout = stderr = nil
|
||||||
|
Timeout.timeout(10) do
|
||||||
stdin, stdout, stderr = Open3.popen3(*([ruby] + args))
|
stdin, stdout, stderr = Open3.popen3(*([ruby] + args))
|
||||||
env.each_pair {|lc, v|
|
env.each_pair {|lc, v|
|
||||||
if v
|
if v
|
||||||
@ -52,7 +54,6 @@ module EnvUtil
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
env = nil
|
env = nil
|
||||||
Timeout.timeout(10) do
|
|
||||||
yield(stdin, stdout, stderr)
|
yield(stdin, stdout, stderr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -109,12 +109,12 @@ class TestThread < Test::Unit::TestCase
|
|||||||
t1.priority = -1
|
t1.priority = -1
|
||||||
t2 = Thread.new { loop { c2 += 1 } }
|
t2 = Thread.new { loop { c2 += 1 } }
|
||||||
t2.priority = -3
|
t2.priority = -3
|
||||||
assert(-1, t1.priority)
|
assert_equal(-1, t1.priority)
|
||||||
assert(-3, t2.priority)
|
assert_equal(-3, t2.priority)
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
t1.kill
|
t1.kill
|
||||||
t2.kill
|
t2.kill
|
||||||
#assert(c1 > c2 * 2, "[ruby-dev:33124]")
|
assert(c1 > c2 * 2, "[ruby-dev:33124]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_new
|
def test_new
|
||||||
@ -384,7 +384,7 @@ class TestThread < Test::Unit::TestCase
|
|||||||
def test_select_wait
|
def test_select_wait
|
||||||
assert_nil(IO.select(nil, nil, nil, 1))
|
assert_nil(IO.select(nil, nil, nil, 1))
|
||||||
t = Thread.new do
|
t = Thread.new do
|
||||||
assert_nil(IO.select(nil, nil, nil, nil))
|
IO.select(nil, nil, nil, nil)
|
||||||
end
|
end
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
t.kill
|
t.kill
|
||||||
|
Loading…
x
Reference in New Issue
Block a user