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 43 44 45 46 47 48 49 50 51 52 53
|
Test writing concepts
=====================
This directory contains files with feature and regression tests.
The name of each file must start with a lower case alphabetic
character.
Test types
----------
Files with feature tests are named after the corresponding component
or feature (e.g. "bitopt", "pragma"), and are added along with new
features.
Files containing regression tests are named after the version in which
the problems were fixed (e.g. "tcng-2i", "tcng-4a"), and are added in
the respective version. A regression test may contain tests for several
different components.
The file "misfeatures" contains a special type of tests: it serves
as a repository for known problems, and the tests that can be used to
verify whether the problem has been solved. Ideally, all tests in
"misfeatures" would fail.
The distinction between feature and regression tests is not always
very strict, e.g. if a release contains major work on some component,
also some tests for bugs discovered during that work may end up among
the corresponding feature tests.
Test execution
--------------
The tests usually involve execution of the "tcc" or "tcsim" command,
typically followed by some filtering of the output. The main purpose
of the output filtering is to remove irrelevant information, which
may cause the test to fail due some unrelated change in the future,
and also to make the output easier to read. (Although, it sometimes
gets harder to understand.)
"tcsim" is frequently used to verify that the output generated by
tcc is accepted by iproute2/tc and by the kernel. No simulation of
actual traffic is made in those cases.
Tests make poor examples
------------------------
Note that the tests are mainly designed to exercise certain code
paths in tcng, with as little overhead as possible, and not to do
anything useful in real life. Meaningful usage examples can be found
in the directories examples/ and examples-ng/
|