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 | |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 15 | NFD code is subject to the code style, defined here: |
| 16 | http://redmine.named-data.net/projects/nfd/wiki/CodeStyle |
Alexander Afanasyev | 2aa3962 | 2014-01-22 11:51:11 -0800 | [diff] [blame] | 17 | |
| 18 | Running unit-tests |
| 19 | ------------------ |
| 20 | |
| 21 | To run unit tests, NFD needs to be configured and build with unit test support: |
| 22 | |
| 23 | ./waf configure --with-tests |
| 24 | ./waf |
| 25 | |
| 26 | The simplest way to run tests, is just to run the compiled binary without any parameters: |
| 27 | |
| 28 | ./build/unit-tests |
| 29 | |
| 30 | However, Boost.Test framework is very flexible and allow a number of |
| 31 | run-time customization of what tests should be run. For example, it |
| 32 | is possible to choose to run only specific test suite or only a |
| 33 | specific test case within a suite: |
| 34 | |
| 35 | # Run only skeleton test suite (see tests/test-skeleton.cpp) |
| 36 | ./build/unit-tests -t TestSkeleton |
| 37 | |
| 38 | # Run only test cast Test1 from skeleton suite |
| 39 | ./build/unit-tests -t TestSkeleton/Test1 |
| 40 | |
| 41 | By default, Boost.Test framework will produce verbose output only when |
| 42 | test case fails. If it is desired to see verbose output (result of |
| 43 | each test assertion), add ``-l all`` option to ``./build/unit-tests`` |
| 44 | command: |
| 45 | |
| 46 | ./build/unit-tests -l all |
| 47 | |
| 48 | There are many more command line options available, information about |
| 49 | which can be obtained either from the command line using ``--help`` |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 50 | switch, or online on Boost.Test library website |
| 51 | (http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/). |