mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-16 17:44:23 +01:00
test auto-completion scripts
Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
parent
e8aa39a810
commit
42f1b15a5a
3 changed files with 70 additions and 1 deletions
34
dev/tests/auto-completion
Executable file
34
dev/tests/auto-completion
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ! -f ./src/__main__.py ]; then
|
||||||
|
echo $'\e[01;31m-- You need to cd into the repository'\'$'s root directory --\e[00m'
|
||||||
|
exit 140
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $'\e[1m-- Testing that the shell auto-completion script compiles --\e[0m'
|
||||||
|
|
||||||
|
## If this automated bisection stops at a commit with a syntax error or other error that cases the test to fail for another reason,
|
||||||
|
## you will need to manually run bisect, and use `git reset --hard HEAD~1` (or similar) to skip that commit, see `git bisect --help`
|
||||||
|
|
||||||
|
if ! ./completion/auto-auto-complete.py bash --source ./completion/ponysay --output /dev/null; then
|
||||||
|
git bisect start
|
||||||
|
git bisect bad
|
||||||
|
git bisect good e8aa39a810e43866a8cc978a038545949711f999
|
||||||
|
lastlog=""
|
||||||
|
while true; do
|
||||||
|
if ! ./completion/auto-auto-complete.py bash --source ./completion/ponysay --output /dev/null; then
|
||||||
|
git bisect good
|
||||||
|
else
|
||||||
|
git bisect bad
|
||||||
|
fi
|
||||||
|
# This part is a little hacky as I assume git use locale settings for the language and there seems to be no good way to automate a bisect.
|
||||||
|
nowlog="$(git bisect log | tail -n 1)"
|
||||||
|
if [ "${nowlog}" = "${lastlog}" ]; then
|
||||||
|
git bisect reset
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 'Test passed, you may want to update the last know good commit in ./dev/tests/auto-completion'
|
||||||
|
|
34
dev/tests/auto-completion-tool
Executable file
34
dev/tests/auto-completion-tool
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ! -f ./src/__main__.py ]; then
|
||||||
|
echo $'\e[01;31m-- You need to cd into the repository'\'$'s root directory --\e[00m'
|
||||||
|
exit 140
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $'\e[1m-- Testing that the shell auto-completion script for ponysay-tool compiles --\e[0m'
|
||||||
|
|
||||||
|
## If this automated bisection stops at a commit with a syntax error or other error that cases the test to fail for another reason,
|
||||||
|
## you will need to manually run bisect, and use `git reset --hard HEAD~1` (or similar) to skip that commit, see `git bisect --help`
|
||||||
|
|
||||||
|
if ! ./completion/auto-auto-complete.py bash --source ./completion/ponysay-tool --output /dev/null; then
|
||||||
|
git bisect start
|
||||||
|
git bisect bad
|
||||||
|
git bisect good e8aa39a810e43866a8cc978a038545949711f999
|
||||||
|
lastlog=""
|
||||||
|
while true; do
|
||||||
|
if ! ./completion/auto-auto-complete.py bash --source ./completion/ponysay-tool --output /dev/null; then
|
||||||
|
git bisect good
|
||||||
|
else
|
||||||
|
git bisect bad
|
||||||
|
fi
|
||||||
|
# This part is a little hacky as I assume git use locale settings for the language and there seems to be no good way to automate a bisect.
|
||||||
|
nowlog="$(git bisect log | tail -n 1)"
|
||||||
|
if [ "${nowlog}" = "${lastlog}" ]; then
|
||||||
|
git bisect reset
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 'Test passed, you may want to update the last know good commit in ./dev/tests/auto-completion'
|
||||||
|
|
|
@ -7,4 +7,5 @@ fi
|
||||||
|
|
||||||
./dev/tests/correct-pony-f
|
./dev/tests/correct-pony-f
|
||||||
./dev/tests/correct-pony+f
|
./dev/tests/correct-pony+f
|
||||||
|
./dev/tests/auto-completion
|
||||||
|
./dev/tests/auto-completion-tool
|
||||||
|
|
Loading…
Reference in a new issue