[PATCH 1/3] Testing: XDG config files: Export a suitable `XDG_CONFIG_HOME' environment variable
- From
Michael Witten <mfwitten@gmail.com>
- Date
- Jul 17, 2012, 16:04 UTC
- Message-ID
- <679ad82bd4604d1c903f3c2fff2a8cfb-mfwitten@gmail.com>
- In-Reply-To
- <82316e5034d940e09fed719ae7bfdc3b-mfwitten@gmail.com>
The tests in:
t/t1306-xdg-files.sh
were failing because the git commands were using the environment variable `XDG_CONFIG_HOME' as it was set for the user's usual environment, rather than as set for the testing environment.
This commit provides the quickest, simplest hack to make things work; because there is already the setting and exporting of the environment variable `HOME' in:
t/test-lib.sh
this commit simply adds to that file the setting and exporting of the variable `XDG_CONFIG_HOME' (based on the variable `HOME' that is provided there).
However, the existing tests [sometimes] don't use these variables explicitly, so the whole structure of this testing rests on the hope that people maintain the conventions captured by the values of these variables; another commit should fix this instability by using these variables explicitly.
(Note: Double quotes are not needed around the value assigned to the variable, as word splitting is not performed).
Signed-off-by: Michael Witten <mfwitten@gmail.com> --- t/test-lib.sh | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh index acda33d..69bcc75 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -544,6 +544,9 @@ rm -fr "$test" || { HOME="$TRASH_DIRECTORY" export HOME +XDG_CONFIG_HOME=$HOME/.config +export XDG_CONFIG_HOME + if test -z "$TEST_NO_CREATE_REPO"; then test_create_repo "$test" else
-- 1.7.11.1.29.gf71be5c