Skip to content
Snippets Groups Projects
Commit 4b40a87c authored by Andrea Kao's avatar Andrea Kao Committed by Martin Afanasjew
Browse files

tests: nest HOMEBREW_TEMP inside TEST_TMPDIR (#554)

parent 5768e32a
No related branches found
No related tags found
No related merge requests found
...@@ -2,10 +2,9 @@ require "tmpdir" ...@@ -2,10 +2,9 @@ require "tmpdir"
require "pathname" require "pathname"
HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]) HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"])
HOMEBREW_TEMP = Pathname.new(ENV["HOMEBREW_TEMP"] || Dir.tmpdir)
TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k| TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k|
dir = Dir.mktmpdir("homebrew_tests", HOMEBREW_TEMP) dir = Dir.mktmpdir("homebrew-tests-", ENV["HOMEBREW_TEMP"] || "/tmp")
at_exit { FileUtils.remove_entry(dir) } at_exit { FileUtils.remove_entry(dir) }
ENV[k] = dir ENV[k] = dir
} }
...@@ -24,6 +23,7 @@ HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache" ...@@ -24,6 +23,7 @@ HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX.parent+"locks" HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX.parent+"locks"
HOMEBREW_CELLAR = HOMEBREW_PREFIX.parent+"cellar" HOMEBREW_CELLAR = HOMEBREW_PREFIX.parent+"cellar"
HOMEBREW_LOGS = HOMEBREW_PREFIX.parent+"logs" HOMEBREW_LOGS = HOMEBREW_PREFIX.parent+"logs"
HOMEBREW_TEMP = HOMEBREW_PREFIX.parent+"temp"
TESTBALL_SHA1 = "be478fd8a80fe7f29196d6400326ac91dad68c37" TESTBALL_SHA1 = "be478fd8a80fe7f29196d6400326ac91dad68c37"
TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b" TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b"
......
...@@ -18,6 +18,7 @@ class IntegrationCommandTests < Homebrew::TestCase ...@@ -18,6 +18,7 @@ class IntegrationCommandTests < Homebrew::TestCase
HOMEBREW_CACHE.children, HOMEBREW_CACHE.children,
HOMEBREW_LOCK_DIR.children, HOMEBREW_LOCK_DIR.children,
HOMEBREW_LOGS.children, HOMEBREW_LOGS.children,
HOMEBREW_TEMP.children,
HOMEBREW_PREFIX/"bin", HOMEBREW_PREFIX/"bin",
HOMEBREW_PREFIX/"share", HOMEBREW_PREFIX/"share",
HOMEBREW_PREFIX/"opt", HOMEBREW_PREFIX/"opt",
......
...@@ -7,7 +7,7 @@ require "formulary" ...@@ -7,7 +7,7 @@ require "formulary"
# Test environment setup # Test environment setup
(HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-core/Formula").mkpath (HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-core/Formula").mkpath
%w[cache formula_cache locks cellar logs].each { |d| HOMEBREW_PREFIX.parent.join(d).mkpath } %w[cache formula_cache locks cellar logs temp].each { |d| HOMEBREW_PREFIX.parent.join(d).mkpath }
# Test fixtures and files can be found relative to this path # Test fixtures and files can be found relative to this path
TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__)) TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment