* lib/test/unit.rb (_run_suites): Now reports are written the

following order: Skip, Failure, Error. [Feature #5282]

* test_sorting.rb: test for above.

* test4test_sorting.rb: Ditto.

* lib/test/unit.rb (run): Put RUBY_DESCIPTION before quitting.
  [Feature #5282]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
sorah 2011-09-06 12:20:17 +00:00
Родитель e2b7469698
Коммит 7e04b19d22
4 изменённых файлов: 52 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,15 @@
Tue Sep 6 21:06:49 2011 Shota Fukumori <sorah@tubusu.net>
* lib/test/unit.rb (_run_suites): Now reports are written the
following order: Skip, Failure, Error. [Feature #5282]
* test_sorting.rb: test for above.
* test4test_sorting.rb: Ditto.
* lib/test/unit.rb (run): Put RUBY_DESCIPTION before quitting.
[Feature #5282]
Tue Sep 6 21:13:47 2011 Masaya Tarui <tarui@ruby-lang.org>
* win32/Makefile.sub (INSNS): change command line option -Ks to -Ku

Просмотреть файл

@ -570,6 +570,8 @@ module Test
}
end
report.reject!{|r| r.start_with? "Skipped:" } if @options[:hide_skip]
report.sort_by!{|r| r.start_with?("Skipped:") ? 0 : \
(r.start_with?("Failure:") ? 1 : 2) }
result
end
@ -599,6 +601,12 @@ module Test
raise @interrupt if @interrupt
result
end
def run(*args)
result = super
puts "\nruby -v: #{RUBY_DESCRIPTION}"
result
end
end
class AutoRunner

Просмотреть файл

@ -0,0 +1,15 @@
require 'test/unit'
class TestForTestHideSkip < Test::Unit::TestCase
def test_c
skip "do nothing"
end
def test_b
assert_equal true, false
end
def test_a
raise
end
end

Просмотреть файл

@ -0,0 +1,17 @@
require 'test/unit'
class TestTestUnitSorting < Test::Unit::TestCase
def test_sorting
test_out, o = IO.pipe
spawn(*@options[:ruby], "#{File.dirname(__FILE__)}/test4test_sorting.rb",
out: o, err: o)
o.close
result = test_out.read
assert_match(/^ 1\) Skipped:/, result)
assert_match(/^ 2\) Failure:/, result)
assert_match(/^ 3\) Error:/, result)
test_out.close
end
end