开发者

Visual Studio and Google Test: Forcing Re-Run of Test Project When Dependencies Change

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. Spec开发者_StackOverflow中文版ifically, 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: How to setup Google C++ Testing Framework (gtest) on Visual Studio 2005

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜