PageRenderTime 75ms CodeModel.GetById 47ms RepoModel.GetById 0ms app.codeStats 0ms

/dev/tools/batch_tests/batch.php

https://bitbucket.org/sunil_nextbits/magento2
PHP | 66 lines | 38 code | 3 blank | 25 comment | 4 complexity | e97b103ed8cb7599a8b51dd5754ff8e3 MD5 | raw file
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category Magento
  22. * @package tools
  23. * @subpackage batch_tests
  24. * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
  25. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  26. */
  27. $tests = array(
  28. 'unit' => array('../../tests/unit', ''),
  29. 'unit-performance' => array('../../tests/performance/framework/tests/unit', ''),
  30. 'unit-static' => array('../../tests/static/framework/tests/unit', ''),
  31. 'unit-integration' => array('../../tests/integration/framework/tests/unit', ''),
  32. 'integration' => array('../../tests/integration', ''),
  33. 'static' => array('../../tests/static', ''),
  34. );
  35. $arguments = getopt('', array('all'));
  36. if (isset($arguments['all'])) {
  37. $tests['integration-integrity'] = array('../../tests/integration', ' testsuite/integrity');
  38. $tests['static'][1] = ' -c phpunit-all.xml.dist';
  39. }
  40. $failures = array();
  41. foreach ($tests as $row) {
  42. list($dir, $options) = $row;
  43. $dirName = realpath(__DIR__ . '/' . $dir);
  44. chdir($dirName);
  45. $command = 'phpunit' . $options;
  46. $message = $dirName . '> ' . $command;
  47. echo "\n\n";
  48. echo str_pad("---- {$message} ", 70, '-');
  49. echo "\n\n";
  50. passthru($command, $returnVal);
  51. if ($returnVal) {
  52. $failures[] = $message;
  53. }
  54. }
  55. echo "\n" , str_repeat('-', 70), "\n";
  56. if ($failures) {
  57. echo "\nFAILED - " . count($failures) . ' of ' . count($tests) . ":\n";
  58. foreach ($failures as $message) {
  59. echo ' - ' . $message . "\n";
  60. }
  61. } else {
  62. echo "\nPASSED (" . count($tests) . ")\n";
  63. }