Add more tests.
This commit is contained in:
parent
f90bbee818
commit
a4d9c5b39b
1 changed files with 58 additions and 6 deletions
64
test.sh
64
test.sh
|
@ -4,15 +4,67 @@ PATH=./bin:$PATH
|
|||
|
||||
set -e
|
||||
|
||||
KOOK_TEST_CONFIG="$(pwd)/test.config.yml"
|
||||
KOOK_OPTS="--verbose --config $KOOK_TEST_CONFIG"
|
||||
TEST_TITLE=""
|
||||
|
||||
fail() {
|
||||
set +x
|
||||
echo "ERROR: $*"
|
||||
echo "ERROR: $TEST_TITLE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
test_cleanup() {
|
||||
rm -f $KOOK_TEST_CONFIG
|
||||
rm -f Kookfile
|
||||
}
|
||||
|
||||
kook project add kook1 . || fail "test1"
|
||||
kook project add kook2 || fail "test2"
|
||||
kook project list || fail "test3"
|
||||
test_start() {
|
||||
test_cleanup
|
||||
TEST_TITLE="$*"
|
||||
echo ""
|
||||
echo ""
|
||||
echo "## TEST : $TEST_TITLE"
|
||||
echo ""
|
||||
}
|
||||
|
||||
test_start "Simple project listing"
|
||||
kook project list $KOOK_OPTS || fail
|
||||
|
||||
test_start "Add project (explicit pah)"
|
||||
kook project add kook-project $KOOK_OPTS --path . || fail
|
||||
kook project list $KOOK_OPTS || fail
|
||||
|
||||
test_start "Add project (auto path)"
|
||||
kook project add kook-project $KOOK_OPTS || fail
|
||||
kook project list $KOOK_OPTS || fail
|
||||
|
||||
test_start "Add and remove project"
|
||||
kook project add kook-project $KOOK_OPTS || fail
|
||||
kook project list $KOOK_OPTS || fail
|
||||
kook project rm kook-project $KOOK_OPTS || fail
|
||||
kook project list $KOOK_OPTS || fail
|
||||
|
||||
test_start "Detect current project"
|
||||
kook project add kook-project $KOOK_OPTS || fail
|
||||
kook project list $KOOK_OPTS || fail
|
||||
kook project detect $KOOK_OPTS || fail
|
||||
|
||||
test_start "Simple view listing (explicit project)"
|
||||
kook project add kook-project $KOOK_OPTS || fail
|
||||
kook view list $KOOK_OPTS --project kook-project || fail
|
||||
|
||||
#test_start "Simple view listing (implicit project)"
|
||||
#kook project add kook-project $KOOK_OPTS || fail
|
||||
#kook view list $KOOK_OPTS || fail
|
||||
|
||||
test_start "Fire a project with no view"
|
||||
kook project add kook-project $KOOK_OPTS || fail
|
||||
kook view list $KOOK_OPTS || fail
|
||||
kook fire kook-project $KOOK_OPTS || fail
|
||||
|
||||
test_start "Add a project with a view (explicit project)"
|
||||
kook project add kook-project $KOOK_OPTS || fail
|
||||
kook view add root $KOOK_OPTS --project kook-project || fail
|
||||
kook view list $KOOK_OPTS --project kook-project || fail
|
||||
|
||||
test_cleanup
|
||||
|
|
Loading…
Reference in a new issue