mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Adds -P as a parallel shortcut
This commit is contained in:
19
bin/pest
19
bin/pest
@ -2,10 +2,7 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
use NunoMaduro\Collision\Provider;
|
||||
use ParaTest\Console\Commands\ParaTestCommand;
|
||||
use Pest\Actions\InteractsWithPlugins;
|
||||
use Pest\Actions\ValidatesEnvironment;
|
||||
use Pest\Console\Command;
|
||||
use Pest\Support\Container;
|
||||
use Pest\TestSuite;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
@ -44,20 +41,20 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
ValidatesEnvironment::in($testSuite);
|
||||
|
||||
$args = $_SERVER['argv'];
|
||||
|
||||
// Let's remove any arguments that PHPUnit does not understand
|
||||
if ($argv->hasParameterOption('--test-directory')) {
|
||||
foreach ($_SERVER['argv'] as $key => $value) {
|
||||
foreach ($args as $key => $value) {
|
||||
if (strpos($value, '--test-directory') !== false) {
|
||||
unset($_SERVER['argv'][$key]);
|
||||
unset($args[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_SERVER['argv'] = InteractsWithPlugins::handleArguments($_SERVER['argv']);
|
||||
$command = $argv->hasParameterOption(['--parallel', '-P'])
|
||||
? \Pest\Parallel\Command::class
|
||||
: \Pest\Console\Command::class;
|
||||
|
||||
if ($argv->hasParameterOption('--parallel')) {
|
||||
exit(ParaTestCommand::applicationFactory($testSuite->rootPath)->run(new ArgvInput()));
|
||||
}
|
||||
|
||||
exit($container->get(Command::class)->run($_SERVER['argv']));
|
||||
exit($container->get($command)->run($args));
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user