mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
fd0646e4cf
git-svn-id: http://svn.twig-project.org/trunk@4 93ef8e89-cb99-4229-a87c-7fa0fa45744b
45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Twig.
|
|
*
|
|
* (c) Fabien Potencier
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
require_once(dirname(__FILE__).'/../lib/lime/LimeAutoloader.php');
|
|
LimeAutoloader::register();
|
|
|
|
$suite = new LimeTestSuite(array(
|
|
'force_colors' => isset($argv) && in_array('--color', $argv),
|
|
'base_dir' => realpath(dirname(__FILE__).'/..'),
|
|
));
|
|
|
|
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__).'/../unit'), RecursiveIteratorIterator::LEAVES_ONLY) as $file)
|
|
{
|
|
if (preg_match('/Test\.php$/', $file))
|
|
{
|
|
$suite->register($file->getRealPath());
|
|
}
|
|
}
|
|
|
|
$coverage = new LimeCoverage($suite, array(
|
|
'base_dir' => realpath(dirname(__FILE__).'/../../lib'),
|
|
'extension' => '.php',
|
|
'verbose' => true,
|
|
));
|
|
|
|
$files = array();
|
|
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__).'/../../lib'), RecursiveIteratorIterator::LEAVES_ONLY) as $file)
|
|
{
|
|
if (preg_match('/\.php$/', $file))
|
|
{
|
|
$files[] = $file->getRealPath();
|
|
}
|
|
}
|
|
$coverage->setFiles($files);
|
|
|
|
$coverage->run();
|