Req #55736 [NEW]: Added FILE_EXTERNAL section to run-tests.php
| From: | tim at digicol dot de | Date: | Tue, 20 Sep 2011 09:21:53 +0000 |
| Subject: | Req #55736 [NEW]: Added FILE_EXTERNAL section to run-tests.php | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-163707@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: 5.3.8
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:Added FILE_EXTERNAL section to run-tests.php
Description:
------------
In the .phpt files used with run-tests.php, I'd like an option to read the
expected output from external files.
For consistency with the FILE / FILE_EXTERNAL section naming, I'd call this
feature EXPECT_EXTERNAL.
The attached patch (against run-tests.php of PHP 5.3.8) implements this
functionality. Would you mind adding it as a standard feature?
Reason: We often expect relatively large XML output from our tests. Having
to
paste it into the EXPECT section makes the .phpt file large, and the XML is
easier to handle in a separate file (I can run xmllint on it). Also, I'd
like to
reuse one test's expected output as the input for another test, which works
great
with external files.
Test script:
---------------
[digicol@dcxcentosvmware php-5.3.8]$ cat tmp.phpt
--TEST--
Demo
--FILE--
<?php
echo pi() . "\n";
?>
--EXPECT_EXTERNAL--
expected.txt
[digicol@dcxcentosvmware php-5.3.8]$ cat expected.txt
3.1415926535898
[digicol@dcxcentosvmware php-5.3.8]$ php run-tests.php.expect_external -p
which php tmp.phpt
=====================================================================
PHP : /usr/local/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.3.4
ZEND_VERSION: 2.3.0
PHP_OS : Linux - Linux dcxcentosvmware.digicol.local
2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64
INI actual : /usr/local/lib/php.ini
More .INIs :
CWD : /usr/local/src/php-5.3.8
Extra dirs :
VALGRIND : Not used
=====================================================================
Running selected tests.
PASS Demo [tmp.phpt]
=====================================================================
Number of tests : 1 1
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 1 (100.0%) (100.0%)
---------------------------------------------------------------------
Time taken : 0 seconds
=====================================================================
--
Edit bug report at https://bugs.php.net/bug.php?id=55736&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55736&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55736&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55736&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55736&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55736&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55736&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55736&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55736&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55736&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55736&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55736&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55736&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55736&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55736&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55736&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55736&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55736&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55736&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55736&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55736&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55736&r=mysqlcfg