From 2eac362dc7c1ff847cfcaac3af7cdd0f468a3b75 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Fri, 19 Apr 2019 19:24:30 +0200 Subject: [PATCH] test for files after init --- test/ALL-tests.sh | 2 +- test/a-commit-test.sh | 2 +- test/a-push-test.sh | 2 +- test/b-init-test.sh | 25 +++++++++++++++++++++++-- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/test/ALL-tests.sh b/test/ALL-tests.sh index 8590960..893f2c0 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-11-g41b8e69 +#### $$VERSION$$ 0.70-dev-15-g074a103 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/test/a-commit-test.sh b/test/a-commit-test.sh index f27a3cd..52cb6a1 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-11-g41b8e69 +#### $$VERSION$$ 0.70-dev-15-g074a103 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/test/a-push-test.sh b/test/a-push-test.sh index ea8b468..aeb3b6a 100755 --- a/test/a-push-test.sh +++ b/test/a-push-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-11-g41b8e69 +#### $$VERSION$$ 0.70-dev-15-g074a103 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/test/b-init-test.sh b/test/b-init-test.sh index f00b9f6..a1192b4 100755 --- a/test/b-init-test.sh +++ b/test/b-init-test.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-11-g41b8e69 +#### $$VERSION$$ 0.70-dev-15-g074a103 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script GIT_DIR=$(git rev-parse --git-dir) cd "$GIT_DIR/.." || exit 1 +TOKENFILE="./token" +TESTTOKEN="bashbottestscript" TESTME="$(basename "$0")" +NEWFILES="${TOKENFILE} botacl count botadmin JSON.sh/JSON.sh tmp-bot-bash" + set -e # let's fake failing test for now @@ -22,7 +26,24 @@ unset IFS; set -f # run bashbot first time with init export TERM="" "${1}/bashbot.sh" init >"${TESTME}.log" </dev/null +done +echo "OK" + +echo "Check value of token ..." +if [ "${TESTTOKEN}" = "$(cat "${TOKENFILE}")" ]; then + echo "OK" +else + echo "Token not correct or not written!" + exit 1 +fi