diff options
| author | Martin Afanasjew | 2016-01-20 06:39:57 +0100 |
|---|---|---|
| committer | Martin Afanasjew | 2016-01-21 05:42:06 +0100 |
| commit | 0d1e72f55fbe34194c66da1edd6d6c37fc4adca6 (patch) | |
| tree | 8be6178ba4bae527c62505d2ede314d412b43ed6 /Library | |
| parent | a12c5816aa9d80755f65a4fe53e7d55888a914ac (diff) | |
| download | brew-0d1e72f55fbe34194c66da1edd6d6c37fc4adca6.tar.bz2 | |
tests: allow passing --seed <number>
This parameter is printed by every `brew tests` run and feeding it back
into the test suite allows to get an identical run. Make it easier to
do that by accepting the argument as it is printed during `brew tests`.
This requires a slight adjustment to named-argument passing as the
number that follows `--seed` is also seen as a named argument, but we
usually only want to pass `TEST=<something>` and `TESTOPTS=<something>`.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/tests.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/tests.rb b/Library/Homebrew/cmd/tests.rb index a796e2f38..27be1cd2f 100644 --- a/Library/Homebrew/cmd/tests.rb +++ b/Library/Homebrew/cmd/tests.rb @@ -22,9 +22,12 @@ module Homebrew system "bundle", "install", "--path", "vendor/bundle" end + # Make it easier to reproduce test runs. + ENV["SEED"] = ARGV.next if ARGV.include? "--seed" + args = [] args << "--trace" if ARGV.include? "--trace" - args += ARGV.named + args += ARGV.named.select { |v| v[/^TEST(OPTS)?=/] } system "bundle", "exec", "rake", "test", *args Homebrew.failed = !$?.success? |
