helly Thu Sep 12 10:25:30 2002 EDT Modified files: /php4 README.TESTING Log: Update info and synch example test. Index: php4/README.TESTING diff -u php4/README.TESTING:1.4 php4/README.TESTING:1.5 --- php4/README.TESTING:1.4 Mon Mar 18 01:06:00 2002 +++ php4/README.TESTING Thu Sep 12 10:25:30 2002 @@ -20,16 +20,16 @@ ./sapi/cli/php -c /path/to/php.ini/ run-tests.php [ext/some_extension_name] - [Which "php" executable "make test" look for] --------------------------------------------- + You must use TEST_PHP_EXECUTABLE environment variable to explicitly +select the php executable to be used to run the tests. That can either +be the CLI or CGI executable. + "make test" executes "run-tests.php" script with "php" binary. Some test scripts such as session must be executed by CGI SAPI. Therefore, you must build PHP with CGI SAPI to perform all tests. - If PHP is not build with CGI SAPI, "run-tests.php" script uses CLI -SAPI. Tests that may not executed by CLI SAPI will be skipped. - NOTE: PHP binary executing "run-tests.php" and php binary used for executing test scripts may differ. If you use different PHP binary for executing "run-tests.php" script, you may get errors. @@ -42,7 +42,7 @@ "run-tests.php" script. Example: -./sapi/cli/php -c /path/to/php.ini/ ext/standard +./sapi/cli/php -c /path/to/php.ini/ run-tests.php ext/standard If you use php.ini other than php.ini-dist, you may see more failed tests. @@ -55,10 +55,11 @@ extension, "run-tests.php" takes test php code from the file and executes it. - Tester can easily executes tests selectively with as follows. + Tester can easily execute tests selectively with as follows. -Example: +Examples: ./sapi/cli/php -c /path/to/php.ini/ run-tests.php ext/mbstring +./sapi/cli/php -c /path/to/php.ini/ run-tests.php ext/mbstring/020.phpt [Test results] @@ -69,12 +70,19 @@ ext/myext/tests/myext.phpt is failed to pass, following files are created: -ext/myext/tests/myext.out - output from test script -ext/myext/tests/myext.exp - expected output -ext/myext/tests/myext.php - test script executed +ext/myext/tests/myext.log - log of test execution (L) +ext/myext/tests/myext.exp - expected output (E) +ext/myext/tests/myext.out - output from test script (O) +ext/myext/tests/myext.diff - diff of .out and .exp (D) + + Tester can verify these files, if failed test is actually a bug or not. + +NOTE: The files generated by tests can be selected by setting the +environment variable TEST_PHP_LOG_FORMAT. For each file you want to be +generated use the character in brackets as shown above (default is LEOD). - Tester can verify these files, if failed test is actually a bug -or not. +NOTE: You can set environment variable TEST_PHP_DETAILED to enable +detailed test information. [Creating new test files] @@ -87,8 +95,6 @@ UCS4BE to ASCII --SKIPIF-- <?php include('skipif.inc'); ?> ---POST-- ---GET-- --FILE-- <?php include('002.inc'); ?> --EXPECT-- @@ -96,10 +102,13 @@ abcd ===== end of ext/iconv/002.phpt ======= + As you can see the file has the following sections: + "--TEST--" is title of the test. -"--SKIPIF--" is condition when to skip this test. -"--POST--" is POST variable passed to test script. -"--GET--" is GET variable passed to test script. +"--SKIPIF--" is condition when to skip this test (optional). +"--POST--" is POST variable passed to test script (optional). +"--GET--" is GET variable passed to test script (optional). +"--INI--" each line contains an ini setting e.g. foo=bar (optional). "--FILE--" is the test script. "--EXPECT--" is the expected output from the test script. @@ -141,12 +150,9 @@ ?> === end of ext/iconv/002.inc === -Test script and skipif code may be directly write into *.phpt. +Test script and skipif code may be directly written into *.phpt. However, it is recommended to use other files for ease of writing -test script. For instance, you can execute test script under -ext/iconv as follows: - -./sapi/cli/php -c /path/to/php.ini/ ext/iconv +test scripts. [How to help us]
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php