Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[discussion] use flags/defines and unit tests #315

Open
mfrey opened this issue Oct 23, 2018 · 0 comments
Open

[discussion] use flags/defines and unit tests #315

mfrey opened this issue Oct 23, 2018 · 0 comments

Comments

@mfrey
Copy link
Collaborator

mfrey commented Oct 23, 2018

Description

I've started to add unit tests for ccnl-core and noticed that our current CMakeLists.txt in test does not support various defines we use over the project. As a side effect our unit tests can't reach certain parts, e.g.

void our_function_to_test(void)
{
#ifdef SOME_USE_FLAG
.... some code
.... return -1;
#endif 

#ifdef OTHER_USE_FLAG
... awesome other code
... return -2;
#endif 
}

So, we can't simply just turn on all defines/use flags we use over the project, but have to have fine-grained control over which tests are compiled with which use flags. Any thoughts about it and how we achieve this best?

P.S.: If necessary, I can come up with an example in our code base. The above snippet is just for the sake of clarity.
P.P.S.: On a side not, I think that this might also increase the complexity of providing gcov/lcov support for ccn-lite. See also #301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants