blob: 11f51f4daa5021123ed7f4a28a25e0c9ef764ab7 [file] [log] [blame] [view]
Davide Pesaventob07d7a92020-05-13 23:30:07 -04001# ndn-tools unit tests
Junxiao Shi2713a3b2015-06-22 16:19:05 -07002
3## Assumptions
4
Davide Pesaventob07d7a92020-05-13 23:30:07 -04005Unit tests for a tool `foo` should be placed in the folder `foo` and the build script
6for the tool should define `foo-objects` that includes all object files for that tool,
7except the object that contains the `main()` function.
Junxiao Shi2713a3b2015-06-22 16:19:05 -07008
Davide Pesaventob07d7a92020-05-13 23:30:07 -04009For example:
Junxiao Shi2713a3b2015-06-22 16:19:05 -070010
Davide Pesavento2ab04a22023-09-15 22:08:22 -040011```python
12def build(bld):
13 bld.objects(
14 target='tool-subtool-objects',
Junxiao Shi2713a3b2015-06-22 16:19:05 -070015 source=bld.path.ant_glob('subtool/*.cpp', excl='subtool/main.cpp'),
16 use='core-objects')
17
Davide Pesavento2ab04a22023-09-15 22:08:22 -040018 bld.program(
19 name='subtool',
Junxiao Shi2713a3b2015-06-22 16:19:05 -070020 target='../../bin/subtool',
21 source='subtool/main.cpp',
22 use='tool-subtool-objects')
23
24 bld(name='tool-objects',
25 use='tool-subtool-objects')
Davide Pesavento2ab04a22023-09-15 22:08:22 -040026```