Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Library/Homebrew/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@
ENV.setup_build_environment(formula:, testing_formula: true)
Pathname.activate_extensions!

# tests can also return false to indicate failure
run_test = proc do |_|
# TODO: Replace proc usage with direct `formula.run_test` when removing this.
# Also update formula.rb 'TODO: replace `returns(BasicObject)` with `void`'
if formula.run_test(keep_tmp: args.keep_tmp?) == false
require "utils/output"
Utils::Output.odeprecated "`return false` in test", "`raise \"<reason for failure>\"`"
raise "test returned false"
Utils::Output.odisabled "`return false` in test", "`raise \"<reason for failure>\"`"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to handle this in the follow-up PR that removes the proc wrapper. Adding caller: here is tricky because of define_method, so a redesign later will be cleaner.

Comment thread
MikeMcQuaid marked this conversation as resolved.
end
Comment thread
MikeMcQuaid marked this conversation as resolved.
end
if args.debug? # --debug is interactive
Expand Down
Loading