2014-06-18 22:41:47 -05:00
|
|
|
module Homebrew
|
2012-04-16 16:44:11 -05:00
|
|
|
def tests
|
2015-01-02 12:42:02 +00:00
|
|
|
(HOMEBREW_LIBRARY/"Homebrew/test").cd do
|
|
|
|
ENV["TESTOPTS"] = "-v" if ARGV.verbose?
|
2015-07-21 15:02:15 +08:00
|
|
|
ENV["HOMEBREW_TESTS_COVERAGE"] = "1" if ARGV.include? "--coverage"
|
2015-07-22 17:09:23 +08:00
|
|
|
ENV["HOMEBREW_NO_COMPAT"] = "1" if ARGV.include? "--no-compat"
|
2015-12-23 00:34:19 +01:00
|
|
|
|
2015-01-02 12:42:02 +00:00
|
|
|
Homebrew.install_gem_setup_path! "bundler"
|
2015-12-23 00:34:19 +01:00
|
|
|
unless quiet_system("bundle", "check")
|
|
|
|
system "bundle", "install", "--path", "vendor/bundle"
|
|
|
|
end
|
|
|
|
|
|
|
|
args = []
|
|
|
|
args << "--trace" if ARGV.include? "--trace"
|
|
|
|
args += ARGV.named
|
|
|
|
system "bundle", "exec", "rake", "test", *args
|
|
|
|
|
2015-01-02 13:36:01 +00:00
|
|
|
Homebrew.failed = !$?.success?
|
2015-12-23 00:34:19 +01:00
|
|
|
|
2015-07-22 16:04:59 +08:00
|
|
|
if (fs_leak_log = HOMEBREW_LIBRARY/"Homebrew/test/fs_leak_log").file?
|
|
|
|
fs_leak_log_content = fs_leak_log.read
|
|
|
|
unless fs_leak_log_content.empty?
|
|
|
|
opoo "File leak is detected"
|
|
|
|
puts fs_leak_log_content
|
|
|
|
Homebrew.failed = true
|
|
|
|
end
|
|
|
|
end
|
2012-04-16 16:44:11 -05:00
|
|
|
end
|
|
|
|
end
|
2012-03-25 00:49:18 +11:00
|
|
|
end
|