public function execute()
{
// Handle the skip option
if (Context::get('information-collector')->getValueFor(self::SKIP_OPTION)) {
Context::get('output')->writeln('<error>tests skipped</error>');
return;
}
// Run the tests and live output with the standard output class
$timeout = isset($this->options['timeout']) ? $this->options['timeout'] : null;
$process = $this->executeCommandInProcess($this->options['command'], $timeout);
// Break up if the result is not good
if ($process->getExitCode() !== $this->options['expected_exit_code']) {
throw new \Exception('Tests fails (you can force a release with option --' . self::SKIP_OPTION . ')');
}
}