Skip to content

Commit c36e664

Browse files
committed
fix: restored Windows --ARGS-- shell handling
1 parent 63196df commit c36e664

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

run-tests.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ function error_report(string $testname, string $logname, string $tested): void
11811181
* @return false|string
11821182
*/
11831183
function system_with_timeout(
1184-
array $command,
1184+
array|string $command,
11851185
?array $env = null,
11861186
?string $stdin = null,
11871187
?string $stdinFile = null,
@@ -1192,6 +1192,10 @@ function system_with_timeout(
11921192
) {
11931193
global $valgrind;
11941194

1195+
if (IS_WINDOWS && is_string($command)) {
1196+
$command = 'start "" /b /wait ' . $command . ' & exit';
1197+
}
1198+
11951199
$data = '';
11961200

11971201
$bin_env = [];
@@ -1305,10 +1309,10 @@ function create_test_command(
13051309
];
13061310
}
13071311

1308-
function create_shell_invocation(string $command): array
1312+
function create_shell_invocation(string $command): array|string
13091313
{
13101314
if (IS_WINDOWS) {
1311-
return [getenv('COMSPEC') ?: 'cmd.exe', '/d', '/s', '/c', $command];
1315+
return $command;
13121316
}
13131317

13141318
return ['/bin/sh', '-c', "exec $command"];

0 commit comments

Comments
 (0)