Example #1
0
 private function addTests()
 {
     $files = $this->fileFinder->getTestFiles($this->params->getTestSuite());
     $oldLog = $this->params->getOldLog();
     if ($oldLog) {
         $files = array_flip($files);
         foreach ($this->getTimings($oldLog) as $filename => $weight) {
             if (isset($files[$filename])) {
                 $this->workers->addTest($filename, $weight);
                 unset($files[$filename]);
             }
         }
         foreach ($files as $filename) {
             $this->workers->addTest($filename, 0);
         }
     } else {
         foreach ($files as $file) {
             $this->workers->addTest($file, 0);
         }
     }
 }
Example #2
0
 public function read()
 {
     if (feof($this->pipes[1])) {
         $this->state = self::STATE_FINALIZE;
         return;
     }
     $char = fread($this->pipes[1], 1);
     $this->output .= $char;
     if (in_array($char, [".", "S", "F", "E"])) {
         $this->testHub->notifyTest($char);
     } elseif ($this->lastChar == "F" && $char == "a") {
         $this->state = self::STATE_FINALIZE;
         return;
     }
     if ($this->lastChar === $char && $char === "\n") {
         $this->state = self::STATE_CLOSE;
     }
     $this->lastChar = $char;
 }