aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMax Howell2009-11-09 17:44:29 +0000
committerMax Howell2009-11-09 17:55:11 +0000
commit1da26d89ea2d2cf5a45c8852288291de6a13d184 (patch)
treecd44ce759119c1e51709bf43424c463bf9295999 /Library/Homebrew/test
parent590f64e302d99b02c28bac383752f8190f6a02c6 (diff)
downloadbrew-1da26d89ea2d2cf5a45c8852288291de6a13d184.tar.bz2
Don't use Kernel.system much
It just seems to behave strangely with SIGINT. Eg. SIGINT causes tar to exit, but the SIGINT is ignored by our process. This is not the case when used with curl.
Diffstat (limited to 'Library/Homebrew/test')
-rwxr-xr-xLibrary/Homebrew/test/unittest.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/Library/Homebrew/test/unittest.rb b/Library/Homebrew/test/unittest.rb
index bfa84bfd9..90d9ecdbc 100755
--- a/Library/Homebrew/test/unittest.rb
+++ b/Library/Homebrew/test/unittest.rb
@@ -30,6 +30,24 @@ MACOS_VERSION=10.6
Dir.chdir HOMEBREW_PREFIX
at_exit { HOMEBREW_PREFIX.parent.rmtree }
+# for some reason our utils.rb safe_system behaves completely differently
+# during these tests. This is worrying for sure.
+def safe_system *args
+ Kernel.system *args
+end
+
+class ExecutionError <RuntimeError
+ attr :status
+
+ def initialize cmd, args=[], status=nil
+ super "Failure while executing: #{cmd} #{args*' '}"
+ @status = status
+ end
+end
+
+class BuildError <ExecutionError
+end
+
require 'test/unit' # must be after at_exit
require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
ARGV.extend(HomebrewArgvExtension)