test/lib/config: group paths by persistence
Rearrange path constants such that persistent paths (that point into the Homebrew code base) are in one spot and all other paths (that are being redirected to a temporary location for the duration of the test run) are grouped together. Closes #440. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This commit is contained in:
parent
22a47af1a2
commit
9e021aa661
@ -10,12 +10,15 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k|
|
|||||||
ENV[k] = dir
|
ENV[k] = dir
|
||||||
}
|
}
|
||||||
|
|
||||||
HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")
|
# Paths pointing into the Homebrew code base that persist across test runs
|
||||||
HOMEBREW_REPOSITORY = HOMEBREW_PREFIX
|
|
||||||
HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library"
|
|
||||||
HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../..", __FILE__))
|
HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../..", __FILE__))
|
||||||
HOMEBREW_ENV_PATH = HOMEBREW_LIBRARY_PATH.parent+"ENV"
|
HOMEBREW_ENV_PATH = HOMEBREW_LIBRARY_PATH.parent+"ENV"
|
||||||
HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
|
HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
|
||||||
|
|
||||||
|
# Paths redirected to a temporary directory and wiped at the end of the test run
|
||||||
|
HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")
|
||||||
|
HOMEBREW_REPOSITORY = HOMEBREW_PREFIX
|
||||||
|
HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library"
|
||||||
HOMEBREW_CACHE = HOMEBREW_PREFIX.parent+"cache"
|
HOMEBREW_CACHE = HOMEBREW_PREFIX.parent+"cache"
|
||||||
HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
|
HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
|
||||||
HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX.parent+"locks"
|
HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX.parent+"locks"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user