Project

General

Profile

UnitTesting » History » Version 2

Junxiao Shi, 02/28/2014 08:25 AM

1 1 Junxiao Shi
# Unit Testing
2
3
NFD requires unit testing for most modules.
4
5 2 Junxiao Shi
NFD uses [Boost Unit Test Framework](http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/index.html).
6 1 Junxiao Shi
7
## Learning Resources for Boost Unit Test Framework
8
9 2 Junxiao Shi
* [Boost Unit Test Framework documentation](http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/index.html)
10 1 Junxiao Shi
* 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.
11
  Use `--help` command line option to get more information about the available options.
12 2 Junxiao Shi
13
## Testing Code Guidelines
14
15
* Test suites should be defined inside `nfd::tests` namespace.
16
* Test suites should use `nfd::tests::BaseFixture` fixture, to get automatic setup and teardown of global `io_service`.
17
* If a custom fixture is defined for test case or test case, that custom fixture should derive from `BaseFixture`.