External command 'brew test'.
This commit is contained in:
		
							parent
							
								
									0aed492572
								
							
						
					
					
						commit
						b583d0ae48
					
				
							
								
								
									
										20
									
								
								Library/Contributions/examples/brew-test.rb
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										20
									
								
								Library/Contributions/examples/brew-test.rb
									
									
									
									
									
										Executable file
									
								
							@ -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
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user