From adc9daea742bac321f9f411f9bb106d765f57eaa Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Tue, 29 Jun 2010 21:51:26 -0700 Subject: External command 'brew test'. --- Library/Contributions/examples/brew-test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 Library/Contributions/examples/brew-test.rb (limited to 'Library') diff --git a/Library/Contributions/examples/brew-test.rb b/Library/Contributions/examples/brew-test.rb new file mode 100755 index 000000000..ac57a317a --- /dev/null +++ b/Library/Contributions/examples/brew-test.rb @@ -0,0 +1,20 @@ +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 -- cgit v1.2.3