getErrorStacks() public method

public getErrorStacks ( )
Exemplo n.º 1
0
 public function endSuite(Suite $suite)
 {
     $summary = $suite->getSummary();
     $errorStacks = $suite->getErrorStacks();
     if ($errorStacks) {
         $this->output->write(PHP_EOL);
         $this->output->writeln(sprintf('%d subjects encountered errors:', count($errorStacks)));
         $this->output->write(PHP_EOL);
         foreach ($errorStacks as $errorStack) {
             $this->output->writeln(sprintf('<error>%s::%s</error>', $errorStack->getVariant()->getSubject()->getBenchmark()->getClass(), $errorStack->getVariant()->getSubject()->getName()));
             $this->output->write(PHP_EOL);
             foreach ($errorStack as $error) {
                 $this->output->writeln(sprintf("    %s %s\n\n    <comment>%s</comment>\n", $error->getClass(), str_replace("\n", "\n    ", $error->getMessage()), str_replace("\n", "\n    ", $error->getTrace())));
             }
         }
     }
     $this->output->writeln(sprintf('%s subjects, %s iterations, %s revs, %s rejects', number_format($summary->getNbSubjects()), number_format($summary->getNbIterations()), number_format($summary->getNbRevolutions()), number_format($summary->getNbRejects())));
     $this->output->writeln(sprintf('(best [mean mode] worst) = %s [%s %s] %s (%s)', number_format($this->timeUnit->toDestUnit($summary->getMinTime()), 3), number_format($this->timeUnit->toDestUnit($summary->getMeanTime()), 3), number_format($this->timeUnit->toDestUnit($summary->getModeTime()), 3), number_format($this->timeUnit->toDestUnit($summary->getMaxTime()), 3), $this->timeUnit->getDestSuffix()));
     $this->output->writeln(sprintf('⅀T: %s μSD/r %s μRSD/r: %s%%', $this->timeUnit->format($summary->getTotalTime(), null, TimeUnit::MODE_TIME), $this->timeUnit->format($summary->getMeanStDev(), null, TimeUnit::MODE_TIME), number_format($summary->getMeanRelStDev(), 3)));
 }
Exemplo n.º 2
0
 private function assertNoErrors(Suite $suite)
 {
     if ($errorStacks = $suite->getErrorStacks()) {
         $errorStack = reset($errorStacks);
         $this->fail('Runner encountered error: ' . $errorStack->getTop()->getMessage());
     }
     if ($errorStacks = $suite->getErrorStacks()) {
         $errorStack = reset($errorStacks);
         $this->fail('Runner encountered error: ' . $errorStack->getTop()->getMessage());
     }
 }