diff options
Diffstat (limited to 'web/input/doc/faq/extra-tests.md')
| -rw-r--r-- | web/input/doc/faq/extra-tests.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/web/input/doc/faq/extra-tests.md b/web/input/doc/faq/extra-tests.md new file mode 100644 index 0000000..b508195 --- /dev/null +++ b/web/input/doc/faq/extra-tests.md | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | title: Testing C routines | ||
| 2 | parent: FAQ | ||
| 3 | --- | ||
| 4 | |||
| 5 | # Can I add extra tests to the C routines? | ||
| 6 | |||
| 7 | The idea with the testing is to move as many functions as possible "lower | ||
| 8 | down"; i.e., to the `lib/utils_*.c` files. These functions can then be tested | ||
| 9 | using the libtap routines in the `lib/tests/test_*.c` files. It is easier to | ||
| 10 | do unit testing here than to try and do higher level plugin testing, because | ||
| 11 | you can fake data easier at this level. | ||
| 12 | |||
| 13 | The routines available via [libtap][libtap] are equivalent to Perl's | ||
| 14 | [Test::Simple][test-simple] ones. | ||
| 15 | |||
| 16 | The libtap tests are separated out from the plugins ones (in `plugins/t`) | ||
| 17 | because: | ||
| 18 | |||
| 19 | 1. They are testing the files in `lib/`, so should reside there. | ||
| 20 | 2. They require [compiling][compilation] to run. | ||
| 21 | |||
| 22 | [libtap]: http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap "libtap" | ||
| 23 | [test-simple]: http://search.cpan.org/dist/Test-Simple/lib/Test/Simple.pm "Test::Simple Module" | ||
| 24 | [compilation]: doc/faq/compilation.html "Compilation" | ||
| 25 | |||
| 26 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
