Пример #1
0
 public function renderBody(QueueInterface $queue, Processes $processes)
 {
     $errorCount = $processes->countErrors();
     $log = $processes->getReport();
     $count = count($log);
     $tests = array_slice($log, $this->lastIndex, $count, 1);
     foreach ($tests as $report) {
         $this->lastIndex++;
         $processorN = "";
         if (OutputInterface::VERBOSITY_VERY_VERBOSE <= $this->output->getVerbosity()) {
             $str = '%d';
             if ($report->isFirstOnThread()) {
                 $str = "<info>%d</info>";
             }
             $processorN = sprintf($str . "\t", $report->getProcessorNumber());
         }
         $flag = "<info>✔</info>";
         $err = '';
         if (!$report->isSuccessful()) {
             $flag = "<error>✘</error>";
             if (OutputInterface::VERBOSITY_VERY_VERBOSE <= $this->output->getVerbosity()) {
                 $err = $report->getErrorBuffer();
             }
         }
         $remaining = sprintf('%d/%d', $this->lastIndex, $this->messageInTheQueue);
         $time = round($report->getTime() * 1000) . ' ms';
         // add a tab to add some space for longer strings so that the next column doesn't jump
         if (strlen($time) < 8) {
             $time .= "\t";
         }
         $this->output->writeln($processorN . $remaining . "\t" . $flag . "\t" . $time . "\t" . $report->getSuite() . $err);
     }
     $this->lastIndex = $count;
     return $errorCount;
 }
Пример #2
0
 public function renderBody(QueueInterface $queue, Processes $processes)
 {
     $now = $queue->count();
     $errorCount = $processes->countErrors();
     if ($errorCount > 0) {
         $this->bar->setBarCharacter('<error>=</error>');
         $this->writeMessage(sprintf("<error>%d</error> failures.", $errorCount), 'number');
     }
     if ($this->last != $now) {
         $this->bar->advance($this->last - $now);
     }
     $this->last = $now;
     return $errorCount;
 }