views:

12

answers:

0

I have a set of Google Test-based unit tests for a native C++ DLL I'm developing. The DLL is in its own project, and the test project is dependent upon it. The test project has a Post-Build Event script that runs the tests.

My problem: Whenever the test project gets rebuilt, it runs the tests as expected. However, making a change to the dependent DLL does not always cause the test project to be rebuilt. Specifically, it seems that if none of the DLL's header files change, Visual Studio decides that the test project doesn't need to be rebuilt.

Is there any way to force Visual Studio to rebuild the test project, or to run the post-build event, whenever the DLL gets rebuilt?

I can force the tests to be re-run by right-clicking one of the files in the test project and choosing the Compile menu item, then doing a build. I'd prefer to eliminate that manual-and-often-forgotten step.

I suspect I could get the result I want if I were to include the DLL project's source files in my test project, but I'd really like to run the tests against the actual DLL.


Related but unhelpful question: http://stackoverflow.com/questions/531941/how-to-setup-google-c-testing-framework-gtest-on-visual-studio-2005