* test/ruby/envutil.rb (EnvUtil::Unit::Assertionsassert_separately):
added to execute given test source on separate process, catch its resulted exception and raise it on main process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2f0095e1ab
commit
bc2195e4fb
@ -1,3 +1,9 @@
|
|||||||
|
Fri Dec 14 04:08:05 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/ruby/envutil.rb (EnvUtil::Unit::Assertionsassert_separately):
|
||||||
|
added to execute given test source on separate process,
|
||||||
|
catch its resulted exception and raise it on main process.
|
||||||
|
|
||||||
Fri Dec 14 07:43:44 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
Fri Dec 14 07:43:44 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* ext/psych/lib/psych/visitors/yaml_tree.rb: quote strings that begin
|
* ext/psych/lib/psych/visitors/yaml_tree.rb: quote strings that begin
|
||||||
|
@ -193,6 +193,23 @@ module Test
|
|||||||
assert(status.success?, m)
|
assert(status.success?, m)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def assert_separately(args, file, line, src)
|
||||||
|
opt = {}
|
||||||
|
src = <<eom
|
||||||
|
require 'test/unit';include Test::Unit::Assertions;begin;#{src}
|
||||||
|
ensure
|
||||||
|
print [Marshal.dump($!)].pack('m')
|
||||||
|
end
|
||||||
|
eom
|
||||||
|
stdout, _stderr, _status = EnvUtil.invoke_ruby(args, src, true, true, opt)
|
||||||
|
res = Marshal.load(stdout.unpack("m")[0])
|
||||||
|
return unless res
|
||||||
|
res.backtrace.each do |l|
|
||||||
|
l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"}
|
||||||
|
end
|
||||||
|
raise res
|
||||||
|
end
|
||||||
|
|
||||||
def assert_warning(pat, message = nil)
|
def assert_warning(pat, message = nil)
|
||||||
stderr = EnvUtil.verbose_warning { yield }
|
stderr = EnvUtil.verbose_warning { yield }
|
||||||
message = ' "' + message + '"' if message
|
message = ' "' + message + '"' if message
|
||||||
|
Loading…
x
Reference in New Issue
Block a user