mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Initial working draft
This commit is contained in:
14
bin/pest
14
bin/pest
@ -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']));
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user