diff options
context:
space:
mode:
Diffstat (limited to 'tests/t0001-git-version.sh')
-rwxr-xr-xtests/t0001-git-version.sh9
1 file changed, 5 insertions, 4 deletions
diff --git a/tests/t0001-git-version.sh b/tests/t0001-git-version.sh
index 8436812..7dd9c40 100755
--- a/tests/t0001-git-version.sh
+++ b/tests/t0001-git-version.sh
@@ -20,14 +20,15 @@ test_expect_success 'extract Git version from Makefile' '
sed -n -e "/^GIT_VERSION[ ]*=/ {
s/^GIT_VERSION[ ]*=[ ]*//
p
- }" ../../Makefile >makefile_version
+ }" "$TEST_OUTPUT_DIRECTORY/../Makefile" >makefile_version
'
# Git's GIT-VERSION-GEN script applies "s/-/./g" to the version string on its
# way into the GIT-VERSION-FILE, so the same has to be done to the version in
# the Makefile before the two can be compared.
test_expect_success 'test Git version matches Makefile' '
- ( cat ../../vendor/git/GIT-VERSION-FILE || echo "No GIT-VERSION-FILE" ) |
+ ( cat "$TEST_OUTPUT_DIRECTORY/../vendor/git/GIT-VERSION-FILE" ||
+ echo "No GIT-VERSION-FILE" ) |
sed -e "s/GIT_VERSION[ ]*=[ ]*//" -e "s/\\.dirty$//" >git_version &&
sed -e "s/-/./g" makefile_version >makefile_git_version &&
test_cmp git_version makefile_git_version
@@ -36,12 +37,12 @@ test_expect_success 'test Git version matches Makefile' '
# A tree unpacked from a tarball has no submodule pin to describe, so there is
# nothing to compare against and the test says so rather than failing.
test_expect_success 'test submodule version matches Makefile' '
- if ! test -e ../../vendor/git/.git
+ if ! test -e "$TEST_OUTPUT_DIRECTORY/../vendor/git/.git"
then
echo "vendor/git/ is not a Git repository" >&2
else
(
- cd ../.. &&
+ cd "$TEST_OUTPUT_DIRECTORY/.." &&
submodule_oid=$(git ls-files --stage -- vendor/git |
sed -e "s/^[0-9]* \\([0-9a-f]*\\) [0-9] .*$/\\1/") &&
cd vendor/git &&