Hello everyone,
I've been studying cpputest for the better part of a week now, but am still having difficulties. After giving up on spending time on various examples and starter projects that failed, I figured I'll try to create a simple example myself.
The basics:
* I'm working inside a docker container with a centos 7 variant.
* I've successfully compiled and run make install on cpputest 3.8
At this moment I've tried to create a simple project with 2 files:
main.cpp
module.cpp
inside module.cpp I have 2 functions:
int iNeedTesting(int arg)
{
return privateFunc(arg) / 2
}
int privateFunc(int arg)
{
return arg;
}
Now I am trying to create a test folder with main.cpp following these
instructions, but when writing the testing code, I'm not sure how to have cpputest recognize my module.
Do I need to link it with the precompiled O file, meaning testing need to depend on full building of the project (Unfortunately that would have to be the case in the bigger project I'm working on)?
Also, if I'm already posting, might I inquire if it is possible to mock privateFunc so it can return various outputs to test iNeedTesting?
Any help would be greatly appreciated to get me going underway.
Thanks
ST