summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-03-28 14:12:14 (GMT)
committerMarcus Boerger <helly@php.net>2004-03-28 14:12:14 (GMT)
commit0019c6090297f18b6489f8818b68f4857a8968e6 (patch)
tree1618716cbc18618822b7aca59cab2081ed0eaeed /run-tests.php
parenta7b9cb454e10d4e1114aca048c9359afb341192b (diff)
downloadphp-0019c6090297f18b6489f8818b68f4857a8968e6.tar.gz
Show progress
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/run-tests.php b/run-tests.php
index 3d0a170..0c72fd5 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -275,13 +275,15 @@ HELP;
}
// Run selected tests.
- if (count($test_files)) {
+ $test_cnt = count($test_files);
+ if ($test_cnt) {
write_information();
usort($test_files, "test_sort");
echo "Running selected tests.\n";
$start_time = time();
+ $test_idx = 0;
foreach($test_files AS $name) {
- $test_results[$name] = run_test($php,$name);
+ $test_results[$name] = run_test($php,$name,$test_cnt,++$test_idx);
if ($failed_tests_file && ($test_results[$name] == 'FAILED' || $test_results[$name] == 'WARNED')) {
fwrite($failed_tests_file, "$name\n");
}
@@ -383,8 +385,10 @@ echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "
=====================================================================
";
+$test_cnt = count($test_files);
+$test_idx = 0;
foreach ($test_files as $name) {
- $test_results[$name] = run_test($php,$name);
+ $test_results[$name] = run_test($php,$name,$test_cnt,++$test_idx);
}
$end_time = time();
@@ -632,7 +636,7 @@ function system_with_timeout($commandline)
// Run an individual test case.
//
-function run_test($php, $file)
+function run_test($php, $file, $test_cnt, $test_idx)
{
global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS;
@@ -675,11 +679,11 @@ TEST $file
// Add to the section text.
$section_text[$section] .= $line;
}
- if (!@count($section_text['FILE'])) {
+ if (@count($section_text['FILE']) != 1) {
echo "BORK missing section --FILE-- [$file]\n";
return 'BORKED';
}
- if (!(@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX']))) {
+ if ((@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX'])) != 1) {
echo "BORK missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX-- [$file]\n";
return 'BORKED';
}
@@ -696,7 +700,7 @@ TEST $file
$shortname = str_replace($cwd.'/', '', $file);
$tested = trim($section_text['TEST'])." [$shortname]";
- echo "TEST [$shortname]\r";
+ echo "TEST $test_idx/$test_cnt [$shortname]\r";
flush();
$tmp = realpath(dirname($file));