forked from pbiggar/phc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.test
42 lines (32 loc) · 1.61 KB
/
README.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
The tests are held in test/framework/, but tests should be run from this
directory. test/support_files/ are files used by the tests, for example for
regression. test/subjects/ are the files used to test phc. Most are designed
to test some feature or tickle some bug. test/subjects/labels controls what
tests are run on which subjects. test/logs/ contains logs of failed tests.
test/dependencies are used to avoid running a test if we know it wont work
because a previous test failed. test/working contains the working directory for
each test run.
To run tests:
$ make test (aka make check)
or
$ make installcheck
or
$ make long-test
or
$ php test/framework/driver.php
The latter allows command line options, and limiting the tests with regular
expressions. Run driver.php with the '-h' flag for details.
In order to run tests on your own php files, add the files to
test/subjects/3rdparty/, and list them in test/subjects/3rdparty/labels. In order to
generate the support files, for example if you'd like the regression tests to
succeed rather than be skipped, run
$ make generate-test-files
By default, 3rdparty tests are treated as 'long', so need to be run with
$ make long-test
Its also straight-forward to test PHP's phpt test files:
- run the test suite on PHP (in PHP's directory). This creates .php files from the .phpt files
$ TEST_PHP_EXECUTABLE=./sapi/cli/php --keep=php
- link the PHP phpt directory from test/subjects/3rdparty.
- update test/subjects/3rdparty/labels
- Run the tests using the .php files.
- This doesnt provide the EXPECT functionality etc, but we dont really need that in the majority of cases.