diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-06-02 20:25:08 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2023-06-03 20:22:10 +0900 |
commit | 4589056384cdc8ed7c8a99713b216b7176ff49b9 (patch) | |
tree | 200c1ac99ac72ec77cc65591e8718c95d62724ec /tool/lib | |
parent | 1bb7c3c447db5a13356ae83097773a7de572e69c (diff) |
Exit with a failure if any test files failed to load
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7897
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/test/unit.rb | 8 |
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 |