Skip to content

Commit

Permalink
[Tests] Update runtests.sh to be compatible with Travis-Ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed May 31, 2012
1 parent 4810dce commit 7157cc5
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 105 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Expand Up @@ -4,6 +4,9 @@ php:
- 5.3
- 5.4

before_install: cp tests/TravisTestConfiguration.php tests/TestConfiguration.php
before_install:
- cp tests/TestConfiguration.php.travis tests/TestConfiguration.php

script: ./.travis/run-tests.sh
script:
- cd tests
- ./runtests.sh all
14 changes: 0 additions & 14 deletions .travis/run-tests.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .travis/skipped-components

This file was deleted.

61 changes: 0 additions & 61 deletions .travis/tested-components

This file was deleted.

File renamed without changes.
15 changes: 14 additions & 1 deletion tests/phpunit.xml.dist
@@ -1,14 +1,27 @@
<phpunit bootstrap="./Bootstrap.php" colors="true">
<testsuites>
<testsuite name="Zend Framework Test Suite">
<directory>./</directory>
<directory>./Zend</directory>
<exclude>./Zend/Amf</exclude>
<exclude>./Zend/Date</exclude>
<exclude>./Zend/Dojo</exclude>
<exclude>./Zend/Queue</exclude>
<exclude>./Zend/Service</exclude>
<exclude>./Zend/Test</exclude>
<exclude>./Zend/Wildfire</exclude>
</testsuite>
</testsuites>

<groups>
<exclude>
<group>disable</group>
<group>Zend_Amf</group>
<group>Zend_Date</group>
<group>Zend_Dojo</group>
<group>Zend_Queue</group>
<group>Zend_Service</group>
<group>Zend_Test</group>
<group>Zend_Wildfire</group>
</exclude>
</groups>
</phpunit>
71 changes: 51 additions & 20 deletions tests/runtests.sh
Expand Up @@ -3,7 +3,7 @@
#
# testgroup.sh - Launch PHPUnit for specific test group(s).
#
# Usage: testgroup.sh [ -h <html-dir> ] [ -c <clover-xml-file> ]
# Usage: testgroup.sh [ -h <html-dir> ] [ -c <clover-xml-file> ] [ -g ]
# [ ALL | <test-group> [ <test-group> ... ] ]
#
# This script makes it easier to execute PHPUnit test runs from the
Expand All @@ -28,45 +28,76 @@
# @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
# @license http://framework.zend.com/license/new-bsd New BSD License

: ${BASEDIR:=$(dirname $0)}
: ${PHPUNIT:="phpunit"}
: ${PHPUNIT_OPTS:="--verbose"}
: ${PHPUNIT_GROUPS:=}
: ${PHPUNIT_OPTS:="-c $BASEDIR/phpunit.xml.dist"}
: ${PHPUNIT_GROUPS:=""}
: ${RUN_AS_GROUPS:=false}
: ${RESULT:=0}

while [ -n "$1" ] ; do
case "$1" in
case "$1" in
-h|--html)
PHPUNIT_COVERAGE="--coverage-html $2"
PHPUNIT_COVERAGE="--coverage-html $2"
shift 2 ;;

-c|--clover)
PHPUNIT_COVERAGE="--coverage-clover $2"
PHPUNIT_COVERAGE="--coverage-clover $2"
shift 2 ;;

-g|--groups)
RUN_AS_GROUPS="true"
shift 1 ;;

ALL|all|MAX|max)
PHPUNIT_GROUPS=""
break ;;
if ${RUN_AS_GROUPS:=true}
then
PHPUNIT_GROUPS=""
else
for i in $(ls -d ${BASEDIR}/../library/Zend/*/)
do
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS "}${BASEDIR}/Zend/$(basename $i)"
done
fi
break ;;

Akismet|Amazon|Amazon_Ec2|Amazon_S3|Amazon_Sqs|Audioscrobbler|Delicious|Flickr|GoGrid|LiveDocx|Nirvanix|Rackspace|ReCaptcha|Simpy|SlideShare|StrikeIron|Technorati|Twitter|WindowsAzure|Yahoo)
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Service_$1"
shift ;;
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Service_$1"
shift ;;

Ec2|S3)
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Service_Amazon_$1"
shift ;;
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Service_Amazon_$1"
shift ;;

Search)
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Search_Lucene"
shift ;;
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Search_Lucene"
shift ;;

Zend*)
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}$1"
shift ;;
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}$1"
shift ;;

*)
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_$1"
shift ;;
PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_$1"
shift ;;
esac
done

set -x
${PHPUNIT} ${PHPUNIT_OPTS} ${PHPUNIT_COVERAGE} ${PHPUNIT_DB} \
${PHPUNIT_GROUPS:+--group $PHPUNIT_GROUPS}
if ${RUN_AS_GROUPS:=true}
then
${PHPUNIT} ${PHPUNIT_OPTS} ${PHPUNIT_COVERAGE} ${PHPUNIT_DB} \
${PHPUNIT_GROUPS:+--group $PHPUNIT_GROUPS}
RESULT=$?
else
# Replace commas with spaces and underscores with slashes
PHPUNIT_GROUPS=${PHPUNIT_GROUPS//,/ }
PHPUNIT_GROUPS=${PHPUNIT_GROUPS//_//}
for i in ${PHPUNIT_GROUPS}
do
${PHPUNIT} ${PHPUNIT_OPTS} ${PHPUNIT_COVERAGE} ${PHPUNIT_DB} $i
RESULT=$(($RESULT || $?))
done
fi

exit $RESULT

0 comments on commit 7157cc5

Please sign in to comment.