Microsoft docs here describe how you can, in Visual Studio, create a unit test project and connect it to an executable project, in order to unit test the code in that executable project.
My problem is that I’m trying to use C++20 modules and the instructions don’t seem to work. In my test project I have:
import std;
import test_kit; // My unit testing framework.
import my.app.foo; // This module is in the executable project that I want to test.
I get an error: C2230 could not find module 'my.app.foo'.
Following the documentation linked above, I added to the “Additional Library Directories” and “Additional Dependencies” under the Linker properties for the test project. This points to the build directory for the app project, and lists the .obj file containing code I want to test (Foo.ixx.obj). I also tried adding to the “Additional BMI Directories” (same build directory) and “Additional Module Dependencies”. In the latter I listed the file Foo.ixx.ifc which I’m thinking will contain the BMI for the module I’m trying to test.
Is there something else I can do to get rid of that error?