aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-06-29 21:51:26 -0700
committerAdam Vandenberg2010-06-30 07:27:23 -0700
commitadc9daea742bac321f9f411f9bb106d765f57eaa (patch)
tree55f0b4051661c2823c01a5d28a0fa458bc39a37b /Library
parent02aa0dfddcfb874853c14d1877b2de604f5af316 (diff)
downloadhomebrew-adc9daea742bac321f9f411f9bb106d765f57eaa.tar.bz2
External command 'brew test'.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-test.rb20
1 files changed, 20 insertions, 0 deletions
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