diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-05 10:47:36 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-05 10:48:49 +0900 |
commit | 29092d35d33d3a879634e173604edc9d201aa87a (patch) | |
tree | d03ee3482a518895e7f10b407b59f26a5289a298 /tool/lib/test | |
parent | 548cd6e2b51ee0ed7b59799950681d46a43c6c85 (diff) | |
download | ruby-29092d35d33d3a879634e173604edc9d201aa87a.tar.gz |
Moved FailDesc to EnvUtil.failure_description
So EnvUtil does not depends on test/unit.
Diffstat (limited to 'tool/lib/test')
-rw-r--r-- | tool/lib/test/unit/core_assertions.rb | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb index b637748e5e..1801b910db 100644 --- a/tool/lib/test/unit/core_assertions.rb +++ b/tool/lib/test/unit/core_assertions.rb @@ -41,38 +41,10 @@ module Test end FailDesc = proc do |status, message = "", out = ""| - pid = status.pid now = Time.now - faildesc = proc do - if signo = status.termsig - signame = Signal.signame(signo) - sigdesc = "signal #{signo}" - end - log = EnvUtil.diagnostic_reports(signame, pid, now) - if signame - sigdesc = "SIG#{signame} (#{sigdesc})" - end - if status.coredump? - sigdesc = "#{sigdesc} (core dumped)" - end - full_message = ''.dup - message = message.call if Proc === message - if message and !message.empty? - full_message << message << "\n" - end - full_message << "pid #{pid}" - full_message << " exit #{status.exitstatus}" if status.exited? - full_message << " killed by #{sigdesc}" if sigdesc - if out and !out.empty? - full_message << "\n" << out.b.gsub(/^/, '| ') - full_message.sub!(/(?<!\n)\z/, "\n") - end - if log - full_message << "Diagnostic reports:\n" << log.b.gsub(/^/, '| ') - end - full_message + proc do + EnvUtil.failure_description(status, now, message, out) end - faildesc end def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [], message = nil, |