php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60923 Failing tests for sapi/cli
Submitted: 2012-01-29 12:20 UTC Modified: 2012-01-30 12:20 UTC
Votes:3
Avg. Score:3.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:0 (0.0%)
From: robertbasic dot com at gmail dot com Assigned: mike (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 5.4SVN-2012-01-29 (SVN) OS: GNU/Linux (Fedora 16)
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:
21 + 33 = ?
Subscribe to this entry?

 
 [2012-01-29 12:20 UTC] robertbasic dot com at gmail dot com
Description:
------------
After checking out PHP54 from branches/PHP_5_4, running:
./buildconf
./configure
make
make test

some tests for sapi/cli are failing. These tests were OK when I tested from tags/php_5_4_0RC6

The failing tests are:

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
version string [sapi/cli/tests/001.phpt]
strip comments and whitespace with -w [sapi/cli/tests/007.phpt]
execute a file with -f [sapi/cli/tests/008.phpt]
using invalid combinations of cmdline options [sapi/cli/tests/009.phpt]
syntax check [sapi/cli/tests/011.phpt]
invalid arguments and error messages [sapi/cli/tests/012.phpt]
syntax highlighting [sapi/cli/tests/014.phpt]
CLI long options [sapi/cli/tests/015.phpt]
=====================================================================

Full reports were submitted to http://qa.php.net/reports/ after running the tests.


Patches

diff (last revision 2012-01-29 17:39 UTC by robertbasic dot com at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-29 13:50 UTC] rasmus@php.net
I am not seeing these failures here. Could you dig into one of them to see if you 
can figure out why it is failing for you?
 [2012-01-29 13:50 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2012-01-29 14:24 UTC] robertbasic dot com at gmail dot com
Will do.

By looking at the expected and the actual outputs of sapi/cli/tests/001.phpt, looks like that var_dump(`$php -n -v`); first prints out the PHP version (the result from php -n -v) and then var_dumps a NULL, whereas it should var_dump the result from php -n -v.

Actually, all these failing tests are this kind of thing: printing the result, var_dumping NULL, instead of var_dumping the result. What's strange, is that, for example sapi/cli/tests/007.phpt, from 3 var_dumps in that test, only one does this (the 2nd), the other 2 work as expected.

Given that this works for RC6, I'm looking at commits since then, to see if anything from there is causing this.

Any hints on what should I do to check is my system affecting this somehow? I'm using the test instructions you posted on codepad some time ago.

Thanks!
 [2012-01-29 16:21 UTC] robertbasic dot com at gmail dot com
Hello again!

I did a svn log -r {2012-01-10}:HEAD against the PHP54 branch and went through those commits.

What I've managed to do so far is to find what commit is causing the tests to fail (at least I think it's this one): http://svn.php.net/viewvc?view=revision&revision=322743

The r322743 of the code has the tests failing, while the one prior to it (r322678) has the tests passing.

Sadly my C skills are almost non-existent, so I can't promise a patch, but will continue to poke around it.
 [2012-01-29 17:39 UTC] robertbasic dot com at gmail dot com
Think I narrowed it down even more. Seems to me the problem is in the new php_output_stderr function - when I comment it out, the tests pass again. I'll attach a diff to show what I did.
 [2012-01-29 19:05 UTC] rasmus@php.net
Yeah, looks to be the same as bug #60920
 [2012-01-29 19:09 UTC] rasmus@php.net
-Status: Feedback +Status: Critical
 [2012-01-30 12:13 UTC] mike@php.net
-Assigned To: +Assigned To: mike
 [2012-01-30 12:17 UTC] mike@php.net
Automatic comment from SVN on behalf of mike
Revision: http://svn.php.net/viewvc/?view=revision&revision=322931
Log: use stderr before, stdout after php_output_startup() and sapi_module.ub_write() after php_output_activate()

- fixes Bug #60920  CLI: php -v on STDERR
- fixes Bug #60923  Failing tests for sapi/cli
 [2012-01-30 12:20 UTC] mike@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-01-30 12:20 UTC] mike@php.net
-Status: Critical +Status: Closed
 [2012-01-30 12:33 UTC] robertbasic dot com at gmail dot com
Just tested again with this fix/commit, the tests pass again!

Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 10:01:31 2024 UTC