我有几个基于MFC的项目(DLL)。我想在其中添加一些GTest/GMock测试。
我需要尽可能少地进行操作,所以我的计划是:
- add test files to each of library and link it against gmock.lib
prepare a single executable which would load dynamically desired dll with minimal main() like this:
int main(int argc, char** argv) { LoadLibrary(argv[1]); testing::InitGoogleMock(&argc, argv); const int status = RUN_ALL_TESTS(); return status; }
[==========] Running 0 tests from 0 test cases.
[==========] 0 tests from 0 test cases ran. (0 ms total)
[ PASSED ] 0 tests.
看起来我应该将dll文件中的测试引入exe中,但我找不到任何信息。我的方法是否正确?或者还有其他简单的方法吗?