Updated run-tests.php to work well on Win32. The changes *should* work on Unix as well, and I'll do some testing once I finish getting my newer Linux box set up :).
Added some tricks I've found useful in writing unit tests: * Require a specific explicit path to the PHP executable. * Require a php.ini file (to control the exact configuration). * Abort the test if any requirement is not met. * Log what exactly is being tested (version & path, etc.). * On failure log additional detail (to a seperate file). Some enhancements: * Run basic (non-extension/PEAR) tests first. * Added project to Win32 workspace, and made dependent on php4ts. * Generate compiler-style error reports that Emacs/MSVC can grok. Put a little work into the test cases. The entire tests.log file for Win32 is attached, with an abbreviated version below: ===================================================================== TIME 2002-05-17 00:39:59 - start of test run CWD : C:\net.php\php4-work PHP : Debug_TS\\php-cgi.exe PHP_SAPI : cgi PHP_VERSION : 4.3.0-dev PHP_OS : WINNT INI actual : C:\net.php\php4-work\tests\php.ini INI wanted : C:\net.php\php4-work\tests\php.ini INI tests : C:\net.php\php4-work\Debug_TS\php.ini ===================================================================== Will test compiled extension: standard Will test compiled extension: bcmath Will test compiled extension: calendar Will test compiled extension: ctype Will test compiled extension: com Will test compiled extension: ftp Will test compiled extension: mbstring Will test compiled extension: mysql Will test compiled extension: odbc Will test compiled extension: overload Will test compiled extension: pcre Will test compiled extension: session Will test compiled extension: tokenizer Will test compiled extension: xml Will test compiled extension: wddx ===================================================================== [snip] ===================================================================== TIME 2002-05-17 00:40:23 - end of test run TEST RESULT SUMMARY ===================================================================== Number of tests : 223 Tests skipped : 70 (31.4%) Tests failed : 22 ( 9.9%) Tests passed : 131 (58.7%) ===================================================================== Skipped 24 extensions
===================================================================== TIME 2002-05-17 00:39:59 - start of test run CWD : C:\net.php\php4-work PHP : Debug_TS\\php-cgi.exe PHP_SAPI : cgi PHP_VERSION : 4.3.0-dev PHP_OS : WINNT INI actual : C:\net.php\php4-work\tests\php.ini INI wanted : C:\net.php\php4-work\tests\php.ini INI tests : C:\net.php\php4-work\Debug_TS\php.ini ===================================================================== Will test compiled extension: standard Will test compiled extension: bcmath Will test compiled extension: calendar Will test compiled extension: ctype Will test compiled extension: com Will test compiled extension: ftp Will test compiled extension: mbstring Will test compiled extension: mysql Will test compiled extension: odbc Will test compiled extension: overload Will test compiled extension: pcre Will test compiled extension: session Will test compiled extension: tokenizer Will test compiled extension: xml Will test compiled extension: wddx ===================================================================== .... directory C:\net.php\php4-work\tests\basic PASS Trivial "Hello World" test PASS Simple POST Method test PASS GET and POST Method combined PASS Two variables in POST data PASS Three variables in POST data PASS Add 3 variables together and print result PASS Multiply 3 variables and print result PASS Divide 3 variables and print result PASS Subtract 3 variables and print result PASS Testing | and & operators PASS Testing $argc and $argv handling .... directory C:\net.php\php4-work\tests\classes PASS Classes general test PASS Classes inheritance test .... directory C:\net.php\php4-work\tests PASS dirname test .... directory C:\net.php\php4-work\tests\func PASS Strlen() function test PASS Static variables in functions PASS General function test PASS General function test PASS Testing register_shutdown_function() FAIL Output buffering tests (006.phpt). C:\net.php\php4-work\tests\func\006.phpt(1) : Output buffering tests C:\net.php\php4-work\tests\func\006.log(1) : Output buffering tests PASS INI functions test .... directory C:\net.php\php4-work\tests\lang PASS Simple If condition test PASS Simple While Loop Test PASS Simple Switch Test PASS Simple If/Else Test PASS Simple If/ElseIf/Else Test PASS Nested If/ElseIf/Else Test PASS Function call with global and static variables PASS Testing recursive function PASS Testing function parameter passing PASS Testing function parameter passing with a return value PASS Testing nested functions PASS Testing stack after early function return PASS Testing eval function PASS Testing eval function inside user-defined function PASS Testing include PASS Testing user-defined function in included file PASS Testing user-defined function falling out of an If into another PASS eval() test PASS eval() test PASS Switch test 1 PASS Switch test 2 PASS Switch test 3 PASS Regression test PASS Looped regression test (may take a while) PASS Mean recursion test PASS Testing string scanner confirmance PASS Testing do-while loop PASS Testing calling user-level functions from C FAIL OO Bug Test (Bug #7515) (029.phpt). C:\net.php\php4-work\tests\lang\029.phpt(1) : OO Bug Test (Bug #7515) C:\net.php\php4-work\tests\lang\029.log(1) : OO Bug Test (Bug #7515) PASS $this in constructor test FAIL Internal hash position bug on assignment (Bug #16227) (031.phpt). C:\net.php\php4-work\tests\lang\031.phpt(1) : Internal hash position bug on assignment (Bug #16227) C:\net.php\php4-work\tests\lang\031.log(1) : Internal hash position bug on assignment (Bug #16227) PASS Class method registration PASS Alternative syntaxes test .... directory C:\net.php\php4-work\tests\strings PASS String functions PASS Formatted print functions PASS HTML entities --------------------------------------------------------------------- .... skipped extension: bz2 --------------------------------------------------------------------- .... skipped extension: crack --------------------------------------------------------------------- .... testing extension: ctype .... directory C:\net.php\php4-work\ext\ctype\tests PASS ctype on integers PASS ctype on strings --------------------------------------------------------------------- .... skipped extension: cybermut --------------------------------------------------------------------- .... skipped extension: db --------------------------------------------------------------------- .... skipped extension: dbplus --------------------------------------------------------------------- .... skipped extension: dbx --------------------------------------------------------------------- .... skipped extension: dio --------------------------------------------------------------------- .... skipped extension: domxml --------------------------------------------------------------------- .... skipped extension: exif --------------------------------------------------------------------- .... skipped extension: gmp --------------------------------------------------------------------- .... skipped extension: iconv --------------------------------------------------------------------- .... skipped extension: interbase --------------------------------------------------------------------- .... testing extension: mbstring .... directory C:\net.php\php4-work\ext\mbstring\tests PASS Simple multi-byte print test (EUC-JP) PASS mb_internal_encoding() test FAIL mb_http_input() (003.phpt). C:\net.php\php4-work\ext\mbstring\tests\003.phpt(1) : mb_http_input() C:\net.php\php4-work\ext\mbstring\tests\003.log(1) : mb_http_input() PASS mb_http_output() PASS mb_detect_order() PASS mb_substitute_character() PASS mb_output_handler() (EUC-JP) PASS mb_preferred_mime_name() PASS mb_strlen() PASS mb_strpos() PASS mb_strrpos() PASS mb_substr() PASS mb_strcut() PASS mb_strimwidth() PASS mb_convert_variables() PASS mb_convert_encoding() PASS mb_detect_encoding() PASS mb_strwidth() PASS mb_strlen() --------------------------------------------------------------------- .... skipped extension: mcrypt --------------------------------------------------------------------- .... skipped extension: mcve --------------------------------------------------------------------- .... skipped extension: ncurses --------------------------------------------------------------------- .... skipped extension: openssl --------------------------------------------------------------------- .... skipped extension: pcntl --------------------------------------------------------------------- .... skipped extension: pgsql --------------------------------------------------------------------- .... skipped extension: pspell --------------------------------------------------------------------- .... testing extension: session .... directory C:\net.php\php4-work\ext\session\tests PASS Session Object Serialization PASS session_unset() without any session PASS Session Object Deserialization PASS session_set_save_handler test PASS Custom save handler, multiple session_start()s, complex data structure test. PASS References between variables in sessions --------------------------------------------------------------------- .... skipped extension: skeleton --------------------------------------------------------------------- .... testing extension: standard .... directory C:\net.php\php4-work\ext\standard\tests\aggregation PASS aggregating everything PASS aggregating all methods PASS aggregating methods specified in the list PASS aggregating methods matching regular expression PASS aggregating all default properties PASS aggregating default properties specified in the list PASS aggregating default properties matching regular expression PASS retrieving aggregation info PASS deaggreating .... directory C:\net.php\php4-work\ext\standard\tests\array FAIL Test array_merge and array_walk (001.phpt). C:\net.php\php4-work\ext\standard\tests\array\001.phpt(1) : Test array_merge and array_walk C:\net.php\php4-work\ext\standard\tests\array\001.log(1) : Test array_merge and array_walk FAIL Test arsort, asort, krsort, ksort, rsort, and sort (002.phpt). C:\net.php\php4-work\ext\standard\tests\array\002.phpt(1) : Test arsort, asort, krsort, ksort, rsort, and sort C:\net.php\php4-work\ext\standard\tests\array\002.log(1) : Test arsort, asort, krsort, ksort, rsort, and sort FAIL Test usort, uksort and uasort (003.phpt). C:\net.php\php4-work\ext\standard\tests\array\003.phpt(1) : Test usort, uksort and uasort C:\net.php\php4-work\ext\standard\tests\array\003.log(1) : Test usort, uksort and uasort PASS Test natsort and natcasesort PASS search_array and in_array (including bug 13567) PASS count .... directory C:\net.php\php4-work\ext\standard\tests\assert PASS assert() .... directory C:\net.php\php4-work\ext\standard\tests\file FAIL File type functions (001.phpt). C:\net.php\php4-work\ext\standard\tests\file\001.phpt(1) : File type functions C:\net.php\php4-work\ext\standard\tests\file\001.log(1) : File type functions FAIL File/Stream functions (002.phpt). C:\net.php\php4-work\ext\standard\tests\file\002.phpt(1) : File/Stream functions C:\net.php\php4-work\ext\standard\tests\file\002.log(1) : File/Stream functions FAIL is_*() and file_exists() return values are boolean. (003.phpt). C:\net.php\php4-work\ext\standard\tests\file\003.phpt(1) : is_*() and file_exists() return values are boolean. C:\net.php\php4-work\ext\standard\tests\file\003.log(1) : is_*() and file_exists() return values are boolean. .... directory C:\net.php\php4-work\ext\standard\tests\general_functions PASS sprintf() function PASS quoted_printable_decode() function test PASS levenshtein() function test PASS fgetcsv() with tab delimited fields (BUG #8258) PASS is_scalar() function test FAIL quoted_printable_decode() function test with CR/LF (006.phpt). C:\net.php\php4-work\ext\standard\tests\general_functions\006.phpt(1) : quoted_printable_decode() function test with CR/LF C:\net.php\php4-work\ext\standard\tests\general_functions\006.log(1) : quoted_printable_decode() function test with CR/LF .... directory C:\net.php\php4-work\ext\standard\tests\math PASS Simple math tests FAIL Tests for floor en ceil (floorceil.phpt). C:\net.php\php4-work\ext\standard\tests\math\floorceil.phpt(1) : Tests for floor en ceil C:\net.php\php4-work\ext\standard\tests\math\floorceil.log(1) : Tests for floor en ceil FAIL Various pow() tests (pow.phpt). C:\net.php\php4-work\ext\standard\tests\math\pow.phpt(1) : Various pow() tests C:\net.php\php4-work\ext\standard\tests\math\pow.log(1) : Various pow() tests PASS Simple math tests .... directory C:\net.php\php4-work\ext\standard\tests\reg PASS RegReplace test 1 PASS RegReplace test 2 PASS ereg_replace single-quote test PASS simple ereg test PASS Test Regular expression register support in ereg PASS Test ereg_replace of start-of-line PASS Test empty result buffer in reg_replace PASS Test back-references in regular expressions FAIL Test split() (009.phpt). C:\net.php\php4-work\ext\standard\tests\reg\009.phpt(1) : Test split() C:\net.php\php4-work\ext\standard\tests\reg\009.log(1) : Test split() PASS Long back references PASS \0 back reference PASS nonexisting back reference PASS escapes in replace string PASS backreferences not replaced recursively PASS replace empty matches PASS test backslash handling in regular expressions .... directory C:\net.php\php4-work\ext\standard\tests\serialize PASS serialize()/unserialize()/var_dump() PASS serialize() (Bug #14293) .... directory C:\net.php\php4-work\ext\standard\tests\strings PASS strtr() function PASS trim() function FAIL wordwrap() function (wordwrap.phpt). C:\net.php\php4-work\ext\standard\tests\strings\wordwrap.phpt(1) : wordwrap() function C:\net.php\php4-work\ext\standard\tests\strings\wordwrap.log(1) : wordwrap() function .... directory C:\net.php\php4-work\ext\standard\tests\time PASS microtime() function FAIL strtotime() function (002.phpt). C:\net.php\php4-work\ext\standard\tests\time\002.phpt(1) : strtotime() function C:\net.php\php4-work\ext\standard\tests\time\002.log(1) : strtotime() function .... directory C:\net.php\php4-work\ext\standard\tests\versioning PASS version_compare test --------------------------------------------------------------------- .... skipped extension: sysvmsg --------------------------------------------------------------------- .... testing extension: xml .... directory C:\net.php\php4-work\ext\xml\tests PASS XML parser test, function callbacks PASS XML parser test, object tuple callbacks PASS XML parser test, xml_set_object callbacks PASS XML parser case folding test PASS UTF-8<->ISO Latin 1 encoding/decoding test PASS xml_parse_into_struct/umlauts in tags --------------------------------------------------------------------- .... skipped extension: xslt --------------------------------------------------------------------- .... skipped extension: zip --------------------------------------------------------------------- .... skipped extension: zlib --------------------------------------------------------------------- .... testing extension: PEAR .... directory C:\net.php\php4-work\pear\Console\tests FAIL Console_Getopt (001-getopt.phpt). C:\net.php\php4-work\pear\Console\tests\001-getopt.phpt(1) : Console_Getopt C:\net.php\php4-work\pear\Console\tests\001-getopt.log(1) : Console_Getopt .... directory C:\net.php\php4-work\pear\tests FAIL PEAR constructor/destructor test (pear1.phpt). C:\net.php\php4-work\pear\tests\pear1.phpt(1) : PEAR constructor/destructor test C:\net.php\php4-work\pear\tests\pear1.log(1) : PEAR constructor/destructor test FAIL PEAR_Autoloader (pear_autoloader.phpt). C:\net.php\php4-work\pear\tests\pear_autoloader.phpt(1) : PEAR_Autoloader C:\net.php\php4-work\pear\tests\pear_autoloader.log(1) : PEAR_Autoloader FAIL PEAR_Config (pear_config.phpt). C:\net.php\php4-work\pear\tests\pear_config.phpt(1) : PEAR_Config C:\net.php\php4-work\pear\tests\pear_config.log(1) : PEAR_Config PASS PEAR_Error: basic test PASS PEAR_Error: die mode PASS PEAR_Error: default error handling PASS PEAR_Error: expected errors FAIL PEAR_Registry (pear_registry.phpt). C:\net.php\php4-work\pear\tests\pear_registry.phpt(1) : PEAR_Registry C:\net.php\php4-work\pear\tests\pear_registry.log(1) : PEAR_Registry FAIL System commands tests (pear_system.phpt). C:\net.php\php4-work\pear\tests\pear_system.phpt(1) : System commands tests C:\net.php\php4-work\pear\tests\pear_system.log(1) : System commands tests ===================================================================== TIME 2002-05-17 00:40:23 - end of test run TEST RESULT SUMMARY ===================================================================== Number of tests : 223 Tests skipped : 70 (31.4%) Tests failed : 22 ( 9.9%) Tests passed : 131 (58.7%) ===================================================================== Skipped 24 extensions
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php