Actions
Task #2795
closedIntroduce unit testing
Start date:
Due date:
% Done:
100%
Estimated time:
3.00 h
Description
Introduce unit testing infrastructure using Boost.Test.
Updated by Junxiao Shi almost 10 years ago
- Blocks Feature #2796: Tests for Ping and PingServer added
Updated by Junxiao Shi almost 10 years ago
- Status changed from New to In Progress
Updated by Junxiao Shi almost 10 years ago
- % Done changed from 0 to 10
http://gerrit.named-data.net/2052
I gave this a shot but there are major difficulties with wscript
:
tools/foo
compiles into one or more executables, not objects. This means it containsmain
function(s).tools/foo
directory structure is only understood bytools/foo/wscript
.tools/foo
can declare extra dependencies.
tests/wscript
needs to:
- Avoid linking the
main
function(s) intools/foo
, or skip the file(s) that contains amain
function. - Understand the directory structure inside
tools/foo
. - Make the unit testing binary depend on the extra dependencies declared in
tools/foo
.
I'm unsure how to achieve those.
Updated by Alex Afanasyev almost 10 years ago
I'm a little bit confused.
Is the following logic correct:
- a single
unit-tests
binary file - test cases are
.cpp
files placed undertests/foo
,tests/bar
, etc. - there could be other
.cpp
files placed intests/foo
- a single
unit-tests
program is linked to all.o
files from all tools (with exception of files containingmain
function) and all relevant dependencies
Updated by Junxiao Shi almost 10 years ago
Answer to note-4:
I haven't decided whether the unit tests are in a single binary, or one binary per tool; whichever way is easier shall be the way to go.
The other three points are accurate.
Updated by Alex Afanasyev almost 10 years ago
- Assignee changed from Junxiao Shi to Alex Afanasyev
Updated by Alex Afanasyev almost 10 years ago
- Assignee changed from Alex Afanasyev to Junxiao Shi
- % Done changed from 10 to 40
Updated by Alex Afanasyev almost 10 years ago
Updated by Junxiao Shi over 9 years ago
- Status changed from In Progress to Code review
- % Done changed from 40 to 100
Updated by Junxiao Shi over 9 years ago
- Blocks Feature #2670: wscript: build a subset of tools added
Updated by Junxiao Shi over 9 years ago
- Status changed from Code review to In Progress
- % Done changed from 100 to 70
I also need to enable unit testing in Jenkins.
Updated by Junxiao Shi over 9 years ago
- Status changed from In Progress to Code review
- % Done changed from 70 to 100
Updated by Junxiao Shi over 9 years ago
- Status changed from Code review to Closed
Actions