/**
  * {@inheritdoc}
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $result = null;
     $maxProcessesAmount = max(1, $input->getOption(self::OPTION_PARALLEL_PROCESS));
     $locator = $input->getArgument('paths');
     if ($maxProcessesAmount > 1) {
         $this->outputPrinter->init($output);
         $this->processFactory->init($this->inputDefinition, $input);
         $this->featureRunner->setMaxParallelProcess($maxProcessesAmount);
         $result = 0;
         foreach ($this->featureExtractor->extract($locator) as $featureNode) {
             $result = max($result, $this->featureRunner->run($featureNode));
         }
     }
     return $result;
 }
 /**
  * @param InputDefinition $inputDefinition
  * @param InputInterface  $input
  * @param string          $expectedCommandLine
  * @param array           $skipOptions
  *
  * @see          ScenarioProcessFactory::init
  * @see          ScenarioProcessFactory::make
  *
  * @dataProvider providerMake
  */
 public function testMake(InputDefinition $inputDefinition, InputInterface $input, $expectedCommandLine = '', array $skipOptions = [])
 {
     $scenarioProcessFactory = new ScenarioProcessFactory('bin/behat');
     $scenarioProcessFactory->addSkipOptions($skipOptions);
     $scenarioProcessFactory->init($inputDefinition, $input);
     $scenarioInfo = new ScenarioInfo('file', 1);
     $process = $scenarioProcessFactory->make($scenarioInfo);
     $this->assertEquals(trim(sprintf('%s bin/behat \'file:1\' %s', PHP_BINARY, $expectedCommandLine)), $process->getCommandLine());
 }