Alexander Afanasyev | 2aa3962 | 2014-01-22 11:51:11 -0800 | [diff] [blame^] | 1 | Requirements |
| 2 | --------------------- |
| 3 | |
| 4 | Include the following header into all .hpp and .cpp files: |
| 5 | |
| 6 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 7 | /** |
| 8 | * Copyright (C) 2014 Named Data Networking Project |
| 9 | * See COPYING for copyright and distribution information. |
| 10 | */ |
| 11 | |
| 12 | Recommendations |
| 13 | --------------- |
| 14 | |
| 15 | The following code style recommendations are highly advised: https://github.com/cawka/docs-ndn/blob/master/cpp.rst |
| 16 | |
| 17 | Running unit-tests |
| 18 | ------------------ |
| 19 | |
| 20 | To run unit tests, NFD needs to be configured and build with unit test support: |
| 21 | |
| 22 | ./waf configure --with-tests |
| 23 | ./waf |
| 24 | |
| 25 | The simplest way to run tests, is just to run the compiled binary without any parameters: |
| 26 | |
| 27 | ./build/unit-tests |
| 28 | |
| 29 | However, Boost.Test framework is very flexible and allow a number of |
| 30 | run-time customization of what tests should be run. For example, it |
| 31 | is possible to choose to run only specific test suite or only a |
| 32 | specific test case within a suite: |
| 33 | |
| 34 | # Run only skeleton test suite (see tests/test-skeleton.cpp) |
| 35 | ./build/unit-tests -t TestSkeleton |
| 36 | |
| 37 | # Run only test cast Test1 from skeleton suite |
| 38 | ./build/unit-tests -t TestSkeleton/Test1 |
| 39 | |
| 40 | By default, Boost.Test framework will produce verbose output only when |
| 41 | test case fails. If it is desired to see verbose output (result of |
| 42 | each test assertion), add ``-l all`` option to ``./build/unit-tests`` |
| 43 | command: |
| 44 | |
| 45 | ./build/unit-tests -l all |
| 46 | |
| 47 | There are many more command line options available, information about |
| 48 | which can be obtained either from the command line using ``--help`` |
| 49 | switch, or online on Boost.Test library website (http://www.boost.org/doc/libs/1_55_0/libs/test/doc/html/). |