diff --git a/bashbot.sh b/bashbot.sh index fe607b3..4c258d3 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -10,7 +10,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.70-dev-18-g7512681 +#### $$VERSION$$ 0.70-dev-19-g3183419 # # Exit Codes: # - 0 sucess (hopefully) @@ -82,7 +82,7 @@ fi BOTACL="./botacl" if [ ! -f "${BOTACL}" ]; then echo -e "${ORANGE}Create empty ${BOTACL} file.${NC}" - touch "${BOTACL}" + echo "" >"${BOTACL}" fi TMPDIR="./tmp-bot-bash" @@ -97,7 +97,7 @@ fi COUNTFILE="./count" if [ ! -f "${COUNTFILE}" ]; then - touch "${COUNTFILE}" + echo "" >"${COUNTFILE}" elif [ ! -w "${COUNTFILE}" ]; then ${CLEAR} echo -e "${RED}ERROR: Can't write to ${COUNTFILE}!.${NC}" diff --git a/test/ALL-tests.sh b/test/ALL-tests.sh index ff540e0..2c06344 100755 --- a/test/ALL-tests.sh +++ b/test/ALL-tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # this has to run once atfer git clone # and every time we create new hooks -#### $$VERSION$$ 0.70-dev-18-g7512681 +#### $$VERSION$$ 0.70-dev-19-g3183419 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script @@ -40,11 +40,12 @@ done if [ "$fail" -eq 0 ]; then /bin/echo -n 'SUCCESS ' exitcode=0 + rm -rf "${TESTENV}" else /bin/echo -n 'FAILURE ' exitcode=1 + echo "To analyse error see ${TESTENV}" fi -#rm -rf "${TESTENV}" echo "${passed} / ${tests}" exit ${exitcode} diff --git a/test/a-commit-test.sh b/test/a-commit-test.sh index 7c4182f..51cafcb 100755 --- a/test/a-commit-test.sh +++ b/test/a-commit-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-18-g7512681 +#### $$VERSION$$ 0.70-dev-19-g3183419 ../dev/hooks/pre-commit.sh diff --git a/test/a-push-test.sh b/test/a-push-test.sh index 8505afa..9a7b754 100755 --- a/test/a-push-test.sh +++ b/test/a-push-test.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-18-g7512681 +#### $$VERSION$$ 0.70-dev-19-g3183419 ../dev/hooks/pre-push.sh diff --git a/test/c-init-test.sh b/test/c-init-test.sh index 3933216..c586dc4 100755 --- a/test/c-init-test.sh +++ b/test/c-init-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-18-g7512681 +#### $$VERSION$$ 0.70-dev-19-g3183419 TESTME="$(basename "$0")" DIRME="$(pwd)" @@ -33,13 +33,15 @@ EOF echo "OK" # compare files with refrence files -echo "Check check new files ..." +echo "Check new files after init ..." +export FAIL="0" for file in ${TESTFILES} do ls -d "${TESTDIR}/${file}" >>"${LOGFILE}" - diff -q "${TESTDIR}/${file}" "${REFDIR}/${file}" >>"${LOGFILE}" + if ! diff -q "${TESTDIR}/${file}" "${REFDIR}/${file}" >>"${LOGFILE}"; then echo " ERROR: Fail diff ${file}!"; FAIL="1"; fi done +[ "${FAIL}" != "0" ] && exit "${FAIL}" echo "OK" echo "Test Sourcing of bashbot.sh ..." @@ -54,3 +56,5 @@ cd "${DIRME}" || exit 1 echo "Test bashbot.sh count" cp "${REFDIR}/count.test" "${TESTDIR}/count" "${TESTDIR}/bashbot.sh" count + +exit 1 diff --git a/test/c-init-test/botacl b/test/c-init-test/botacl index e69de29..8b13789 100644 --- a/test/c-init-test/botacl +++ b/test/c-init-test/botacl @@ -0,0 +1 @@ +