run() public method

public run ( array $arguments = [] )
$arguments array
Ejemplo n.º 1
0
 public function run(array $arguments = array())
 {
     parent::run($arguments);
     if ($this->tagVersion === true) {
         $this->engine->tagVersion();
     }
     return $this;
 }
Ejemplo n.º 2
0
 public function run(array $arguments = array())
 {
     $this->generate = true;
     parent::run($arguments);
     if ($this->generate === true) {
         $this->generate();
     }
     return $this;
 }
Ejemplo n.º 3
0
 public function run(array $arguments = array())
 {
     try {
         $this->useDefaultConfigFiles();
         if (parent::run($arguments ?: $this->arguments)->runTests === true) {
             if ($this->loop === true) {
                 $this->loop();
             } else {
                 if ($this->runner->hasReports() === false) {
                     $this->addDefaultReport();
                 }
                 $methods = $this->methods;
                 $oldFailMethods = array();
                 if ($this->scoreFile !== null && ($scoreFileContents = @file_get_contents($this->scoreFile)) !== false && ($oldScore = @unserialize($scoreFileContents)) instanceof atoum\score) {
                     $oldFailMethods = self::getFailMethods($oldScore);
                     if ($oldFailMethods) {
                         $methods = $oldFailMethods;
                     }
                 }
                 $this->saveScore($newScore = $this->runner->run($this->namespaces, $this->tags, self::getClassesOf($methods), $methods));
                 if ($oldFailMethods) {
                     if (sizeof(self::getFailMethods($newScore)) <= 0) {
                         $testMethods = $this->runner->getTestMethods($this->namespaces, $this->tags, $this->methods);
                         if (sizeof($testMethods) > 1 || sizeof(current($testMethods)) > 1) {
                             $this->saveScore($this->runner->run($this->namespaces, $this->tags, self::getClassesOf($this->methods), $this->methods));
                         }
                     }
                 }
             }
         }
     } catch (atoum\exception $exception) {
         $this->writeError($exception->getMessage());
         exit(2);
     }
     return $this;
 }
Ejemplo n.º 4
0
 public function run(array $arguments = array())
 {
     parent::run($arguments);
     $alreadyRun = false;
     $runFile = $this->getRunFile();
     $pid = trim(@$this->adapter->file_get_contents($runFile));
     if (is_numeric($pid) === false || $this->adapter->posix_kill($pid, 0) === false) {
         if ($this->pharCreationEnabled === true) {
             $runFileResource = @$this->adapter->fopen($runFile, 'w+');
             if ($runFileResource === false) {
                 throw new exceptions\runtime(sprintf($this->locale->_('Unable to open run file \'%s\''), $runFile));
             }
             if ($this->adapter->flock($runFileResource, \LOCK_EX | \LOCK_NB) === false) {
                 throw new exceptions\runtime(sprintf($this->locale->_('Unable to get exclusive lock on run file \'%s\''), $runFile));
             }
             $this->adapter->fwrite($runFileResource, $this->adapter->getmypid());
             $this->createPhar($this->version);
             $this->adapter->fclose($runFileResource);
             @$this->adapter->unlink($runFile);
         }
     }
     return $this;
 }
 public function run(array $arguments = array())
 {
     $this->useDefaultConfigFiles();
     return parent::run($arguments);
 }