aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Kao2016-07-19 08:23:44 -0700
committerMartin Afanasjew2016-07-19 17:23:44 +0200
commit4b40a87ca40f878affdfb9d2464ec8ea1246d9d2 (patch)
tree0238ce8be710444768ca23f1cd45c85cf1adc4e3
parent5768e32ad20208e8c5c1029ef2c9b47abd2caa2d (diff)
downloadbrew-4b40a87ca40f878affdfb9d2464ec8ea1246d9d2.tar.bz2
tests: nest HOMEBREW_TEMP inside TEST_TMPDIR (#554)
-rw-r--r--Library/Homebrew/test/lib/config.rb4
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb1
-rw-r--r--Library/Homebrew/test/testing_env.rb2
3 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/test/lib/config.rb b/Library/Homebrew/test/lib/config.rb
index 062bed33b..5818aec41 100644
--- a/Library/Homebrew/test/lib/config.rb
+++ b/Library/Homebrew/test/lib/config.rb
@@ -2,10 +2,9 @@ require "tmpdir"
require "pathname"
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|
- dir = Dir.mktmpdir("homebrew_tests", HOMEBREW_TEMP)
+ dir = Dir.mktmpdir("homebrew-tests-", ENV["HOMEBREW_TEMP"] || "/tmp")
at_exit { FileUtils.remove_entry(dir) }
ENV[k] = dir
}
@@ -24,6 +23,7 @@ HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX.parent+"locks"
HOMEBREW_CELLAR = HOMEBREW_PREFIX.parent+"cellar"
HOMEBREW_LOGS = HOMEBREW_PREFIX.parent+"logs"
+HOMEBREW_TEMP = HOMEBREW_PREFIX.parent+"temp"
TESTBALL_SHA1 = "be478fd8a80fe7f29196d6400326ac91dad68c37"
TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b"
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index c020deaf4..07068019f 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -18,6 +18,7 @@ class IntegrationCommandTests < Homebrew::TestCase
HOMEBREW_CACHE.children,
HOMEBREW_LOCK_DIR.children,
HOMEBREW_LOGS.children,
+ HOMEBREW_TEMP.children,
HOMEBREW_PREFIX/"bin",
HOMEBREW_PREFIX/"share",
HOMEBREW_PREFIX/"opt",
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index 887cb2dbb..72847953d 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -7,7 +7,7 @@ require "formulary"
# Test environment setup
(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_DIRECTORY = File.dirname(File.expand_path(__FILE__))