test: skipped color
* lib/test/unit.rb (Test::Unit::Runner#failed): use different color for Skipped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0243943aad
commit
fa6a2e0324
@ -680,9 +680,10 @@ module Test
|
|||||||
colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w)=([^:]*)/)] : {}
|
colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w)=([^:]*)/)] : {}
|
||||||
@passed_color = "\e[#{colors["pass"] || "32"}m"
|
@passed_color = "\e[#{colors["pass"] || "32"}m"
|
||||||
@failed_color = "\e[#{colors["fail"] || "31"}m"
|
@failed_color = "\e[#{colors["fail"] || "31"}m"
|
||||||
|
@skipped_color = "\e[#{colors["skip"] || "33"}m"
|
||||||
@reset_color = "\e[m"
|
@reset_color = "\e[m"
|
||||||
else
|
else
|
||||||
@passed_color = @failed_color = @reset_color = ""
|
@passed_color = @failed_color = @skipped_color = @reset_color = ""
|
||||||
end
|
end
|
||||||
if color or @options[:job_status] == :replace
|
if color or @options[:job_status] == :replace
|
||||||
@options[:job_status] ||= :replace unless @verbose
|
@options[:job_status] ||= :replace unless @verbose
|
||||||
@ -714,10 +715,15 @@ module Test
|
|||||||
sep = "\n"
|
sep = "\n"
|
||||||
@report_count ||= 0
|
@report_count ||= 0
|
||||||
report.each do |msg|
|
report.each do |msg|
|
||||||
next if @options[:hide_skip] and msg.start_with? "Skipped:"
|
if msg.start_with? "Skipped:"
|
||||||
|
next if @options[:hide_skip]
|
||||||
|
color = @skipped_color
|
||||||
|
else
|
||||||
|
color = @failed_color
|
||||||
|
end
|
||||||
msg = msg.split(/$/, 2)
|
msg = msg.split(/$/, 2)
|
||||||
$stdout.printf("%s%s%3d) %s%s%s\n",
|
$stdout.printf("%s%s%3d) %s%s%s\n",
|
||||||
sep, @failed_color, @report_count += 1,
|
sep, color, @report_count += 1,
|
||||||
msg[0], @reset_color, msg[1])
|
msg[0], @reset_color, msg[1])
|
||||||
sep = nil
|
sep = nil
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user