Initial working draft

This commit is contained in:
luke
2021-08-05 13:13:53 +01:00
parent d1a9e0bbe3
commit 0a3991c314
6 changed files with 537 additions and 2 deletions

View File

@ -2,8 +2,10 @@
<?php declare(strict_types=1);
use NunoMaduro\Collision\Provider;
use ParaTest\Console\Commands\ParaTestCommand;
use Pest\Actions\ValidatesEnvironment;
use Pest\Console\Command;
use Pest\Console\Paratest\Runner;
use Pest\Support\Container;
use Pest\TestSuite;
use Symfony\Component\Console\Input\ArgvInput;
@ -32,6 +34,11 @@ use Symfony\Component\Console\Output\OutputInterface;
$argv = new ArgvInput();
$testSuite = TestSuite::getInstance($rootPath, $argv->getParameterOption('--test-directory', 'tests'));
$shouldExecuteInParallel = $argv->hasParameterOption('--parallel');
// Let's remove the parallel option now we've retrieved its value
if (($parallelKey = array_search('--parallel', $_SERVER['argv'])) !== false) {
unset($_SERVER['argv'][$parallelKey]);
}
$isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated);
@ -51,5 +58,12 @@ use Symfony\Component\Console\Output\OutputInterface;
}
}
if ($shouldExecuteInParallel) {
$_SERVER['argv'][] = '--runner';
$_SERVER['argv'][] = Runner::class;
exit(ParaTestCommand::applicationFactory(getcwd())->run(new ArgvInput()));
}
exit($container->get(Command::class)->run($_SERVER['argv']));
})();