mirror of
https://github.com/php/php-gtk-src.git
synced 2026-03-26 18:22:09 +01:00
To use it: - install xautomation program (xte) from http://hoopajoo.net/projects/xautomation.html - copy bugconfig.php.in to bugconfig.php and change the location of your php5 executable - run bugrunner.php: It will execute all bug_*.phpw. - If this scripts echo 'ok' means that everything was ok, the bug doesn't exist any more. However, if anything other than 'ok' is echoed: The bug still exists. - All the single bug scripts can be run with "debug" as parameter which shows the real error message I know that it's not nice, but it works for now.
46 lines
1008 B
PHP
46 lines
1008 B
PHP
<?php
|
|
/**
|
|
* Executes all the bug files and checks the output
|
|
*
|
|
* Each bug file can be run with a "debug" as parameter
|
|
* and will put out the error message
|
|
*/
|
|
require_once('bugconfig.php');
|
|
|
|
$counter = array('passed' => 0, 'error' => 0);
|
|
|
|
function runBugfile($file)
|
|
{
|
|
global $counter;
|
|
|
|
$lastline = trim(exec(PHP_EXECUTABLE . ' ' . $file));
|
|
if ($lastline == 'ok') {
|
|
$status = 'passed';
|
|
} else {
|
|
$status = 'error';
|
|
}
|
|
echo str_pad($file, 60, ' ') . $status . "\r\n";
|
|
$counter[$status]++;
|
|
}
|
|
|
|
function percent($value, $all)
|
|
{
|
|
if ($all == 0 || $value == 0) {
|
|
return ' 0.00';
|
|
}
|
|
return number_format(100 / $all * $value, 2);
|
|
}
|
|
|
|
$files = glob('bug_*.phpw');
|
|
foreach ($files as $bugfile)
|
|
{
|
|
runBugfile($bugfile);
|
|
}
|
|
|
|
echo "\r\nScore:\r\n";
|
|
$sum = array_sum($counter);
|
|
foreach ($counter as $id => $value) {
|
|
echo ' ' . str_pad($id, 7, ' ') . ': ' . str_pad($value, 5, ' ', STR_PAD_LEFT) . ' (' . percent($value, $sum) . '%)' . "\r\n";
|
|
}
|
|
|
|
?>
|