Alexander Afanasyev | 2aa3962 | 2014-01-22 11:51:11 -0800 | [diff] [blame] | 1 | Requirements |
| 2 | --------------------- |
| 3 | |
Alexander Afanasyev | 9bcbc7c | 2014-04-06 19:37:37 -0700 | [diff] [blame^] | 4 | Include the following header into all `.hpp` and `.cpp` files: |
Alexander Afanasyev | 2aa3962 | 2014-01-22 11:51:11 -0800 | [diff] [blame] | 5 | |
Alexander Afanasyev | 9bcbc7c | 2014-04-06 19:37:37 -0700 | [diff] [blame^] | 6 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 7 | /** |
| 8 | * Copyright (c) 2014 Regents of the University of California, |
| 9 | * Arizona Board of Regents, |
| 10 | * Colorado State University, |
| 11 | * University Pierre & Marie Curie, Sorbonne University, |
| 12 | * Washington University in St. Louis, |
| 13 | * Beijing Institute of Technology |
| 14 | * |
| 15 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 16 | * See AUTHORS.md for complete list of NFD authors and contributors. |
| 17 | * |
| 18 | * NFD is free software: you can redistribute it and/or modify it under the terms |
| 19 | * of the GNU General Public License as published by the Free Software Foundation, |
| 20 | * either version 3 of the License, or (at your option) any later version. |
| 21 | * |
| 22 | * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 23 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 24 | * PURPOSE. See the GNU General Public License for more details. |
| 25 | * |
| 26 | * You should have received a copy of the GNU General Public License along with |
| 27 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 28 | ////// [optional part] ////// |
| 29 | * |
| 30 | * \author Author's Name <email@domain> |
| 31 | * \author Other Author's Name <another.email@domain> |
| 32 | ////// [end of optional part] ////// |
| 33 | **/ |
Alexander Afanasyev | 2aa3962 | 2014-01-22 11:51:11 -0800 | [diff] [blame] | 34 | |
| 35 | Recommendations |
| 36 | --------------- |
| 37 | |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 38 | NFD code is subject to the code style, defined here: |
| 39 | http://redmine.named-data.net/projects/nfd/wiki/CodeStyle |
Alexander Afanasyev | 2aa3962 | 2014-01-22 11:51:11 -0800 | [diff] [blame] | 40 | |
| 41 | Running unit-tests |
| 42 | ------------------ |
| 43 | |
| 44 | To run unit tests, NFD needs to be configured and build with unit test support: |
| 45 | |
| 46 | ./waf configure --with-tests |
| 47 | ./waf |
| 48 | |
| 49 | The simplest way to run tests, is just to run the compiled binary without any parameters: |
| 50 | |
| 51 | ./build/unit-tests |
| 52 | |
| 53 | However, Boost.Test framework is very flexible and allow a number of |
| 54 | run-time customization of what tests should be run. For example, it |
| 55 | is possible to choose to run only specific test suite or only a |
| 56 | specific test case within a suite: |
| 57 | |
| 58 | # Run only skeleton test suite (see tests/test-skeleton.cpp) |
| 59 | ./build/unit-tests -t TestSkeleton |
| 60 | |
| 61 | # Run only test cast Test1 from skeleton suite |
| 62 | ./build/unit-tests -t TestSkeleton/Test1 |
| 63 | |
| 64 | By default, Boost.Test framework will produce verbose output only when |
| 65 | test case fails. If it is desired to see verbose output (result of |
| 66 | each test assertion), add ``-l all`` option to ``./build/unit-tests`` |
| 67 | command: |
| 68 | |
| 69 | ./build/unit-tests -l all |
| 70 | |
| 71 | There are many more command line options available, information about |
| 72 | which can be obtained either from the command line using ``--help`` |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 73 | switch, or online on Boost.Test library website |
| 74 | (http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/). |