diff --git a/Library/Homebrew/test/.simplecov b/Library/Homebrew/test/.simplecov index e6db2ca62c..21c6acc18a 100644 --- a/Library/Homebrew/test/.simplecov +++ b/Library/Homebrew/test/.simplecov @@ -13,8 +13,8 @@ SimpleCov.start do add_filter "Homebrew/vendor/" end -if name = ENV["HOMEBREW_INTEGRATION_TEST"] - SimpleCov.command_name "brew #{name}" +if ENV["HOMEBREW_INTEGRATION_TEST"] + SimpleCov.command_name ENV["HOMEBREW_INTEGRATION_TEST"] SimpleCov.at_exit do exit_code = $!.nil? ? 0 : $!.status $stdout.reopen("/dev/null") diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb index 3732602508..78b268a27d 100644 --- a/Library/Homebrew/test/test_integration_cmds.rb +++ b/Library/Homebrew/test/test_integration_cmds.rb @@ -4,6 +4,16 @@ require "core_formula_repository" require "fileutils" class IntegrationCommandTests < Homebrew::TestCase + def setup + @cmd_id_index = 0 # Assign unique IDs to invocations of `cmd_output`. + end + + def cmd_id_from_args(args) + args_pretty = args.join(" ").gsub(TEST_TMPDIR, "@TMPDIR@") + test_pretty = "#{self.class.name}\##{name}.#{@cmd_id_index += 1}" + "[#{test_pretty}] brew #{args_pretty}" + end + def cmd_output(*args) # 1.8-compatible way of writing def cmd_output(*args, **env) env = args.last.is_a?(Hash) ? args.pop : {} @@ -18,7 +28,7 @@ class IntegrationCommandTests < Homebrew::TestCase cmd_args += args Bundler.with_original_env do ENV["HOMEBREW_BREW_FILE"] = HOMEBREW_PREFIX/"bin/brew" - ENV["HOMEBREW_INTEGRATION_TEST"] = args.join " " + ENV["HOMEBREW_INTEGRATION_TEST"] = cmd_id_from_args(args) ENV["HOMEBREW_TEST_TMPDIR"] = TEST_TMPDIR env.each_pair { |k,v| ENV[k] = v }