aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-05-31 02:52:43 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-05-31 02:52:43 +0200
commit4ab4c1d0ba31d437e05792719fba664a94521819 (patch)
tree953bf2925e1c96f95be28132a5459b82bd5a51bf /tests
parent56e07b6224fce7e213bfb9b4d00b93628a50aca7 (diff)
downloadblogc-4ab4c1d0ba31d437e05792719fba664a94521819.tar.gz
blogc-4ab4c1d0ba31d437e05792719fba664a94521819.tar.bz2
blogc-4ab4c1d0ba31d437e05792719fba664a94521819.zip
git-receiver: allow users to define builds dir
Diffstat (limited to 'tests')
-rwxr-xr-xtests/blogc-git-receiver/check_post_receive.sh.in2
-rwxr-xr-xtests/blogc-git-receiver/check_pre_receive.sh.in5
-rw-r--r--tests/blogc-git-receiver/check_settings.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/tests/blogc-git-receiver/check_post_receive.sh.in b/tests/blogc-git-receiver/check_post_receive.sh.in
index f0dde80..74d4df2 100755
--- a/tests/blogc-git-receiver/check_post_receive.sh.in
+++ b/tests/blogc-git-receiver/check_post_receive.sh.in
@@ -110,7 +110,7 @@ mirror = ${TEMP}/repos/bar6.git
mirror = lol
EOF
git init --bare "${TEMP}/repos/bar6.git" &> /dev/null
-BLOGC_GIT_RECEIVER_BASEDIR="${TEMP}" ${TESTS_ENVIRONMENT} ./repos/foo.git/hooks/post-receive 2>&1 | tee "${TEMP}/output.txt"
+BLOGC_GIT_RECEIVER_BASE_DIR="${TEMP}" ${TESTS_ENVIRONMENT} ./repos/foo.git/hooks/post-receive 2>&1 | tee "${TEMP}/output.txt"
grep "[new branch] *master" "${TEMP}/output.txt" &> /dev/null
rm "${TEMP}/output.txt"
diff --git a/tests/blogc-git-receiver/check_pre_receive.sh.in b/tests/blogc-git-receiver/check_pre_receive.sh.in
index 4a670e1..2a9aa91 100755
--- a/tests/blogc-git-receiver/check_pre_receive.sh.in
+++ b/tests/blogc-git-receiver/check_pre_receive.sh.in
@@ -100,7 +100,7 @@ symlink = ${TEMP}/chunda
symlink = ${TEMP}/guda
EOF
-SHELL="${SELF}" HOME="${TEMP}" GIT_DIR=. ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt"
+SHELL="${SELF}" HOME="${TEMP}" GIT_DIR=. BLOGC_GIT_RECEIVER_BUILDS_DIR="${TEMP}/foooo" ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt"
grep "echo lol" "${TEMP}/output.txt" &> /dev/null
[[ -h "${TEMP}/chunda" ]]
@@ -108,6 +108,7 @@ grep "echo lol" "${TEMP}/output.txt" &> /dev/null
DEST="$(readlink "${TEMP}/chunda")"
[[ -e "${DEST}" ]]
+[[ "${DEST}" == "${TEMP}/foooo/"* ]]
cd "${TEMP}"
git init --bare "${TEMP}/repos/foo2a.git" &> /dev/null
@@ -278,7 +279,7 @@ EOF
0000000000000000000000000000000000000000 $(git rev-parse HEAD) refs/heads/master
EOF
- SHELL="${SELF}" BLOGC_GIT_RECEIVER_BASEDIR="${TEMP}" PATH="@abs_top_builddir@:${PATH}" GIT_DIR=. ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" || true
+ SHELL="${SELF}" BLOGC_GIT_RECEIVER_BASE_DIR="${TEMP}" PATH="@abs_top_builddir@:${PATH}" GIT_DIR=. ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" || true
grep "blogc-make: error: settings: " "${TEMP}/output.txt" &> /dev/null
fi
diff --git a/tests/blogc-git-receiver/check_settings.c b/tests/blogc-git-receiver/check_settings.c
index 63caa0c..3c757b2 100644
--- a/tests/blogc-git-receiver/check_settings.c
+++ b/tests/blogc-git-receiver/check_settings.c
@@ -59,7 +59,7 @@ test_settings_get_section(void **state)
free(s);
bc_config_free(config);
- setenv("BLOGC_GIT_RECEIVER_BASEDIR", "/home/bola", 1);
+ setenv("BLOGC_GIT_RECEIVER_BASE_DIR", "/home/bola", 1);
will_return(__wrap_realpath, NULL);
will_return(__wrap_realpath, "/home/bola/repos/asd/bar.git");
conf =