'brew test' now an official command

This commit is contained in:
Adam Vandenberg 2011-03-10 21:28:49 -08:00
parent f0b6f6853a
commit bda9ffa5d7
2 changed files with 24 additions and 23 deletions

View File

@ -1,23 +0,0 @@
require 'extend/ENV'
ENV.extend(HomebrewEnvExtension)
ARGV.formulae.each do |f|
# Cannot test uninstalled formulae
unless f.installed?
puts "#{f.name} not installed"
next
end
# Cannot test formulae without a test method
unless f.respond_to? :test
puts "#{f.name} defines no test"
next
end
puts "Testing #{f.name}"
begin
f.test
rescue
puts "#{f.name}: failed"
end
end

View File

@ -0,0 +1,24 @@
module Homebrew extend self
def test
ARGV.formulae.each do |f|
# Cannot test uninstalled formulae
unless f.installed?
puts "#{f.name} not installed"
next
end
# Cannot test formulae without a test method
unless f.respond_to? :test
puts "#{f.name} defines no test"
next
end
puts "Testing #{f.name}"
begin
f.test
rescue
puts "#{f.name}: failed"
end
end
end
end