Skip to content

Commit 1c43015

Browse files
committed
Revert "run-tests: removed unused code"
This reverts commit 31edca1.
1 parent 99d4d53 commit 1c43015

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

run-tests.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ function main(): void
693693
if ($test_cnt) {
694694
putenv('NO_INTERACTION=1');
695695
usort($test_files, "test_sort");
696+
$start_timestamp = time();
696697
$start_time = hrtime(true);
697698

698699
echo "Running selected tests.\n";
@@ -3620,6 +3621,11 @@ class RuntestsValgrind
36203621
protected bool $version_3_8_0;
36213622
protected string $tool;
36223623

3624+
public function getHeader(): string
3625+
{
3626+
return $this->header;
3627+
}
3628+
36233629
public function __construct(array $environment, string $tool = 'memcheck')
36243630
{
36253631
$this->tool = $tool;
@@ -3636,6 +3642,20 @@ public function __construct(array $environment, string $tool = 'memcheck')
36363642
$this->header = sprintf("%s (%s)", trim($header), $this->tool);
36373643
$this->version_3_8_0 = version_compare($version, '3.8.0', '>=');
36383644
}
3645+
3646+
public function wrapCommand(string $cmd, string $memcheck_filename, bool $check_all): string
3647+
{
3648+
$vcmd = "valgrind -q --tool={$this->tool} --trace-children=yes";
3649+
if ($check_all) {
3650+
$vcmd .= ' --smc-check=all';
3651+
}
3652+
3653+
/* --vex-iropt-register-updates=allregs-at-mem-access is necessary for phpdbg watchpoint tests */
3654+
if ($this->version_3_8_0) {
3655+
return "$vcmd --vex-iropt-register-updates=allregs-at-mem-access --log-file=$memcheck_filename $cmd";
3656+
}
3657+
return "$vcmd --vex-iropt-precise-memory-exns=yes --log-file=$memcheck_filename $cmd";
3658+
}
36393659
}
36403660

36413661
class TestFile

0 commit comments

Comments
 (0)