runtests.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. :
  2. # Zend Framework
  3. #
  4. # testgroup.sh - Launch PHPUnit for specific test group(s).
  5. #
  6. # Usage: testgroup.sh [ -h <html-dir> ] [ -c <clover-xml-file> ]
  7. # [ ALL | <test-group> [ <test-group> ... ] ]
  8. #
  9. # This script makes it easier to execute PHPUnit test runs from the
  10. # shell, using @group tags defined in the test suite files to run
  11. # subsets of tests.
  12. #
  13. # To get a list of all @group tags:
  14. # phpunit --list-groups AllTests.php
  15. #
  16. # LICENSE
  17. #
  18. # This source file is subject to the new BSD license that is bundled
  19. # with this package in the file LICENSE.txt.
  20. # It is also available through the world-wide-web at this URL:
  21. # http://framework.zend.com/license/new-bsd
  22. # If you did not receive a copy of the license and are unable to
  23. # obtain it through the world-wide-web, please send an email
  24. # to license@zend.com so we can send you a copy immediately.
  25. #
  26. # @category Zend
  27. # @package UnitTests
  28. # @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  29. # @license http://framework.zend.com/license/new-bsd New BSD License
  30. # @version $Id: AllTests.php 16225 2009-06-21 20:34:55Z thomas $
  31. : ${PHPUNIT:="phpunit"}
  32. : ${PHPUNIT_OPTS:="--verbose"}
  33. : ${PHPUNIT_GROUPS:=}
  34. while [ -n "$1" ] ; do
  35. case "$1" in
  36. -h|--html)
  37. PHPUNIT_COVERAGE="--coverage-html $2"
  38. shift 2 ;;
  39. -c|--clover)
  40. PHPUNIT_COVERAGE="--coverage-clover $2"
  41. shift 2 ;;
  42. ALL|all|MAX|max)
  43. PHPUNIT_GROUPS=""
  44. break ;;
  45. Akismet|Amazon|Amazon_Ec2|Amazon_S3|Amazon_Sqs|Audioscrobbler|Delicious|Flickr|LiveDocx|ReCaptcha|Simpy|SlideShare|StrikeIron|Twitter|WindowsAzure|Yahoo)
  46. PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Service_$1"
  47. shift ;;
  48. Ec2|S3)
  49. PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Service_Amazon_$1"
  50. shift ;;
  51. Search)
  52. PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_Search_Lucene"
  53. shift ;;
  54. Zend*|ZF-*)
  55. PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}$1"
  56. shift ;;
  57. *)
  58. PHPUNIT_GROUPS="${PHPUNIT_GROUPS:+"$PHPUNIT_GROUPS,"}Zend_$1"
  59. shift ;;
  60. esac
  61. done
  62. set -x
  63. ${PHPUNIT} ${PHPUNIT_OPTS} ${PHPUNIT_COVERAGE} ${PHPUNIT_DB} \
  64. ${PHPUNIT_GROUPS:+--group $PHPUNIT_GROUPS} AllTests