summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-27 02:42:40 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-27 02:42:40 -0700
commita50e215c9e6d1bf935b36388bd53d3e03dbe718d (patch)
tree6f028caeb94d305f544d065a01da0f8b2bd6f792
parent119ecc6f34a063e7265bf721c0ee04bb9bdb25b3 (diff)
parent7de1b3f28edc5e83a82f06da33f9f971767ca93f (diff)
downloadnextcloud-server-a50e215c9e6d1bf935b36388bd53d3e03dbe718d.tar.gz
nextcloud-server-a50e215c9e6d1bf935b36388bd53d3e03dbe718d.zip
Merge pull request #5537 from owncloud/autotest-syntaxhelp
Added syntax help for autotest.sh
-rwxr-xr-xautotest.sh34
1 files changed, 30 insertions, 4 deletions
diff --git a/autotest.sh b/autotest.sh
index 3831e181245..a411780d49c 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -12,11 +12,37 @@ DATABASEUSER=oc_autotest$EXECUTOR_NUMBER
ADMINLOGIN=admin$EXECUTOR_NUMBER
BASEDIR=$PWD
+DBCONFIGS="sqlite mysql pgsql oci"
+
+function print_syntax {
+ echo -e "Syntax: ./autotest.sh [dbconfigname] [testfile]\n" >&2
+ echo -e "\t\"dbconfigname\" can be one of: $DBCONFIGS" >&2
+ echo -e "\t\"testfile\" is the name of a test file, for example lib/template.php" >&2
+ echo -e "\nExample: ./autotest.sh sqlite lib/template.php" >&2
+ echo "will run the test suite from \"tests/lib/template.php\"" >&2
+ echo -e "\nIf no arguments are specified, all tests will be run with all database configs" >&2
+}
+
if ! [ -w config -a -w config/config.php ]; then
echo "Please enable write permissions on config and config/config.php" >&2
exit 1
fi
+if [ $1 ]; then
+ FOUND=0
+ for DBCONFIG in $DBCONFIGS; do
+ if [ $1 = $DBCONFIG ]; then
+ FOUND=1
+ break
+ fi
+ done
+ if [ $FOUND = 0 ]; then
+ echo -e "Unknown database config name \"$1\"\n" >&2
+ print_syntax
+ exit 2
+ fi
+fi
+
# Back up existing (dev) config if one exists
if [ -f config/config.php ]; then
mv config/config.php config/config-autotest-backup.php
@@ -160,10 +186,10 @@ EOF
#
if [ -z "$1" ]
then
- execute_tests 'sqlite'
- execute_tests 'mysql'
- execute_tests 'pgsql'
- execute_tests 'oci'
+ # run all known database configs
+ for DBCONFIG in $DBCONFIGS; do
+ execute_tests $DBCONFIG
+ done
else
execute_tests $1 $2 $3
fi