blob: d2cc54a594b4b49a2f462558e24b56c1d2aab25c [file] [log] [blame] [view]
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07001Notes for ndn-cxx developers
2============================
3
4Code style
5----------
6
7ndn-cxx code is subject to [ndn-cxx code style](http://named-data.net/doc/ndn-cxx/current/code-style.html).
8
9Licensing
10---------
11
Alexander Afanasyevc169a812014-05-20 20:37:29 -040012Contributions to the library must be licensed under LGPL 3.0 or compatible license. If
13you are choosing LGPL 3.0, please use the following license boilerplate in all `.hpp` and
14`.cpp` files:
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -070015
16
Alexander Afanasyevc169a812014-05-20 20:37:29 -040017 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shibd2cedb2017-07-05 18:51:52 +000018 /*
Alexander Afanasyevc169a812014-05-20 20:37:29 -040019 * Copyright (c) [Year(s)] [Copyright Holder].
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -070020 *
21 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -070022 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -040023 * 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 Afanasyevdfa52c42014-04-24 21:10:11 -070036 ////// [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 Afanasyevaf99f462015-01-19 21:43:09 -080042
43If you are affiliated to an NSF-supported NDN project institution, please use the [NDN Team License
Davide Pesavento0530b5b2016-11-07 03:23:58 +010044Boilerplate](https://redmine.named-data.net/projects/ndn-cxx/wiki/NDN_Team_License_Boilerplate_(ndn-cxx)).
Alexander Afanasyevcf490552016-06-27 22:51:36 -070045
46Running unit-tests
47------------------
48
49To run unit tests, ndn-cxx needs to be configured, build with unit test support, and installed
50into 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
57run-time bindings. On FreeBSD, use `sudo ldconfig -a` instead.
58
59The 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)
64is very flexible and allows a number of run-time customization of what tests should be run.
65For example, it is possible to choose to run only a specific test suite, only a specific
66test 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
77By default, Boost.Test framework will produce verbose output only when a test case fails.
78If it is desired to see verbose output (result of each test assertion), add `-l all`
79option to `./build/unit-tests` command. To see test progress, you can use `-l test_suite`
80or `-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
94There are many more command line options available, information about which can be obtained
95either 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)
97website.
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
101path during `./waf configure`), Face-related test cases may fail.