From 115aafb9ebd584728ee822ab5804840aa5089497 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 10 Mar 2020 09:21:30 +0000 Subject: [PATCH] formula_assertions: print output on assertion failed. When doing `brew test --verbose` (as `brew test-bot` does) ensure that the output is printed when an assertion fails to more easily debug the test failure. --- Library/Homebrew/formula_assertions.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index 06e34a00c8..acb428ae98 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -11,6 +11,9 @@ module Homebrew output = `#{cmd}` assert_equal result, $CHILD_STATUS.exitstatus output + rescue Test::Unit::AssertionFailedError + puts output if Homebrew.args.verbose? + raise end # Returns the output of running the cmd with the optional input, and @@ -24,6 +27,9 @@ module Homebrew end assert_equal result, $CHILD_STATUS.exitstatus unless result.nil? output + rescue Test::Unit::AssertionFailedError + puts output if Homebrew.args.verbose? + raise end end end