#!@prefix@/bin/php -f 1) { $start = implode(" ", $argv); } $fp = popen("find $start -name tests -type d -print", "r"); if (!$fp) { die("Could not run find!\n"); } $failed = 0; $passed = 0; $tests = 0; while ($dir = trim(fgets($fp, 1024))) { print "DIRECTORY : $dir\n"; //print "dir=$dir\n"; $dp = opendir($dir); while ($ent = readdir($dp)) { if (substr($ent, 0, 1) == "." || substr($ent, -2) != ".t") { continue; } $res = substr($ent, 0, -1) . 'r'; $out = substr($ent, 0, -1) . 'o'; $cmd = ("cd $dir; $php -d include_path=$incpath ". "-d auto_prepend_file=none ". "-d html_errors=no ". "-f $ent 2>/dev/null | ". "tee $out 2>/dev/null | cmp -s $res -"); //print "cmd=$cmd\n"; $err = 0; system($cmd, &$err); if ($err) { print "FAILED : "; $failed++; } else { unlink("$dir/$out"); print "PASSED : "; $passed++; } $tests++; print "$dir/$ent"; if ($err) { print " (see $dir/$out)"; } print "\n"; } closedir($dp); } pclose($fp); $percent = $failed ? ($passed * 100) / $tests : 100; $percentstr = sprintf($percent < 10.0 ? "%.1f%%" : "%.0f%%", $percent); print "\n----------- SUMMARY -----------\n"; printf("Tests performed: %d\n". "Tests passed: %d\n". "Tests failed: %d\n". "Success rate: %s\n", $tests, $passed, $failed, $percentstr); if ($failed) { die(" One or more tests failed. The file where you can find the output from the test (.o file) should be listed after the FAILED message. The expected output can be found in the corresponding .r file, the source code for the test can be found in the .t file. Please compare the actual output with the expected output and see if it is a local configuration problem or an actual bug. If it is a bug, please report it at http://bugs.php.net/. "); } ?>