Project

General

Profile

UnitTesting » History » Revision 2

Revision 1 (Junxiao Shi, 01/18/2014 10:13 PM) → Revision 2/12 (Junxiao Shi, 02/28/2014 08:25 AM)

# Unit Testing 

 NFD requires unit testing for most modules. 

 NFD uses [Boost Unit Test Framework](http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/index.html). Framework](http://www.boost.org/doc/libs/1_42_0/libs/test/doc/html/index.html). 

 ## Learning Resources for Boost Unit Test Framework 

 * [Boost Unit Test Framework documentation](http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/index.html) documentation](http://www.boost.org/doc/libs/1_42_0/libs/test/doc/html/index.html) 
 * [NDN-CPP-TLV unit tests](https://github.com/cawka/ndn-cpp/tree/new-dev/tests_boost) 
 * After compiling the unit-test binary, it is possible at run time to select which tests to run and what kind of output is desired. 
   Use `--help` command line option to get more information about the available options. 

 ## Testing Code Guidelines 

 * Test suites should be defined inside `nfd::tests` namespace. 
 * Test suites should use `nfd::tests::BaseFixture` fixture, to get automatic setup and teardown of global `io_service`. 
 * If a custom fixture is defined for test case or test case, that custom fixture should derive from `BaseFixture`.