Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-31 16:22:02 +0300
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-31 16:22:02 +0300
commitf6b1d3506f63518da7f5df250ef95f925adfb933 (patch)
treecc4b9b189c2711c17ad1ea3f07fdd562a2c3fba3 /autotest-external.sh
parent65784227d6460a9464b287cc698d3e0a54f6d0d3 (diff)
Allow easy XDEBUG debugging with autotest
Debugging scripts needs the environment variable XDEBUG_CONFIG to be set, which initiates a connection to a listening debugger. But if that env is set and one of the PHP setup steps occurs (e.g. occ install), the debugging session is 'completed' and the debugger no longer listens during the actual tests. This saves the XDEBUG_CONFIG env so it only applies during the PHPUnit execution, so only the real tests trigger the debugging.
Diffstat (limited to 'autotest-external.sh')
-rwxr-xr-xautotest-external.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/autotest-external.sh b/autotest-external.sh
index 65d53aaa95d..cb5a3dad503 100755
--- a/autotest-external.sh
+++ b/autotest-external.sh
@@ -17,6 +17,9 @@ BASEDIR=$PWD
DBCONFIGS="sqlite mysql pgsql oci"
PHPUNIT=$(which phpunit)
+_XDEBUG_CONFIG=$XDEBUG_CONFIG
+unset XDEBUG_CONFIG
+
function print_syntax {
echo -e "Syntax: ./autotest-external.sh [dbconfigname] [startfile]\n" >&2
echo -e "\t\"dbconfigname\" can be one of: $DBCONFIGS" >&2
@@ -159,6 +162,9 @@ EOF
mkdir "coverage-external-html-$1"
# just enable files_external
php ../occ app:enable files_external
+ if [[ "$_XDEBUG_CONFIG" ]]; then
+ export XDEBUG_CONFIG=$_XDEBUG_CONFIG
+ fi
if [ -z "$NOCOVERAGE" ]; then
"$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1.xml" --coverage-clover "autotest-external-clover-$1.xml" --coverage-html "coverage-external-html-$1"
RESULT=$?