summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-17 00:50:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-17 00:50:11 +0000
commita9ca74cd70bfee429544a7346749abcb2103e0f3 (patch)
tree9f9f87823afb6c1690512900d4c1cea0051f722c /test
parent75a865406f8b65827a414059b609f8077d9070ed (diff)
default colors
* bootstraptest/runner.rb, sample/test.rb, test/lib/test/unit.rb: shared the default colors from test/colors file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/colors3
-rw-r--r--test/lib/test/unit.rb8
2 files changed, 10 insertions, 1 deletions
diff --git a/test/colors b/test/colors
new file mode 100644
index 00000000000..a65c326ade4
--- /dev/null
+++ b/test/colors
@@ -0,0 +1,3 @@
+pass=36;7
+fail=31;1;7
+skip=33;1
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index 996134eaf3c..9d9ff4bdf33 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -596,7 +596,13 @@ module Test
end
if color
# dircolors-like style
- colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
+ begin
+ File.read(File.join(__dir__, "../../colors")).scan(/(\w+)=([^:\n]*)/) do |n, c|
+ colors[n] ||= c
+ end
+ rescue
+ end
@passed_color = "\e[;#{colors["pass"] || "32"}m"
@failed_color = "\e[;#{colors["fail"] || "31"}m"
@skipped_color = "\e[;#{colors["skip"] || "33"}m"