run-tests-drush.sh 675 Bytes
Newer Older
1 2 3 4
#!/usr/bin/env sh

# This script will run phpunit-based test classes using Drush's
# test framework.  First, the Drush executable is located, and
5 6
# then phpunit is invoked, pointing to Drush's phpunit.xml as
# the configuration.
7
#
8 9
# Any parameters that may be passed to `phpunit` may also be used
# with this script.
10 11 12

DRUSH_PATH="`which drush`"
DRUSH_DIRNAME="`dirname -- "$DRUSH_PATH"`"
13 14
# The following line is needed is you use a `drush` that differs from `which drush`
# export UNISH_DRUSH=$DRUSH_PATH
15

16
if [ $# = 0 ] ; then
17
   phpunit --configuration="$DRUSH_DIRNAME/tests" drush
18
else
19 20
   # Pass along any arguments.
   phpunit --configuration="$DRUSH_DIRNAME/tests" $@
21
fi