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