Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer is now able to discover tests #49

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
120 changes: 12 additions & 108 deletions install.sh
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

# Installation script for MyTAP

SQLHOST='localhost';
Expand All @@ -9,6 +11,8 @@ NOTESTS=0
NOINSTALL=0
FILTER=0

ALL_TESTS=$(echo $(ls tests/*my | cut -d. -f1 | cut -d'-' -f3-))

while [[ "${#}" > 0 ]]; do
case ${1} in
-u|--user)
Expand Down Expand Up @@ -55,7 +59,7 @@ Options:
-S, --socket filename MySQL host
-t, --no-tests Don't run the test suite when the install is completed
-i, --no-install Don't perform the installation, i.e. just run the test suite
-f, --filter string Perform the action on one class of objects <matching|eq|moretap|todo|utils|charset|collation|column|constraint|engine|event|index|partition|privilege|role|routines|table|trigger|schemata|user|view>
-f, --filter string Perform the action on one class of objects <${ALL_TESTS//\ /|}>
EOF
exit 1
;;
Expand Down Expand Up @@ -152,115 +156,15 @@ if [[ ${NOTESTS} -eq 0 ]]; then
if [[ ${FILTER} != 0 ]]; then
echo "Running test suite with filter: ${FILTER}";
else
echo "Running Full test suite, this will take a couple of minutes to complete."
fi

sleep 2;

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "matching" ]]; then
echo "============= matching ============="
mysql ${MYSQLOPTS} --database tap --execute 'source tests/matching.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "eq" ]]; then
echo "============= eq ============="
mysql ${MYSQLOPTS} --database tap --execute 'source tests/eq.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "moretap" ]]; then
echo "============= moretap ============="
mysql ${MYSQLOPTS} --database tap --execute 'source tests/moretap.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "todotap" ]]; then
echo "============= todotap ============="
mysql ${MYSQLOPTS} --database tap --execute 'source tests/todotap.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "utils" ]]; then
echo "============= utils ============="
mysql ${MYSQLOPTS} --database tap --execute 'source tests/utils.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "charset" ]]; then
echo "============= character sets ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-charset.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "collation" ]]; then
echo "============= collations ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-collation.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "column" ]]; then
echo "============= columns ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-column.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "constraint" ]]; then
echo "============= constraints ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-constraint.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "engine" ]]; then
echo "============= engines ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-engine.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "event" ]]; then
echo "============= events ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-event.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "index" ]]; then
echo "============= indexes ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-index.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "partition" ]]; then
echo "============= partitions ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-partition.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "privilege" ]]; then
echo "============= privileges ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-privilege.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "role" ]]; then
echo "============= role ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-role.my'
echo "Running full test suite."
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "routines" ]]; then
echo "============= routines ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-routines.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "schemata" ]]; then
echo "============= schemas ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-schemata.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "table" ]]; then
echo "============= tables ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-table.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "trigger" ]]; then
echo "============= triggers ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-trigger.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "user" ]]; then
echo "============= users ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-user.my'
fi

if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "view" ]]; then
echo "============= views ============"
mysql ${MYSQLOPTS} --database tap --execute 'source tests/test-mytap-view.my'
fi
for t in ${ALL_TESTS}; do
if [[ ${FILTER} == 0 ]] || [[ ${FILTER} =~ "${t}" ]]; then
echo "============= ${t} ============="
mysql ${MYSQLOPTS} --database tap --execute "source tests/test-mytap-${t}.my"
fi
done

fi

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.