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>`.
This commit is contained in:
		
							parent
							
								
									a12c5816aa
								
							
						
					
					
						commit
						0d1e72f55f
					
				@ -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?
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user