Skip to content

Commit

Permalink
Small tweaks to php scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel committed Jul 14, 2018
1 parent 094c2aa commit c7d1c14
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 128 deletions.
12 changes: 6 additions & 6 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

error_reporting(E_ALL);

$environment = isset($_ENV) ? $_ENV : array();
$environment = $_ENV ?? array();
// Note: php.ini-development sets variables_order="GPCS" not "EGPCS", in which case $_ENV is NOT populated.
// detect and handle this case, or die or warn
if (empty($environment)) {
Expand Down Expand Up @@ -1028,7 +1028,7 @@ function mail_qa_team($data, $status = false)
{
$url_bits = parse_url(QA_SUBMISSION_PAGE);

if (($proxy = getenv('http_proxy'))) {
if ($proxy = getenv('http_proxy')) {
$proxy = parse_url($proxy);
$path = $url_bits['host'].$url_bits['path'];
$host = $proxy['host'];
Expand Down Expand Up @@ -1148,7 +1148,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS
unset($pipes[0]);
}

$timeout = $valgrind ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60);
$timeout = $valgrind ? 300 : ($env['TEST_TIMEOUT'] ?? 60);

while (true) {
/* hide errors from interrupted syscalls */
Expand Down Expand Up @@ -1934,7 +1934,7 @@ function run_test($php, $file, $env)
$hrtime = hrtime();
$startTime = $hrtime[0]*1000000000 + $hrtime[1];

$out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null, $captureStdIn, $captureStdOut, $captureStdErr);
$out = system_with_timeout($cmd, $env, $section_text['STDIN'] ?? null, $captureStdIn, $captureStdOut, $captureStdErr);

junit_finish_timer($shortname);
$hrtime = hrtime();
Expand Down Expand Up @@ -2215,7 +2215,7 @@ function run_test($php, $file, $env)
error_report($file, $log_filename, $tested);
}
}

if ($valgrind && $leaked && $cfg["show"]["mem"]) {
show_file_block('mem', file_get_contents($memcheck_filename));
}
Expand Down Expand Up @@ -2823,7 +2823,7 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag

junit_suite_record($suite, 'test_total');

$time = null !== $time ? $time : junit_get_timer($file_name);
$time = $time ?? junit_get_timer($file_name);
junit_suite_record($suite, 'execution_time', $time);

$escaped_details = htmlspecialchars($details, ENT_QUOTES, 'UTF-8');
Expand Down
Loading

0 comments on commit c7d1c14

Please sign in to comment.