diff --git a/blackbox.php b/blackbox.php index 67a2468..0f6e11b 100644 --- a/blackbox.php +++ b/blackbox.php @@ -10,22 +10,18 @@ }; Application::new($argv) - ->when( - \getenv('BLACKBOX_SET_SIZE') !== false, - static fn(Application $app) => $app->scenariiPerProof((int) \getenv('BLACKBOX_SET_SIZE')), - ) - ->when( - \getenv('ENABLE_COVERAGE') !== false, - static fn(Application $app) => $app + ->map(static fn($app) => match (\getenv('BLACKBOX_ENV')) { + 'extensive' => $app->scenariiPerProof(1_000), + 'coverage' => $app ->codeCoverage( CodeCoverage::of( __DIR__.'/src/', __DIR__.'/tests/', ) - ->dumpTo('coverage.clover') - ->enableWhen(true), + ->dumpTo('coverage.clover'), ) ->scenariiPerProof(1), - ) + default => $app, + }) ->tryToProve(Load::directory(__DIR__.'/tests/')) ->exit(); diff --git a/composer.json b/composer.json index 7878395..e146899 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ }, "require-dev": { "innmind/static-analysis": "~1.3", - "innmind/black-box": "~6.2", + "innmind/black-box": "~7.0", "innmind/coding-standard": "~2.0" } }