aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/testing_env.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2010-04-03 08:44:41 -0700
committerAdam Vandenberg2010-06-10 12:57:51 -0700
commit1761ba66bfca0784d49de10bd684cc54d53fded8 (patch)
treecd8ce5cb705d7e53a504262cc1914bb532d98be5 /Library/Homebrew/test/testing_env.rb
parent914a068dc8cc9f84188a4a8b194336c632744058 (diff)
downloadbrew-1761ba66bfca0784d49de10bd684cc54d53fded8.tar.bz2
Failures during ./configure should mention config.log.
Diffstat (limited to 'Library/Homebrew/test/testing_env.rb')
-rw-r--r--Library/Homebrew/test/testing_env.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index 0f243607e..dbe3d1687 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -26,15 +26,21 @@ at_exit { HOMEBREW_PREFIX.parent.rmtree }
# Test fixtures and files can be found relative to this path
TEST_FOLDER = Pathname.new(ABS__FILE__).parent.realpath
-
+# Note: These exceptions duplicate those defined in globals.
+# Perhaps the same definitions should be used in both places.
class ExecutionError <RuntimeError
- attr :exit_status
+ attr :exit_status, :command
def initialize cmd, args = [], es = nil
+ @command = cmd
super "Failure while executing: #{cmd} #{pretty(args)*' '}"
@exit_status = es.exitstatus rescue 1
end
+ def was_running_configure?
+ @command == './configure'
+ end
+
private
def pretty args
@@ -49,6 +55,12 @@ class ExecutionError <RuntimeError
end
class BuildError <ExecutionError
+ attr :env
+
+ def initialize cmd, args = [], es = nil
+ super
+ @env = ENV.to_hash
+ end
end
require 'test/unit' # must be after at_exit