title: Testing C routines parent: FAQ --- # Can I add extra tests to the C routines? The idea with the testing is to move as many functions as possible "lower down"; i.e., to the `lib/utils_*.c` files. These functions can then be tested using the libtap routines in the `lib/tests/test_*.c` files. It is easier to do unit testing here than to try and do higher level plugin testing, because you can fake data easier at this level. The routines available via [libtap][libtap] are equivalent to Perl's [Test::Simple][test-simple] ones. The libtap tests are separated out from the plugins ones (in `plugins/t`) because: 1. They are testing the files in `lib/`, so should reside there. 2. They require [compiling][compilation] to run. [libtap]: http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap "libtap" [test-simple]: http://search.cpan.org/dist/Test-Simple/lib/Test/Simple.pm "Test::Simple Module" [compilation]: doc/faq/compilation.html "Compilation"