Davide Pesavento | b07d7a9 | 2020-05-13 23:30:07 -0400 | [diff] [blame] | 1 | # ndn-tools unit tests |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 2 | |
| 3 | ## Assumptions |
| 4 | |
Davide Pesavento | b07d7a9 | 2020-05-13 23:30:07 -0400 | [diff] [blame] | 5 | Unit tests for a tool `foo` should be placed in the folder `foo` and the build script |
| 6 | for the tool should define `foo-objects` that includes all object files for that tool, |
| 7 | except the object that contains the `main()` function. |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 8 | |
Davide Pesavento | b07d7a9 | 2020-05-13 23:30:07 -0400 | [diff] [blame] | 9 | For example: |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 10 | |
Davide Pesavento | 2ab04a2 | 2023-09-15 22:08:22 -0400 | [diff] [blame] | 11 | ```python |
| 12 | def build(bld): |
| 13 | bld.objects( |
| 14 | target='tool-subtool-objects', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 15 | source=bld.path.ant_glob('subtool/*.cpp', excl='subtool/main.cpp'), |
| 16 | use='core-objects') |
| 17 | |
Davide Pesavento | 2ab04a2 | 2023-09-15 22:08:22 -0400 | [diff] [blame] | 18 | bld.program( |
| 19 | name='subtool', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 20 | 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 Pesavento | 2ab04a2 | 2023-09-15 22:08:22 -0400 | [diff] [blame] | 26 | ``` |