Merge pull request #1364 from reitermarkus/reorder-tests
Reorder and rename test files.
This commit is contained in:
commit
e6933b90dc
@ -21,7 +21,7 @@ Lint/HandleExceptions:
|
||||
- 'extend/pathname.rb'
|
||||
- 'formula.rb'
|
||||
- 'formula_versions.rb'
|
||||
- 'test/test_ENV.rb'
|
||||
- 'test/ENV_test.rb'
|
||||
|
||||
# Offense count: 3
|
||||
Lint/IneffectiveAccessModifier:
|
||||
@ -51,7 +51,7 @@ Lint/RescueException:
|
||||
- 'postinstall.rb'
|
||||
- 'readall.rb'
|
||||
- 'test.rb'
|
||||
- 'test/test_ENV.rb'
|
||||
- 'test/ENV_test.rb'
|
||||
- 'utils/fork.rb'
|
||||
|
||||
# Offense count: 1
|
||||
@ -90,7 +90,7 @@ Style/ClassVars:
|
||||
Exclude:
|
||||
- 'dev-cmd/audit.rb'
|
||||
- 'formula_installer.rb'
|
||||
- 'test/testing_env.rb'
|
||||
- 'test/support/helper/fs_leak_logger.rb'
|
||||
|
||||
# Offense count: 13
|
||||
# Configuration parameters: AllowedVariables.
|
||||
@ -114,7 +114,7 @@ Style/MultilineBlockChain:
|
||||
- 'dev-cmd/audit.rb'
|
||||
- 'dev-cmd/man.rb'
|
||||
- 'diagnostic.rb'
|
||||
- 'test/test_patching.rb'
|
||||
- 'test/patching_test.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# Cop supports --auto-correct.
|
||||
|
||||
@ -8,15 +8,15 @@ end
|
||||
|
||||
# add Homebrew to load path
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/lib"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/support/lib"))
|
||||
|
||||
require "global"
|
||||
|
||||
# add Homebrew-Cask to load path
|
||||
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
||||
|
||||
require "test/helper/env"
|
||||
require "test/helper/shutup"
|
||||
require "test/support/helper/env"
|
||||
require "test/support/helper/shutup"
|
||||
|
||||
Pathname.glob(HOMEBREW_LIBRARY_PATH.join("cask", "spec", "support", "*.rb")).each(&method(:require))
|
||||
|
||||
|
||||
@ -6,15 +6,15 @@ require "simplecov" if ENV["HOMEBREW_TESTS_COVERAGE"]
|
||||
|
||||
# add Homebrew to load path
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/lib"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/support/lib"))
|
||||
|
||||
require "global"
|
||||
|
||||
# add Homebrew-Cask to load path
|
||||
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
||||
|
||||
require "test/helper/env"
|
||||
require "test/helper/shutup"
|
||||
require "test/support/helper/env"
|
||||
require "test/support/helper/shutup"
|
||||
include Test::Helper::Env
|
||||
include Test::Helper::Shutup
|
||||
|
||||
|
||||
@ -761,7 +761,7 @@ class FormulaAuditor
|
||||
bin_names.each do |name|
|
||||
["system", "shell_output", "pipe_output"].each do |cmd|
|
||||
if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{Regexp.escape name}[\s'"]/m
|
||||
problem %(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}")
|
||||
problem %Q(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -8,7 +8,7 @@ module Homebrew
|
||||
module_function
|
||||
|
||||
def tests
|
||||
(HOMEBREW_LIBRARY/"Homebrew").cd do
|
||||
HOMEBREW_LIBRARY_PATH.cd do
|
||||
ENV.delete "HOMEBREW_VERBOSE"
|
||||
ENV.delete "VERBOSE"
|
||||
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"
|
||||
@ -44,8 +44,8 @@ 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?
|
||||
files = Dir.glob("test/**/*_test.rb")
|
||||
.reject { |p| !OS.mac? && p.start_with?("test/os/mac/") }
|
||||
|
||||
opts = []
|
||||
opts << "--serialize-stdout" if ENV["CI"]
|
||||
@ -54,20 +54,18 @@ module Homebrew
|
||||
args << "--trace" if ARGV.include? "--trace"
|
||||
|
||||
if ARGV.value("only")
|
||||
ENV["HOMEBREW_TESTS_ONLY"] = "1"
|
||||
test_name, test_method = ARGV.value("only").split("/", 2)
|
||||
files = ["test/test_#{test_name}.rb"]
|
||||
test_name, test_method = ARGV.value("only").split(":", 2)
|
||||
files = Dir.glob("test/{#{test_name},#{test_name}/**/*}_test.rb")
|
||||
args << "--name=test_#{test_method}" if test_method
|
||||
end
|
||||
|
||||
args += ARGV.named.select { |v| v[/^TEST(OPTS)?=/] }
|
||||
|
||||
system "bundle", "exec", "parallel_test", *opts,
|
||||
"--", *args, "--", *files
|
||||
system "bundle", "exec", "parallel_test", *opts, "--", *args, "--", *files
|
||||
|
||||
Homebrew.failed = !$?.success?
|
||||
|
||||
if (fs_leak_log = HOMEBREW_LIBRARY/"Homebrew/test/fs_leak_log").file?
|
||||
if (fs_leak_log = HOMEBREW_LIBRARY_PATH/"tmp/fs_leak.log").file?
|
||||
fs_leak_log_content = fs_leak_log.read
|
||||
unless fs_leak_log_content.empty?
|
||||
opoo "File leak is detected"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
require "testing_env"
|
||||
require "extend/ENV"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestEnv < IntegrationCommandTestCase
|
||||
def test_env
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestAnalytics < IntegrationCommandTestCase
|
||||
def test_analytics
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestBottle < IntegrationCommandTestCase
|
||||
def test_bottle
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestBundle < IntegrationCommandTestCase
|
||||
def test_bundle
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCacheFormula < IntegrationCommandTestCase
|
||||
def test_cache_formula
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCache < IntegrationCommandTestCase
|
||||
def test_cache
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCask < IntegrationCommandTestCase
|
||||
def test_cask
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCat < IntegrationCommandTestCase
|
||||
def test_cat
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCellarFormula < IntegrationCommandTestCase
|
||||
def test_cellar_formula
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCellar < IntegrationCommandTestCase
|
||||
def test_cellar
|
||||
@ -12,7 +12,7 @@ class ChecksumVerificationTests < Homebrew::TestCase
|
||||
|
||||
def formula(&block)
|
||||
super do
|
||||
url "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"
|
||||
url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
instance_eval(&block)
|
||||
end
|
||||
end
|
||||
@ -17,8 +17,8 @@ class CleanerTests < Homebrew::TestCase
|
||||
def test_clean_file
|
||||
@f.bin.mkpath
|
||||
@f.lib.mkpath
|
||||
cp "#{TEST_DIRECTORY}/mach/a.out", @f.bin
|
||||
cp Dir["#{TEST_DIRECTORY}/mach/*.dylib"], @f.lib
|
||||
cp "#{TEST_FIXTURE_DIR}/mach/a.out", @f.bin
|
||||
cp Dir["#{TEST_FIXTURE_DIR}/mach/*.dylib"], @f.lib
|
||||
|
||||
Cleaner.new(@f).clean
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
require "testing_env"
|
||||
require "testball"
|
||||
require "test/support/fixtures/testball"
|
||||
require "cleanup"
|
||||
require "fileutils"
|
||||
require "pathname"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCleanup < IntegrationCommandTestCase
|
||||
def test_cleanup
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCommand < IntegrationCommandTestCase
|
||||
def test_command
|
||||
@ -2,7 +2,7 @@ require "testing_env"
|
||||
require "cmd/command"
|
||||
require "cmd/commands"
|
||||
require "fileutils"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCommands < IntegrationCommandTestCase
|
||||
def test_commands
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestConfig < IntegrationCommandTestCase
|
||||
def test_config
|
||||
@ -1,8 +1,8 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCreate < IntegrationCommandTestCase
|
||||
def test_create
|
||||
url = "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||
url = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
cmd("create", url, "HOMEBREW_EDITOR" => "/bin/cat")
|
||||
|
||||
formula_file = CoreTap.new.formula_dir/"testball.rb"
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestCustomCommand < IntegrationCommandTestCase
|
||||
def test_custom_command
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestDeps < IntegrationCommandTestCase
|
||||
def test_deps
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestDesc < IntegrationCommandTestCase
|
||||
def test_desc
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestDoctor < IntegrationCommandTestCase
|
||||
def test_doctor
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestEdit < IntegrationCommandTestCase
|
||||
def test_edit
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestFetch < IntegrationCommandTestCase
|
||||
def test_fetch
|
||||
@ -3,8 +3,8 @@ require "formula"
|
||||
require "formula_installer"
|
||||
require "keg"
|
||||
require "tab"
|
||||
require "testball"
|
||||
require "testball_bottle"
|
||||
require "test/support/fixtures/testball"
|
||||
require "test/support/fixtures/testball_bottle"
|
||||
|
||||
class InstallBottleTests < Homebrew::TestCase
|
||||
def temporary_bottle_install(formula)
|
||||
@ -3,8 +3,8 @@ require "formula"
|
||||
require "formula_installer"
|
||||
require "keg"
|
||||
require "tab"
|
||||
require "testball"
|
||||
require "testball_bottle"
|
||||
require "test/support/fixtures/testball"
|
||||
require "test/support/fixtures/testball_bottle"
|
||||
|
||||
class InstallTests < Homebrew::TestCase
|
||||
def temporary_install(formula)
|
||||
@ -1,5 +1,5 @@
|
||||
require "testing_env"
|
||||
require "testball"
|
||||
require "test/support/fixtures/testball"
|
||||
require "formula"
|
||||
|
||||
class FormulaTests < Homebrew::TestCase
|
||||
@ -18,11 +18,11 @@ class FormularyFactoryTest < Homebrew::TestCase
|
||||
def setup
|
||||
@name = "testball_bottle"
|
||||
@path = CoreTap.new.formula_dir/"#{@name}.rb"
|
||||
@bottle_dir = Pathname.new("#{File.expand_path("..", __FILE__)}/bottles")
|
||||
@bottle_dir = Pathname.new("#{TEST_FIXTURE_DIR}/bottles")
|
||||
@bottle = @bottle_dir/"testball_bottle-0.1.#{Utils::Bottles.tag}.bottle.tar.gz"
|
||||
@path.write <<-EOS.undent
|
||||
class #{Formulary.class_s(@name)} < Formula
|
||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||
url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
sha256 TESTBALL_SHA256
|
||||
|
||||
bottle do
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestHelp < IntegrationCommandTestCase
|
||||
def test_help
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestHome < IntegrationCommandTestCase
|
||||
def test_home
|
||||
@ -1,7 +1,7 @@
|
||||
require "testing_env"
|
||||
require "cmd/info"
|
||||
require "formula"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestInfo < IntegrationCommandTestCase
|
||||
def test_info
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestInstall < IntegrationCommandTestCase
|
||||
def test_install
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestIrb < IntegrationCommandTestCase
|
||||
def test_irb
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestLeaves < IntegrationCommandTestCase
|
||||
def test_leaves
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestLink < IntegrationCommandTestCase
|
||||
def test_link
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestLinkapps < IntegrationCommandTestCase
|
||||
def test_linkapps
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestList < IntegrationCommandTestCase
|
||||
def test_list
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestLogFormula < IntegrationCommandTestCase
|
||||
def test_log_formula
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestLog < IntegrationCommandTestCase
|
||||
def test_log
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestMigrate < IntegrationCommandTestCase
|
||||
def test_migrate
|
||||
@ -1,6 +1,6 @@
|
||||
require "testing_env"
|
||||
require "migrator"
|
||||
require "testball"
|
||||
require "test/support/fixtures/testball"
|
||||
require "tab"
|
||||
require "keg"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestMissing < IntegrationCommandTestCase
|
||||
def setup
|
||||
@ -1,6 +1,6 @@
|
||||
require "testing_env"
|
||||
require "options"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestOptions < IntegrationCommandTestCase
|
||||
def test_options
|
||||
@ -41,7 +41,7 @@ class MachOPathnameTests < Homebrew::TestCase
|
||||
end
|
||||
|
||||
def test_mach_o_executable
|
||||
pn = Pathname.new("#{TEST_DIRECTORY}/mach/a.out")
|
||||
pn = Pathname.new("#{TEST_FIXTURE_DIR}/mach/a.out")
|
||||
assert_predicate pn, :universal?
|
||||
refute_predicate pn, :i386?
|
||||
refute_predicate pn, :x86_64?
|
||||
@ -93,7 +93,7 @@ class MachOPathnameTests < Homebrew::TestCase
|
||||
end
|
||||
|
||||
def test_non_mach_o
|
||||
pn = Pathname.new("#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz")
|
||||
pn = Pathname.new("#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz")
|
||||
refute_predicate pn, :universal?
|
||||
refute_predicate pn, :i386?
|
||||
refute_predicate pn, :x86_64?
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestOutdated < IntegrationCommandTestCase
|
||||
def test_outdated
|
||||
@ -2,12 +2,12 @@ require "testing_env"
|
||||
require "formula"
|
||||
|
||||
class PatchingTests < Homebrew::TestCase
|
||||
TESTBALL_URL = "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz".freeze
|
||||
TESTBALL_PATCHES_URL = "file://#{TEST_DIRECTORY}/tarballs/testball-0.1-patches.tgz".freeze
|
||||
PATCH_URL_A = "file://#{TEST_DIRECTORY}/patches/noop-a.diff".freeze
|
||||
PATCH_URL_B = "file://#{TEST_DIRECTORY}/patches/noop-b.diff".freeze
|
||||
PATCH_A_CONTENTS = File.read "#{TEST_DIRECTORY}/patches/noop-a.diff"
|
||||
PATCH_B_CONTENTS = File.read "#{TEST_DIRECTORY}/patches/noop-b.diff"
|
||||
TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz".freeze
|
||||
TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz".freeze
|
||||
PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff".freeze
|
||||
PATCH_URL_B = "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff".freeze
|
||||
PATCH_A_CONTENTS = File.read "#{TEST_FIXTURE_DIR}/patches/noop-a.diff"
|
||||
PATCH_B_CONTENTS = File.read "#{TEST_FIXTURE_DIR}/patches/noop-b.diff"
|
||||
APPLY_A = "noop-a.diff".freeze
|
||||
APPLY_B = "noop-b.diff".freeze
|
||||
APPLY_C = "noop-c.diff".freeze
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestPinUnpin < IntegrationCommandTestCase
|
||||
def test_pin_unpin
|
||||
@ -1,4 +1,4 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
|
||||
class IntegrationCommandTestPrefixFormula < IntegrationCommandTestCase
|
||||
def test_prefix_formula
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user