aboutsummaryrefslogtreecommitdiffstats
path: root/tool/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-06-02 20:25:08 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-06-03 20:22:10 +0900
commit4589056384cdc8ed7c8a99713b216b7176ff49b9 (patch)
tree200c1ac99ac72ec77cc65591e8718c95d62724ec /tool/lib
parent1bb7c3c447db5a13356ae83097773a7de572e69c (diff)
downloadruby-4589056384cdc8ed7c8a99713b216b7176ff49b9.tar.gz
Exit with a failure if any test files failed to load
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/test/unit.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 7604b4add9..9ce3c8b30a 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -813,6 +813,7 @@ module Test
warn ""
@warnings.uniq! {|w| w[1].message}
@warnings.each do |w|
+ @errors += 1
warn "#{w[0]}: #{w[1].message} (#{w[1].class})"
end
warn ""
@@ -1282,8 +1283,13 @@ module Test
puts "#{f}: #{$!}"
end
}
+ @load_failed = errors.size.nonzero?
result
end
+
+ def run(*)
+ super or @load_failed
+ end
end
module RepeatOption # :nodoc: all
@@ -1680,7 +1686,7 @@ module Test
break unless report.empty?
end
- return failures + errors if self.test_count > 0 # or return nil...
+ return (failures + errors).nonzero? # or return nil...
rescue Interrupt
abort 'Interrupted'
end