Commit ee5fc4a0300 for php.net
commit ee5fc4a0300bb75350dd3a4d51e237e73e31ff83
Author: Ilija Tovilo <ilija.tovilo@me.com>
Date: Mon Jan 19 00:32:34 2026 +0100
Fix run-tests.php -s flag
- Remove unnedded putenv('NO_INTERACTION=1') when executing individual tests.
- Fix undefined variable errors when executing individual tests.
- Fix -s when NO_INTERACTION=1 is set, given we don't need to prompt anyway.
Fixes GH-20961
Closes GH-20970
diff --git a/run-tests.php b/run-tests.php
index a661a7f227a..195d17fa0a0 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -697,7 +697,8 @@ function main(): void
write_information($user_tests, $phpdbg);
if ($test_cnt) {
- putenv('NO_INTERACTION=1');
+ $exts_tested = [];
+ $exts_skipped = [];
usort($test_files, "test_sort");
$start_timestamp = time();
$start_time = hrtime(true);
@@ -777,7 +778,7 @@ function main(): void
show_end($start_timestamp, $start_time, $end_time);
show_summary();
- save_results($output_file, /* prompt_to_save_results: */ true);
+ save_results($output_file, /* prompt_to_save_results: */ !$just_save_results);
}
$junit->saveXML();
@@ -920,7 +921,7 @@ function save_results(string $output_file, bool $prompt_to_save_results): void
{
global $sum_results, $failed_test_summary, $PHP_FAILED_TESTS, $php;
- if (getenv('NO_INTERACTION')) {
+ if (getenv('NO_INTERACTION') && $prompt_to_save_results) {
return;
}