php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #79913 use exec in sh files generated by run-test.php
Submitted: 2020-07-29 22:25 UTC Modified: 2020-07-29 23:18 UTC
From: santi at mola dot io Assigned: beberlei (profile)
Status: Closed Package: Testing related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
44 - 6 = ?
Subscribe to this entry?

 
 [2020-07-29 22:25 UTC] santi at mola dot io
Description:
------------
I often use gdb to debug a failed phpt tests, usually by editing the generated .sh file and prepending "gdb --args" to the command. It is also possible to run gdb directly on the .sh file (setting follow-fork-mode child) but it is less convenient, and also problematic if the test itself forks.

This can be solved by just running the test command with "exec". AFAIK this should be inocuous for regular test running, but quite convenient when running gdb.

Test script:
---------------
gdb --args bash tests/failing_tests.phpt

Expected result:
----------------
gdb running normally

Actual result:
--------------
gdb debugging the parent bash process instead (by default)

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-29 22:28 UTC] santi at mola dot io
The following pull request has been associated:

Patch Name: Fix #79913: add exec to run-tests.php's sh files
On GitHub:  https://github.com/php/php-src/pull/5909
Patch:      https://github.com/php/php-src/pull/5909.patch
 [2020-07-29 23:18 UTC] beberlei@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: beberlei
 [2020-07-29 23:18 UTC] beberlei@php.net
Hey Santi,

thank you for your contribution, but run-tests.php in master is changed already to allow running "some-test.sh gdb" to directly go into GDB. It is a different approach, but arrives at the same result. As this is a new feature, your PR will not get merged into 7.3 or 7.4 both receiving only bugfixes.

I am therefore closing this issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 11:01:33 2024 UTC