Re: testcase repository
| From: | Joey Smith | Date: | Thu, 20 Jul 2000 10:16:18 +0000 |
| Subject: | Re: testcase repository | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-227@lists.php.net to get a copy of this message | ||
> First create a script, that optionally takes some input (maybe a file
> to read). Put it into the 'bin' directory. Input file into the 'input'
> directory.
> Create a file that gives the expected output of the script. Put it into
> the 'ideal' directory.
> The script file, input file, ideal file are called by the same name.
>
> Now run the main script, which loops through all the scripts in the
> 'bin' directory and runs them, putting the output of each script into
> the 'actual' directory.
> Then run the compare script, which loops through each file in the
> 'ideal' directory and compares it with the same file in the 'actual'
> directory.
> Any differences are then written to another file.
>
> There is a bit more to it than that, but that is the main concept.
>
> Now, there are some unsolved riddles in this setup...
>
> 1. What sort of script to run? At the moment I have been testing by
> running the php.exe under Windows and passing it the file name. Seems
> to work fine, but it may not be ideal. What I may do is create a small
> test harness, that does an HTTP GET to the webserver, passing it the
> script and then collection the returned page, something like that. Then
> we are actually testing the server setup.
I would love this. If I can help, let me know...you'll have to be
patient with me, tho.
Another idea is a a small subset of a webserver that will load the
php4 lib code and run the tests before you even get to "make install",
altough this may be going too far. I would just love to see a "make
check" that ran all known regression tests and worked no matter HOW php
was built (as long as you have the required module...)
>
> 2. This idea works well for the 'built in' parts of PHP (i.e. testing
> 'foreach' statement, or reading files etc) but is not practical for
> testing the modules, as it will need the correct module installation,
> and MySQL installation on any testing computer. Not an insurmountable
> problem, but needs thinking about.
>
Can we see your examples? Either a new CVS module, or a directory
under the qaweb one, perhaps? I'm thinking "qacode".