mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* 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:
		
							parent
							
								
									e2b7469698
								
							
						
					
					
						commit
						7e04b19d22
					
				
					 4 changed files with 52 additions and 0 deletions
				
			
		
							
								
								
									
										12
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								ChangeLog
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								test/testunit/test4test_sorting.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								test/testunit/test4test_sorting.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
							
								
								
									
										17
									
								
								test/testunit/test_sorting.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								test/testunit/test_sorting.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue