@@ -693,6 +693,7 @@ function main(): void
693
693
if ($ test_cnt ) {
694
694
putenv ('NO_INTERACTION=1 ' );
695
695
usort ($ test_files , "test_sort " );
696
+ $ start_timestamp = time ();
696
697
$ start_time = hrtime (true );
697
698
698
699
echo "Running selected tests. \n" ;
@@ -3620,6 +3621,11 @@ class RuntestsValgrind
3620
3621
protected bool $ version_3_8_0 ;
3621
3622
protected string $ tool ;
3622
3623
3624
+ public function getHeader (): string
3625
+ {
3626
+ return $ this ->header ;
3627
+ }
3628
+
3623
3629
public function __construct (array $ environment , string $ tool = 'memcheck ' )
3624
3630
{
3625
3631
$ this ->tool = $ tool ;
@@ -3636,6 +3642,20 @@ public function __construct(array $environment, string $tool = 'memcheck')
3636
3642
$ this ->header = sprintf ("%s (%s) " , trim ($ header ), $ this ->tool );
3637
3643
$ this ->version_3_8_0 = version_compare ($ version , '3.8.0 ' , '>= ' );
3638
3644
}
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
+ }
3639
3659
}
3640
3660
3641
3661
class TestFile
0 commit comments