From 4ab4c1d0ba31d437e05792719fba664a94521819 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Thu, 31 May 2018 02:52:43 +0200 Subject: git-receiver: allow users to define builds dir --- tests/blogc-git-receiver/check_post_receive.sh.in | 2 +- tests/blogc-git-receiver/check_pre_receive.sh.in | 5 +++-- tests/blogc-git-receiver/check_settings.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'tests') 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 = -- cgit v1.2.3-18-g5258