Hello,
I do have the following workspace structure structure
C:/Workspace/Project1
C:/Workspace/Project1/file1.c
C:/Workspace/Project1/file1.h
C:/Workspace/Project1/unit_test.cpp
C:/Workspace/externalLib/
C:/Workspace/Project1/googletest
The goal is the unit_test is testing “function_to_test” defined in file1.c. But this function also calls an external function (lib1_fucntion) defined in the library C:/Workspace/externalLib/lib1.lib
Alain , here is more details :
In unit_test.cpp , the header is #include <gtest/gtest.h> #include “file1.h”
and function_to_test is decalred in file1.c and also in file1.h.
For instance , function_to_test is calling funct_libray1 provided in the library C:/Workspace/externalLib/lib1.lib
I was wondering if it is still possible to perform a unit test on a function_to_test that needs and external library to be used.
Or should i also defined mocked/stubs for the fucntion defined in this external library or refactor the code?