Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 1 | Notes for ndn-cxx developers |
| 2 | ============================ |
| 3 | |
| 4 | Code style |
| 5 | ---------- |
| 6 | |
| 7 | ndn-cxx code is subject to [ndn-cxx code style](http://named-data.net/doc/ndn-cxx/current/code-style.html). |
| 8 | |
| 9 | Licensing |
| 10 | --------- |
| 11 | |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 12 | Contributions to the library must be licensed under LGPL 3.0 or compatible license. If |
| 13 | you are choosing LGPL 3.0, please use the following license boilerplate in all `.hpp` and |
| 14 | `.cpp` files: |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 15 | |
| 16 | |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 17 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Junxiao Shi | bd2cedb | 2017-07-05 18:51:52 +0000 | [diff] [blame] | 18 | /* |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 19 | * Copyright (c) [Year(s)] [Copyright Holder]. |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 20 | * |
| 21 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 22 | * |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 23 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 24 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 25 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 26 | * |
| 27 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 28 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 29 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 30 | * |
| 31 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 32 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 33 | * <http://www.gnu.org/licenses/>. |
| 34 | * |
| 35 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 36 | ////// [optional part] ////// |
| 37 | * |
| 38 | * @author Author's Name <email@domain-or-homepage://url> |
| 39 | * @author Other Author's Name <another.email@domain-or-homepage://url> |
| 40 | ////// [end of optional part] ////// |
| 41 | */ |
Alexander Afanasyev | af99f46 | 2015-01-19 21:43:09 -0800 | [diff] [blame] | 42 | |
| 43 | If you are affiliated to an NSF-supported NDN project institution, please use the [NDN Team License |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 44 | Boilerplate](https://redmine.named-data.net/projects/ndn-cxx/wiki/NDN_Team_License_Boilerplate_(ndn-cxx)). |
Alexander Afanasyev | cf49055 | 2016-06-27 22:51:36 -0700 | [diff] [blame] | 45 | |
| 46 | Running unit-tests |
| 47 | ------------------ |
| 48 | |
| 49 | To run unit tests, ndn-cxx needs to be configured, build with unit test support, and installed |
| 50 | into the configured location. For example: |
| 51 | |
| 52 | ./waf configure --with-tests |
| 53 | ./waf |
| 54 | sudo ./waf install |
| 55 | |
| 56 | **Note**: On Linux platform you also need to run `sudo ldconfig` to reconfigure dynamic loader |
| 57 | run-time bindings. On FreeBSD, use `sudo ldconfig -a` instead. |
| 58 | |
| 59 | The simplest way to run tests, is just to run the compiled binary without any parameters: |
| 60 | |
| 61 | ./build/unit-tests |
| 62 | |
| 63 | [Boost.Test framework](http://www.boost.org/doc/libs/1_54_0/libs/test/doc/html/index.html) |
| 64 | is very flexible and allows a number of run-time customization of what tests should be run. |
| 65 | For example, it is possible to choose to run only a specific test suite, only a specific |
| 66 | test case within a suite, or specific test cases within specific test suites: |
| 67 | |
| 68 | # Run only Face test suite tests (tests/unit-tests/face.t.cpp) |
| 69 | ./build/unit-tests -t TestFace |
| 70 | |
| 71 | # Run only test case ExpressInterestData from the same test suite |
| 72 | ./build/unit-tests -t TestFace/ExpressInterestData |
| 73 | |
| 74 | # Run Basic test case from all test suites |
| 75 | ./build/unit-tests -t */Basic |
| 76 | |
| 77 | By default, Boost.Test framework will produce verbose output only when a test case fails. |
| 78 | If it is desired to see verbose output (result of each test assertion), add `-l all` |
| 79 | option to `./build/unit-tests` command. To see test progress, you can use `-l test_suite` |
| 80 | or `-p` to show progress bar: |
| 81 | |
| 82 | # Show report all log messages including the passed test notification |
| 83 | ./build/unit-tests -l all |
| 84 | |
| 85 | # Show test suite messages |
| 86 | ./build/unit-tests -l test_suite |
| 87 | |
| 88 | # Show nothing |
| 89 | ./build/unit-tests -l nothing |
| 90 | |
| 91 | # Show progress bar |
| 92 | ./build/unit-tests -p |
| 93 | |
| 94 | There are many more command line options available, information about which can be obtained |
| 95 | either from the command line using `--help` switch, or online on |
| 96 | [Boost.Test library](http://www.boost.org/doc/libs/1_54_0/libs/test/doc/html/index.html) |
| 97 | website. |
| 98 | |
| 99 | **Warning:** If you have customized parameters for NDN platform using `client.conf` in |
| 100 | `/etc/ndn` or `/usr/local/etc/ndn` (or other `@SYSCONFDIR@/etc` if it was configured to custom |
| 101 | path during `./waf configure`), Face-related test cases may fail. |