Skip to content

Commit 4e1f77e

Browse files
committed
run-tests.php: Remove extra env vars
1 parent c927d24 commit 4e1f77e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

run-tests.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,8 +2723,12 @@ function run_test(string $php, $file, array $env): string
27232723
if (!$passed || $leaked) {
27242724
// write .sh
27252725
if (strpos($log_format, 'S') !== false) {
2726-
$env_lines = [];
2726+
$env_lines = ['unset $(env | cut -d= -f1)'];
27272727
foreach ($env as $env_var => $env_val) {
2728+
if (strval($env_val) === '') {
2729+
// proc_open does not pass empty env vars
2730+
continue;
2731+
}
27282732
$env_lines[] = "export $env_var=" . escapeshellarg($env_val ?? "");
27292733
}
27302734
$exported_environment = "\n" . implode("\n", $env_lines) . "\n";
@@ -2733,7 +2737,7 @@ function run_test(string $php, $file, array $env): string
27332737
{$exported_environment}
27342738
case "$1" in
27352739
"gdb")
2736-
gdb --args {$orig_cmd}
2740+
gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' --args {$orig_cmd}
27372741
;;
27382742
"lldb")
27392743
lldb -- {$orig_cmd}

0 commit comments

Comments
 (0)