Qt application. How to ensure the security of the application under test?

0

I have a Qt C++ project. It has several dynamic libraries. On Windows I use symbol dllexport by specifying it before the class. Thanks to this, libraries can get the necessary functionality from each other.

Problem: I have a project with tests. To which I link my dynamic libraries. I can’t get to the functionality that I didn’t export, but I need to test it.

I don’t want to export all the symbols at all.
If you export all the symbols, the library will be completely open for use from outside, because I don’t think it’s safe.

Here’s what I came up with.
I compile the object, then create dynamic libraries and tests from them.

Pros: No need to make changes to the code. Time on the CI/CD speeds up.
Cons: The test executable file is bloated.

Are there other ways to implement this? What do you think about this method?