* test/lib/minitest/unit.rb: Sort leaked threads and tempfiles.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-05-25 03:34:27 +00:00
parent c3abc41532
commit 36c9605a6e
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,7 @@
Sun May 25 12:32:42 2014 Tanaka Akira <akr@fsij.org>
* test/lib/minitest/unit.rb: Sort leaked threads and tempfiles.
Sun May 25 12:15:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> Sun May 25 12:15:30 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* signal.c (check_stack_overflow): fix condition to use ucontext * signal.c (check_stack_overflow): fix condition to use ucontext

View File

@ -964,15 +964,18 @@ module MiniTest
live2 = live_thread_and_tempfile live2 = live_thread_and_tempfile
thread_finished = live1[0] - live2[0] thread_finished = live1[0] - live2[0]
if !thread_finished.empty? if !thread_finished.empty?
puts "Finished threads: #{inst.class}\##{inst.__name__}:#{thread_finished.map {|t| ' ' + t.inspect }.join}" list = thread_finished.map {|t| ' ' + t.inspect }.sort.join
puts "Finished threads: #{inst.class}\##{inst.__name__}:#{list}"
end end
thread_retained = live2[0] - live1[0] thread_retained = live2[0] - live1[0]
if !thread_retained.empty? if !thread_retained.empty?
puts "Leaked threads: #{inst.class}\##{inst.__name__}:#{thread_retained.map {|t| ' ' + t.inspect }.join}" list = thread_retained.map {|t| ' ' + t.inspect }.sort.join
puts "Leaked threads: #{inst.class}\##{inst.__name__}:#{list}"
end end
tempfile_retained = live2[1] - live1[1] tempfile_retained = live2[1] - live1[1]
if !tempfile_retained.empty? if !tempfile_retained.empty?
puts "Leaked tempfiles: #{inst.class}\##{inst.__name__}:#{tempfile_retained.map {|t| ' ' + t.inspect }.join}" list = tempfile_retained.map {|t| ' ' + t.inspect }.sort.join
puts "Leaked tempfiles: #{inst.class}\##{inst.__name__}:#{list}"
tempfile_retained.each {|t| t.unlink } tempfile_retained.each {|t| t.unlink }
end end
end end