mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Improvements
This commit is contained in:
2
bin/pest
2
bin/pest
@ -62,7 +62,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
$_SERVER['argv'][] = '--runner';
|
$_SERVER['argv'][] = '--runner';
|
||||||
$_SERVER['argv'][] = Runner::class;
|
$_SERVER['argv'][] = Runner::class;
|
||||||
|
|
||||||
exit(ParaTestCommand::applicationFactory(getcwd())->run(new ArgvInput()));
|
exit(ParaTestCommand::applicationFactory($testSuite->rootPath)->run(new ArgvInput()));
|
||||||
}
|
}
|
||||||
|
|
||||||
exit($container->get(Command::class)->run($_SERVER['argv']));
|
exit($container->get(Command::class)->run($_SERVER['argv']));
|
||||||
|
|||||||
@ -40,7 +40,7 @@ final class PestRunnerWorker
|
|||||||
$args = array_merge(
|
$args = array_merge(
|
||||||
$args,
|
$args,
|
||||||
$this->executableTest->commandArguments(
|
$this->executableTest->commandArguments(
|
||||||
'/Users/luke/Packages/pest/bin/pest',
|
$this->getPestBinary(),
|
||||||
$options->filtered(),
|
$options->filtered(),
|
||||||
$options->passthru()
|
$options->passthru()
|
||||||
)
|
)
|
||||||
@ -109,6 +109,17 @@ final class PestRunnerWorker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getPestBinary(): string
|
||||||
|
{
|
||||||
|
// Used when Pest is required using composer.
|
||||||
|
$vendorPath = dirname(__DIR__, 7) . '/bin/pest';
|
||||||
|
|
||||||
|
// Used when Pest maintainers are running Pest tests.
|
||||||
|
$localPath = dirname(__DIR__, 3) . '/bin/pest';
|
||||||
|
|
||||||
|
return file_exists($vendorPath) ? $vendorPath : $localPath;
|
||||||
|
}
|
||||||
|
|
||||||
public function getWorkerCrashedException(?Throwable $previousException = null): WorkerCrashedException
|
public function getWorkerCrashedException(?Throwable $previousException = null): WorkerCrashedException
|
||||||
{
|
{
|
||||||
return WorkerCrashedException::fromProcess(
|
return WorkerCrashedException::fromProcess(
|
||||||
|
|||||||
@ -13,6 +13,7 @@ use ParaTest\Runners\PHPUnit\Options;
|
|||||||
use ParaTest\Runners\PHPUnit\ResultPrinter;
|
use ParaTest\Runners\PHPUnit\ResultPrinter;
|
||||||
use ParaTest\Runners\PHPUnit\RunnerInterface;
|
use ParaTest\Runners\PHPUnit\RunnerInterface;
|
||||||
use ParaTest\Runners\PHPUnit\SuiteLoader;
|
use ParaTest\Runners\PHPUnit\SuiteLoader;
|
||||||
|
use Pest\Actions\LoadStructure;
|
||||||
use Pest\Factories\TestCaseFactory;
|
use Pest\Factories\TestCaseFactory;
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
use PHPUnit\TextUI\TestRunner;
|
use PHPUnit\TextUI\TestRunner;
|
||||||
@ -100,6 +101,8 @@ final class Runner implements RunnerInterface
|
|||||||
{
|
{
|
||||||
$this->beforeLoadChecks();
|
$this->beforeLoadChecks();
|
||||||
|
|
||||||
|
LoadStructure::in(TestSuite::getInstance()->rootPath);
|
||||||
|
|
||||||
$loader->load();
|
$loader->load();
|
||||||
$this->loadPestSuite();
|
$this->loadPestSuite();
|
||||||
|
|
||||||
@ -327,6 +330,7 @@ final class Runner implements RunnerInterface
|
|||||||
private function loadPestSuite(): void
|
private function loadPestSuite(): void
|
||||||
{
|
{
|
||||||
$pestTestSuite = TestSuite::getInstance();
|
$pestTestSuite = TestSuite::getInstance();
|
||||||
|
LoadStructure::in($pestTestSuite->rootPath);
|
||||||
|
|
||||||
$files = array_values(array_map(function (TestCaseFactory $factory): string {
|
$files = array_values(array_map(function (TestCaseFactory $factory): string {
|
||||||
return $factory->filename;
|
return $factory->filename;
|
||||||
|
|||||||
Reference in New Issue
Block a user