diff --git a/bin/run-tests.php b/bin/run-tests.php index 5837a1a..5314a26 100644 --- a/bin/run-tests.php +++ b/bin/run-tests.php @@ -75,9 +75,11 @@ function show_usage(): void -s Write output to . - -x Sets 'SKIP_SLOW_TESTS' environmental variable. + -x Sets 'SKIP_SLOW_TESTS' environment variable. - --offline Sets 'SKIP_ONLINE_TESTS' environmental variable. + --online Prevents setting the 'SKIP_ONLINE_TESTS' environment variable. + + --offline Sets 'SKIP_ONLINE_TESTS' environment variable (default). --verbose -v Verbose mode. @@ -355,6 +357,7 @@ function main(): void $num_repeats = 1; $show_progress = true; $ignored_by_ext = []; + $online = null; $cfgtypes = ['show', 'keep']; $cfgfiles = ['skip', 'php', 'clean', 'out', 'diff', 'exp', 'mem']; @@ -553,8 +556,11 @@ function main(): void case 'x': $environment['SKIP_SLOW_TESTS'] = 1; break; + case '--online': + $online = true; + break; case '--offline': - $environment['SKIP_ONLINE_TESTS'] = 1; + $online = false; break; case '--shuffle': $shuffle = true; @@ -637,6 +643,13 @@ function main(): void } } + if ($online === null && !isset($environment['SKIP_ONLINE_TESTS'])) { + $online = false; + } + if ($online !== null) { + $environment['SKIP_ONLINE_TESTS'] = $online ? '0' : '1'; + } + if ($selected_tests && count($test_files) === 0) { echo "No tests found.\n"; return;