Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Tests] Update runtests.sh to be compatible with Travis-Ci

  • Loading branch information...
commit 7157cc5a9b7c5e379cb5e16a0e9877a69ed6f770 1 parent 4810dce
@Maks3w authored
View
7 .travis.yml
@@ -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
View
14 .travis/run-tests.sh
@@ -1,14 +0,0 @@
-#!/bin/bash
-travisdir=$(dirname "$0")
-testdir="$travisdir/../tests"
-testedcomponents=(`cat "$travisdir/tested-components"`)
-result=0
-
-for tested in "${testedcomponents[@]}"
- do
- echo "$tested:"
- phpunit -c $testdir/phpunit.xml.dist $testdir/$tested
- result=$(($result || $?))
-done
-
-exit $result
View
7 .travis/skipped-components
@@ -1,7 +0,0 @@
-Zend/Amf
-Zend/Date
-Zend/Dojo
-Zend/Queue
-Zend/Service
-Zend/Test
-Zend/Wildfire
View
61 .travis/tested-components
@@ -1,61 +0,0 @@
-Zend/Acl
-Zend/Authentication
-Zend/Barcode
-Zend/Cache
-Zend/Captcha
-Zend/Cloud
-Zend/Code
-Zend/Config
-Zend/Console
-Zend/Crypt
-Zend/Currency
-Zend/Db
-Zend/Di
-Zend/DocBook
-Zend/Dojo
-Zend/Dom
-Zend/EventManager
-Zend/Feed
-Zend/File
-Zend/Filter
-Zend/Form
-Zend/GData
-Zend/Http
-Zend/InfoCard
-Zend/InputFilter
-Zend/Json
-Zend/Ldap
-Zend/Loader
-Zend/Locale
-Zend/Log
-Zend/Mail
-Zend/Markup
-Zend/Math
-Zend/Measure
-Zend/Memory
-Zend/Mime
-Zend/ModuleManager
-Zend/Mvc
-Zend/Navigation
-Zend/OAuth
-Zend/OpenId
-Zend/Paginator
-Zend/Pdf
-Zend/ProgressBar
-Zend/RegistryTest.php
-Zend/Rest
-Zend/Search
-Zend/Serializer
-Zend/Server
-Zend/Session
-Zend/Soap
-Zend/Stdlib
-Zend/Tag
-Zend/Text
-Zend/TimeSync
-Zend/Translator
-Zend/Uri
-Zend/Validator
-Zend/VersionTest.php
-Zend/View
-Zend/XmlRpc
View
0  tests/TravisTestConfiguration.php → tests/TestConfiguration.php.travis
File renamed without changes
View
15 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>
View
71 tests/runtests.sh
@@ -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
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.