简体   繁体   English

单元测试永远不会执行

[英]Unit Tests never execute

I've been having some issues just getting the basic c++ unit test project to run a simple unit test. 我一直有一些问题只是让基本的c ++单元测试项目运行一个简单的单元测试。

So far I have: 到目前为止,我有:

  1. Created a blank Visual C++ Unit Test App (Universal Windows) 创建了一个空白的Visual C ++单元测试应用程序(通用Windows)
  2. Added a very simple test to the default Test_Method provided in the default UnitTest.cpp class. 为默认的UnitTest.cpp类中提供的默认Test_Method添加了一个非常简单的测试。
  3. Built and run the test app against the Local Machine. 针对本地计算机构建并运行测试应用程序。 The default unit test UI appears when the app launches. 应用程序启动时会显示默认的单元测试用户界面。

But my test does not run. 但我的测试没有运行。 the default UI appears and just sits there with the message "Tests Running". 出现默认用户界面,只是坐在那里,显示消息“测试正在运行”。 Even opening the Test Explorer and explicitly running all tests results in a similar situation, although running the tests this way causes the test to spin forever. 即使打开测试资源管理器并显式运行所有测试也会导致类似情况,尽管以这种方式运行测试会导致测试永远旋转。

I hope I'm just doing something simple wrong. 我希望我只是做一些简单的错误。 Can anyone point me in the right direction? 谁能指出我正确的方向? Any ideas why my tests never fire? 为什么我的测试从未开火?

Any help is greatly appreciated! 任何帮助是极大的赞赏!

默认应用程序UI的图像

基础测试的形象

I tested everything trying to find what was wrong. 我测试了所有试图找出错误的东西。 I ran VS as an admin, I turned off the Firewall, I ran VS in safemode from the dev-console (this causes the Test Explorer to throw an exception funny enough), and I created about 30 different new projects trying to see if it was just a problem with my first project. 我作为管理员运行VS,我关闭防火墙,我从开发控制台运行VS安全模式(这导致测试资源管理器抛出一个足够有趣的异常),我创建了大约30个不同的新项目,试图看看它是否我的第一个项目只是一个问题。 In every case, it was the same : the app would open, close, and the unit tests would never resolve. 在每种情况下,它都是相同的:应用程序将打开,关闭,单元测试永远不会解决。

At the end of the day, the only solution I found was to swap out to a new computer. 在一天结束时,我找到的唯一解决方案是更换到新计算机。 This is a really crappy solution, but the problem seemed completely isolated to my laptop. 这是一个非常糟糕的解决方案,但问题似乎完全与我的笔记本电脑隔离。

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

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