aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorAlyssa Ross2016-09-19 23:00:58 +0100
committerAlyssa Ross2016-09-19 23:00:58 +0100
commitd3740ec34f1ad98311a3ac606643db972d5130e9 (patch)
tree57744f34aba64f88941ab97d040034af391637e6 /Library/Homebrew/dev-cmd
parente22610aedd550cb5577dd08cedb7a5609d0ff0b8 (diff)
downloadbrew-d3740ec34f1ad98311a3ac606643db972d5130e9.tar.bz2
tests: run in parallel
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/tests.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb
index aa2a3bff9..aba2fa3b6 100644
--- a/Library/Homebrew/dev-cmd/tests.rb
+++ b/Library/Homebrew/dev-cmd/tests.rb
@@ -6,7 +6,7 @@ require "tap"
module Homebrew
def tests
- (HOMEBREW_LIBRARY/"Homebrew/test").cd do
+ (HOMEBREW_LIBRARY/"Homebrew").cd do
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"
ENV["HOMEBREW_DEVELOPER"] = "1"
ENV["TESTOPTS"] = "-v" if ARGV.verbose?
@@ -19,9 +19,11 @@ module Homebrew
if ARGV.include? "--coverage"
ENV["HOMEBREW_TESTS_COVERAGE"] = "1"
- FileUtils.rm_f "coverage/.resultset.json"
+ FileUtils.rm_f "test/coverage/.resultset.json"
end
+ ENV["BUNDLE_GEMFILE"] = "#{Dir.pwd}/test/Gemfile"
+
# Override author/committer as global settings might be invalid and thus
# will cause silent failure during the setup of dummy Git repositories.
%w[AUTHOR COMMITTER].each do |role|
@@ -37,16 +39,18 @@ module Homebrew
# Make it easier to reproduce test runs.
ENV["SEED"] = ARGV.next if ARGV.include? "--seed"
+ files = Dir["test/test_*.rb"]
+ files -= Dir["test/test_os_mac_*.rb"] unless OS.mac?
args = []
args << "--trace" if ARGV.include? "--trace"
if ARGV.value("only")
ENV["HOMEBREW_TESTS_ONLY"] = "1"
test_name, test_method = ARGV.value("only").split("/", 2)
- args << "TEST=test_#{test_name}.rb"
- args << "TESTOPTS=--name=test_#{test_method}" if test_method
+ files = ["test/test_#{test_name}.rb"]
+ args << "--name=test_#{test_method}" if test_method
end
args += ARGV.named.select { |v| v[/^TEST(OPTS)?=/] }
- system "bundle", "exec", "rake", "test", *args
+ system "bundle", "exec", "parallel_test", "--", *args, "--", *files
Homebrew.failed = !$?.success?