$test->purpose,
$result ? "PASS" : "FAIL",
PHP_EOL);
+
+ return $result;
}
protected $config;
*/
public function getResult() {
$options = sprintf(
- '-i%s -qb', $this->file);
+ '-i%s -nqb', $this->file);
if ($this->options) {
$options = sprintf(
*
*/
protected function writeDiff() {
- $diff = sprintf(
- '%s/%s.diff',
- dirname($this->file), basename($this->file));
-
if (count($this->diff['wants'])) {
- if (!in_array('nodiff', $this->config['flags'])) {
- if (($diff = fopen($diff, 'w+'))) {
+ if (!$this->config->hasFlag('nodiff')) {
+ if ($this->config->hasFlag('diff2stdout')) {
+ $difffile = "php://stdout";
+ file_put_contents($difffile, "====DIFF====\n");
+ } else {
+ $difffile = sprintf(
+ '%s/%s.diff',
+ dirname($this->file), basename($this->file));
+ }
+
+ if (($diff = fopen($difffile, 'w+'))) {
foreach ($this->diff['wants'] as $line => $want) {
$got = $this->diff['gets'][$line];
$cwd = dirname(__FILE__);
$cmd = $_SERVER['argv'];
+
+ $retval = 0;
+
{
$config = new TestsConfiguration(array(
'exec' => realpath(array_shift($cmd)),
$tests->logPath($path);
foreach ($tests->findTests($path) as $test) {
- $tests->logTest($path, $test);
+ $retval |= !$tests->logTest($path, $test);
}
$tests->logPathStats($path);
$tests->logStats();
}
+
+ die($retval);
}
?>