我在一个解决方案中有 3 个项目,一个 .dll
,一个控制台应用程序 .exe
作为 dll 客户端。最近根据这个 walk through 添加了 native unit test
.
在构建我得到的解决方案时
------ Discover test started ------ Could not locate debug symbols for
C:\*\Debug\ConsoleExample.exe
. To make use of '--list_content' discovery, ensure that debug symbols are available or make use of '' via a .runsettings file. Test Adapter for Google Test: Test discovery starting...
我没有使用过 google 或 boost 库。
test.cpp
预编译器是
#include "stdafx.h" // which includes headers of dll project (the exported functions)
#include "CppUnitTest.h"
我应该提到测试没有失败,但我想知道这些警告是干什么用的?
- 一个额外的问题: native 单元测试最适合测试 dll 函数还是市场上有更好的库,因为我是 c/c++ 的新手,不熟悉整个环境。希望这个投票不会被否决:)
最佳答案
我今天刚遇到这个错误,但我的测试失败了,并显示错误消息“消息:无法设置运行测试的执行上下文。”
经过深入研究,我了解到原因是正则表达式对象抛出了未捕获的异常,这是由于无效的正则表达式字符串(我忘记转义“\”字符)造成的。修复正则表达式字符串解决了这个问题。
我不确定这是否是您的相同错误。不管是不是,我建议您多调试一下您的代码,看看未捕获的异常是否是您在尝试运行测试时遇到该错误的原因。
关于c++ - VC++ native 单元测试,找不到调试符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53059626/