I’m a little bit confused how to work with mock and dynamic linked libraries. Let’s assume a project structure like the following
subdirs.pro (subdir project)
\- app (subdir project)
\-- app (executable, include and use lib)
\-- lib (dynamic library)
\- test (subdir project)
\-- test_app (test the app WITHOUT test lib again)
\-- test_lib (fully test of lib functions)
The ‘app’ is using a library; the library is tested within the test_lib project.
Now I want to test the app, but I don’t want to test the whole lib stuff again (which is stupid and double work with no effort!). So I need some way to mock away the whole lib. Have anyone done this before in Qt and can help me out? Is this possible within the Qt test framework? I read already a lot of articles and SO questions, but I didn’t find any solution for this special problem.
I use Qt Creator 4.0.3 based on Qt 5.6.1, qmake with mscv2013 and the included Qt test framework.