[php-src] master: run-tests: Improve handling of test reproduction helpers (#23066)
| From: | Tim Düsterhus via GitHub | Date: | Wed, 05 Aug 2026 20:21:01 +0000 |
| Subject: | [php-src] master: run-tests: Improve handling of test reproduction helpers (#23066) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-140504@lists.php.net to get a copy of this message | ||
Author: Tim Düsterhus (TimWolla)
Committer: GitHub (web-flow)
Pusher: TimWolla
Date: 2026-08-05T22:20:58+02:00
Commit: https://github.com/php/php-src/commit/c48fc1e7ab55677833d0e1c4082689154aee769a
Raw diff: https://github.com/php/php-src/commit/c48fc1e7ab55677833d0e1c4082689154aee769a.diff
run-tests: Improve handling of test reproduction helpers (#23066)
* run-tests: Add
strace sub command for generated test reproduction scripts
Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
* run-tests: Pass all provided arguments to valgrind
* run-tests: Pass all provided arguments to gdb
* run-tests: Pass all provided arguments to lldb
* run-tests: exec into test reproduction helpers
This avoids needlessly carrying around the shell and provides more direct
access to the running executable.
---------
Co-authored-by: Derick Rethans <github@derickrethans.nl>
Changed paths:
M run-tests.php
Diff:
diff --git a/run-tests.php b/run-tests.php
index 89bd8ffb797c..89b5882f6674 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -2920,19 +2920,27 @@ function run_test(string $php, $file, array $env): string
{$exported_environment}
case "$1" in
"gdb")
- gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS' --args
{$orig_cmd}
+ shift
+ exec gdb -ex 'unset environment LINES' -ex 'unset environment COLUMNS'
"$@" --args {$orig_cmd}
;;
"lldb")
- lldb -- {$orig_cmd}
+ shift
+ exec lldb "$@" -- {$orig_cmd}
;;
"valgrind")
- USE_ZEND_ALLOC=0 valgrind $2 {$orig_cmd}
+ export USE_ZEND_ALLOC=0
+ shift
+ exec valgrind "$@" {$orig_cmd}
+ ;;
+"strace")
+ shift
+ exec strace "$@" {$orig_cmd}
;;
"rr")
- rr record $2 {$orig_cmd}
+ exec rr record $2 {$orig_cmd}
;;
*)
- {$orig_cmd}
+ exec {$orig_cmd}
;;
esac
SH;