Re: Writing PHPT tests
| From: | Rob Nicholson | Date: | Sat, 02 Feb 2008 11:56:22 +0000 |
| Subject: | Re: Writing PHPT tests | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35100@lists.php.net to get a copy of this message | ||
Hi Zoe,
I notice also that the testcase generator and the testcases we have been
committing differ slightly from the conventions listed at:
http://qa.php.net/write-test.php . This was based on
feedback we received
so I think that http://qa.php.net/write-test.php
should be updated.
Specifically the convention of writing multiple small tests to cover
basic, variation and error cases separately differs from the naming
convention suggested on the QA pages. We have also been following a
convention w.r.t comments in the testcase which I think is helpful so I'd
suggest we cover this too. Since the testcase generator adds these
comments its worth documenting them.
I'll produce a patch to the documentation for review if you like.
Rob Nicholson
From:
zoe <zoe.slattery@googlemail.com>
To:
internals@lists.php.net
Date:
02/02/2008 11:21
Subject:
[PHP-DEV] Writing PHPT tests
Hi - for any of you that are writing PHPT tests for existing extensions
- I put a PHP script called generate_phpt.php into PHP 5.3 yesterday
which might help a little.
It's quite a simple command line script (Raghu and I wrote it last
year), it works by looking at the {{{proto line for a function in PHP
source code and construct a test case frame from it. It can be used to
construct very simple tests cases - or to turn an existing PHP file into
PHPT format. It doesn't try and guess what the results of a test should
be :-). I will document it properly on qa.php.net later. In the meantime:
php generate_phpt.php --help
tells you what it's supposed to do.
Zoe
PS - It doesn't work for PHP6 right now because the {{{proto line is
different.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU