First look at revamping regression tests for php3

From: Date: Thu, 20 Aug 1998 03:11:54 +0000
Subject: First look at revamping regression tests for php3
Groups: php.dev 
Request: Send a blank email to php-dev+get-329@lists.php.net to get a copy of this message
Folks: In order to reinstate the regression testing that was apparently available some time ago (in PHP2?), I've taken the AWK + shell programs (testphp.awk and testphp) programs and have sort of merged them into one Perl program testphp.pl If I've done things properly, this along with some of the test programs originally from the directory "test" have been imported into CVS under the name/directory "regtests". The "sort-of-combined" part of the statement above is that there are some major changes to how regression testing works. testphp.pl assumes a running HTTP server with PHP installed---the older version didn't assume a running HTTP server. testphp.pl also assumes the HTTP server has and can run the regression test programs that will be specified by test-control files. To run testphp.pl you pass the name of the server and a name of a test-control file. This file looks more or less like the old .php3t files did but with some important changes: 1. The contents of the php program are no longer in the file. Instead they've are in a separate file which is accessible by the HTTP server. in the --FILE-- section is the name of the test program. It is sort of like the URL but without the server/port name. Also, the program can be given an optional argument to specify a string appended after the server/port, but before the name given in the --FILE-- section. 2. We don't support both POST and GET methods simultaneously. In fact I was not aware that one could do this (let alone know how to program it). 3. The --EXPECT-- lines do not start out "Content-type: text/html\n" This is currently assumed. Perhaps in the future we will decide that we want to check header information. Here is test/basic/001.php3t in the new format: --TEST-- Trivial "Hello World" test ... --FILE-- basic/001.phtml --GET-- --EXPECT-- Hello World And in file basic/001.phtml we have the single line: <?php echo "Hello World"?> For other examples, see what (I believe) was checked in. For minimal help on testphp.pl, run "testphp.pl --help" What I have is a bit preliminary. Some of the structure of testphp.pl is a holdover from the AWK code, better control-file checking should be done. Also, the testmenu, and testall scripts have not been revised. Nor have I converted the complete set of tests. Nor have install scripts been thought out getting the php regression tests over to the HTTP server. What's there now is just initial food for thought. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#329) next »