summaryrefslogtreecommitdiff
path: root/README.TESTING
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-09-12 14:25:30 +0000
committerMarcus Boerger <helly@php.net>2002-09-12 14:25:30 +0000
commit96f7bccebd23241a79b42d679a491e57fc83cbda (patch)
tree6ab60714ff471f09212db7418e98a6d7b92c3684 /README.TESTING
parent861f68834a77a88616628e4f43450f64308c90d2 (diff)
downloadphp-git-96f7bccebd23241a79b42d679a491e57fc83cbda.tar.gz
Update info and synch example test.
Diffstat (limited to 'README.TESTING')
-rw-r--r--README.TESTING50
1 files changed, 28 insertions, 22 deletions
diff --git a/README.TESTING b/README.TESTING
index b4b2d5c02c..e3bc365aee 100644
--- a/README.TESTING
+++ b/README.TESTING
@@ -20,16 +20,16 @@ as follows
./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 @@ you would like to test with other configuration file, user
"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 @@ by looking all directory named "tests". If there are files have "phpt"
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 @@ executed to the test script directory. For example, if
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.
+ 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).
+
+NOTE: You can set environment variable TEST_PHP_DETAILED to enable
+detailed test information.
[Creating new test files]
@@ -87,8 +95,6 @@ has following format. Here is a actual test file from iconv module.
UCS4BE to ASCII
--SKIPIF--
<?php include('skipif.inc'); ?>
---POST--
---GET--
--FILE--
<?php include('002.inc'); ?>
--EXPECT--
@@ -96,10 +102,13 @@ UCS4BE to ASCII
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 @@ abcd
?>
=== 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]