summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-05-26 11:31:26 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-05-26 11:31:26 +0200
commita619d349bf4eceaad73973278c42afadc3bf9a58 (patch)
tree6354bc5a433ba301e5c36c2fb9e6180fb1c43104
parentf11d998371453c27b989ce3e16b742dcc841e4d2 (diff)
downloadnextcloud-server-a619d349bf4eceaad73973278c42afadc3bf9a58.tar.gz
nextcloud-server-a619d349bf4eceaad73973278c42afadc3bf9a58.zip
add convenience script to run all tests at once
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rwxr-xr-xapps/user_ldap/tests/Integration/run-all.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/apps/user_ldap/tests/Integration/run-all.sh b/apps/user_ldap/tests/Integration/run-all.sh
new file mode 100755
index 00000000000..02bab97e45f
--- /dev/null
+++ b/apps/user_ldap/tests/Integration/run-all.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+trigger_notification() {
+ which notify-send 1>/dev/null
+ if [[ $? == 1 ]] ; then
+ return
+ fi
+ export NOTIFY_USER=$SUDO_USER
+ export RESULT_STR=$1
+ # does not work. just pipe result into a non-sudo cmd
+ su "$NOTIFY_USER" -c "notify-send -u normal -t 43200000 -a Nextcloud -i Nextcloud \"LDAP Integration tests $RESULT_STR\""
+}
+
+FILES_ROOT=($(ls -d -p Lib/* | grep -v "/$"))
+FILES_USER=($(ls -d -p Lib/User/* | grep -v "/$"))
+# TODO: Loop through dirs (and subdirs?) once there are more
+TESTFILES=("${FILES_ROOT[@]}" "${FILES_USER[@]}")
+
+TESTCMD="./run-test.sh"
+
+echo "Running " ${#TESTFILES[@]} " tests"
+for TESTFILE in "${TESTFILES[@]}" ; do
+ echo -n "Test: $TESTFILE… "
+ STATE=`$TESTCMD "$TESTFILE" | grep -c "Tests succeeded"`
+ if [ "$STATE" -eq 0 ] ; then
+ echo "failed!"
+ trigger_notification "failed"
+ exit 1
+ fi
+ echo "succeeded"
+done
+
+echo -e "\nAll tests succeeded"
+trigger_notification "succeeded"