aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
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