简体   繁体   English

Microsoft :: VisualStudio :: TestTools :: UnitTesting测试C ++项目

[英]Microsoft::VisualStudio::TestTools::UnitTesting to test c++ projects

Can I use Microsoft::VisualStudio::TestTools::UnitTesting to test C++ code? 我可以使用Microsoft :: VisualStudio :: TestTools :: UnitTesting测试C ++代码吗? I mean I already have an existing C++ project which doesn't use .NET. 我的意思是我已经有一个不使用.NET的现有C ++项目。

Now I want to write unit tests to test this code. 现在,我想编写单元测试来测试此代码。

Can I use UnitTesting framework from Microsoft to test this native Cpp code? 我可以使用Microsoft的UnitTesting框架来测试此本地Cpp代码吗?

Thanks a lot 非常感谢

Best Regards, Marc 最好的问候,马克

Yes but with some more additions 是的,但还有更多补充

  1. You need to include the "CppUnitTest.h" ofcourse 您需要包括"CppUnitTest.h"
  2. Update the linker directories to include $(VCInstallDir)UnitTest\\lib 更新链接器目录以包括$(VCInstallDir)UnitTest\\lib
  3. Update the include paths to include $(VCInstallDir)UnitTest\\include 更新包含路径以包含$(VCInstallDir)UnitTest\\include

Hope that helps 希望能有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM