调试 Windows Phone 8.1 单元测试 (Visual C++) [英] Debugging a Windows Phone 8.1 Unit test (Visual C++)

查看:27
本文介绍了调试 Windows Phone 8.1 单元测试 (Visual C++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是我为 Windows 8.1 和 Windows Phone 8.1 创建了一个通用应用,在向导 Visual C++ -> Store Apps -> Universal Apps -> Windows Runtime Component 中选择.

The issue is that I have created an Universal App for Windows 8.1 and Windows Phone 8.1 choosing in the wizard Visual C++ -> Store Apps -> Universal Apps -> Windows Runtime Component.

为了测试它的行为,我们创建了一个 Windows Phone 8.1 单元测试 项目(也是 Visual C++),我们在其中添加通用应用项目作为参考,并且还在配置选项卡的项目属性中添加属性 -> C/C++ -> 常规,在附加包含目录中我引用了通用应用程序(特别是通用应用程序的文件夹 .Shared).然后我们通过配置属性->链接->输入向这个单元测试项目添加一些.lib.

So to test its behaviour we have created a Windows Phone 8.1 Unit test project (also Visual C++) where we add as reference the Universal App project, and also in the project properties in the tab Configuration properties -> C/C++ -> General, in Additional include directories I referenced the Universal App (specifically the folder .Shared of the Universal App). Then we add also some .lib to this Unit test project through Configuration properties -> Link -> Input.

这样就可以了,单元测试项目找到引用,我们可以从通用应用程序中调用方法甚至用断言来测试它们,等等.

So this ok, the Unit test project find the references, and we can call methods from the Universal App even test them with assertions, and so on.

问题是当我尝试在 ARM 平台调试单元测试代码(我的计算机中插入了诺基亚 Lumia 920)时,它开始加载 microsoft符号等,但在不停止的情况下完成测试或仅以异常消息终止测试(无论是否通过测试).

The issue is when I try to debug the Unit test code in the ARM platform (I have Nokia Lumia 920 plugged in the computer) it starts to load the microsoft symbols, etc. but finish the test without stopping or just terminate the test with an exception message (even passing the test or not).

我使用的是 Visual Studio Ultimate 2013 Update 2.

I'm using Visual Studio Ultimate 2013 Update 2.

附注.如果由于任何 Microsoft 和/或版本问题或其他原因无法调试它,我可以在控制台中显示一些值吗?因为我也尝试过 std::cout 或 OutputDebugString,但没有成功.

PS. In case of not being able to debug it due to any Microsoft and/or version issue or whatever, could I show in the console some values? Cause I also tried with std::cout, or OutputDebugString, without success.

PS2.我的案例让我想起了这张票中描述的这个问题,但使用的是不同版本的 Visual Studio 并使用 Windows 8.1 和 WP 8.1 而不是 8 版本 ---> 无法使用 Visual Studio 2012 Update 4 调试 Windows Phone 运行时组件

PS2. My case reminds me to this issue descripted in this ticket but with a different version of Visual Studio and working with Windows 8.1 and WP 8.1 instead of 8 version ---> Cannot debug Windows Phone Runtime Components with Visual Studio 2012 Update 4

推荐答案

我通过在测试 > 测试设置

I fixed this by changing Default Processor Architecture to x64 under Test > Test Settings

这篇关于调试 Windows Phone 8.1 单元测试 (Visual C++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆