Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Define Multiple Stub Callback Functions in a Single File?

Hello,

I'm trying to use stubs with Dynamics Stubs Configuration enabled. All the stubs are created using "Create User Stub" option, and each are in Cpptest_Stub_(functionName).cpp files. The user manual stated that I should put Stub Callback functions in test suite files and define the stub logic there. However, instead of that method, I have all the Stub Callback functions with stub logic defined in a single file called functionCallbacks.cpp, and I include that file as a preprocessor directive in test suite files with #include <functionCallbacks.cpp> in public section.

Now, when I place functionCallbacks.cpp inside my source directory I can run unit tests without any issues. However, I want functionCallbacks.cpp to be inside the directory with all the test suite files but when I do that, Parasoft gives me a linker error stating "No such file or directory". I've played around with "Use symbols from additional project files:" and "Use extra symbols from files found in:" in the Symbols tab in Execution > Test Configurations of Run Unit Tests but I still can't seem to make it work. Does anyone know how/have any ideas on how to achieve this?

Thank you in advance.