|
Packit |
f00812 |
This file describes the flex test suite.
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
* WHO SHOULD USE THE TEST SUITE?
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
The test suite is intended to be used by flex developers, i.e., anyone hacking
|
|
Packit |
f00812 |
the flex distribution. If you are simply installing flex, then you can ignore
|
|
Packit |
f00812 |
this directory and its contents.
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
* STRUCTURE OF THE TEST SUITE
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
The testsuite consists of several tests. Each test is centered around
|
|
Packit |
f00812 |
a scanner known to work with the most recent version of flex. In
|
|
Packit |
f00812 |
general, after you modify your copy of the flex distribution, you
|
|
Packit |
f00812 |
should re-run the test suite. Some of the tests may require certain
|
|
Packit |
f00812 |
tools to be available (e.g., bison, diff). If any test returns an
|
|
Packit |
f00812 |
error or generates an error message, then your modifications *may*
|
|
Packit |
f00812 |
have broken a feature of flex. At a minimum, you'll want to
|
|
Packit |
f00812 |
investigate the failure and determine if it's truly significant.
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
* HOW TO RUN THE TEST SUITE
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
To build and execute all tests from the top level of the flex source tree:
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
$ make check
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
To build and execute a single test:
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
$ cd tests/ # from the top level of the flex tree.
|
|
Packit |
f00812 |
$ make testname.log
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
where "testname" is the name of the test. This is an automake-ism
|
|
Packit |
f00812 |
that will create (or re-create, if need be), a log of the particular
|
|
Packit |
f00812 |
test run that you're working on.
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
* HOW TO ADD A NEW TEST TO THE TEST SUITE
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
** List your test in the TESTS variable in Makefile.am in this
|
|
Packit |
f00812 |
directory. Note that due to the large number of tests, we use
|
|
Packit |
f00812 |
variables to group similar tests together. This also helps with
|
|
Packit |
f00812 |
handling the automake test suite requirements. Hopefully your test
|
|
Packit |
f00812 |
can be listed in SIMPLE_TESTS. You'll need to add the appropriate
|
|
Packit |
f00812 |
automake _SOURCES variable as well. If you're unsure, then consult
|
|
Packit |
f00812 |
the automake manual, paying attention to the parallel test harness
|
|
Packit |
f00812 |
section.
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
** On success, your test should return zero.
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
** On error, your test should return 1 (one) and print a message to
|
|
Packit |
f00812 |
stderr, which will have been redirected to the log file created by the
|
|
Packit |
f00812 |
automake test suite harness.
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
** If your test is skipped (e.g., because bison was not found), then
|
|
Packit |
f00812 |
the test should return 2 (two).
|
|
Packit |
f00812 |
|
|
Packit |
f00812 |
** Once your work is done, submit a patch via the flex development
|
|
Packit |
f00812 |
mailing list, the github pull request mechanism or some other
|
|
Packit |
f00812 |
suitable means.
|