Skip to content

Commit e9dc878

Browse files
author
Derick Rethans
committed
- Added the writing of .sh files so that we can run the tests (including all
INI settings) in one go.
1 parent 3690ce3 commit e9dc878

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

run-tests.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ function verify_config()
197197
if (getenv('TEST_PHP_LOG_FORMAT')) {
198198
$log_format = strtoupper(getenv('TEST_PHP_LOG_FORMAT'));
199199
} else {
200-
$log_format = 'LEOD';
200+
$log_format = 'LEODS';
201201
}
202202

203203
// Check whether a detailed log is wanted.
@@ -1352,6 +1352,7 @@ function run_test($php, $file, $env)
13521352
$exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'exp';
13531353
$output_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'out';
13541354
$memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'mem';
1355+
$sh_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'sh';
13551356
$temp_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
13561357
$test_file = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
13571358
$temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
@@ -1382,6 +1383,7 @@ function run_test($php, $file, $env)
13821383
'exp' => $exp_filename,
13831384
'out' => $output_filename,
13841385
'mem' => $memcheck_filename,
1386+
'sh' => $sh_filename,
13851387
'php' => $temp_file,
13861388
'skip' => $temp_skipif,
13871389
'clean'=> $temp_clean);
@@ -1398,6 +1400,7 @@ function run_test($php, $file, $env)
13981400
@unlink($exp_filename);
13991401
@unlink($output_filename);
14001402
@unlink($memcheck_filename);
1403+
@unlink($sh_filename);
14011404
@unlink($temp_file);
14021405
@unlink($test_file);
14031406
@unlink($temp_skipif);
@@ -1959,6 +1962,15 @@ function run_test($php, $file, $env)
19591962
error("Cannot create test diff - $diff_filename");
19601963
}
19611964

1965+
// write .sh
1966+
if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, b"#!/bin/sh
1967+
1968+
{$cmd}
1969+
", FILE_BINARY) === false) {
1970+
error("Cannot create test shell script - $sh_filename");
1971+
}
1972+
chmod($sh_filename, 0755);
1973+
19621974
// write .log
19631975
if (strpos($log_format, 'L') !== false && file_put_contents($log_filename, b"
19641976
---- EXPECTED OUTPUT

0 commit comments

Comments
 (0)