Skip to content

Commit

Permalink
Export ENV in .sh file generated by run-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed May 31, 2021
1 parent 140eca6 commit 76a4ea5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2780,9 +2780,14 @@ function run_test(string $php, $file, array $env): string

// write .sh
if (strpos($log_format, 'S') !== false) {
$env_lines = [];
foreach ($env as $env_var => $env_val) {
$env_lines[] = "export $env_var=" . escapeshellarg($env_val);
}
$exported_environment = $env_lines ? "\n" . implode("\n", $env_lines) . "\n" : "";
$sh_script = <<<SH
#!/bin/sh
{$exported_environment}
case "$1" in
"gdb")
gdb --args {$cmd}
Expand Down

0 comments on commit 76a4ea5

Please sign in to comment.