Mawg
Mawg

Reputation: 40140

Visual Studio unit tests not completing

A new colleague is unit testing using VS pro 2019#'s built-in unit test, as we all do.

With one solution (.sln) none of the unit tests complete when run from the Test Explorer, no matter whether Run or Debug is selected (on a side not, when the unit test file is open in the IDE, it is normally possible to right click within a TEST_METHOD and either Run or Debug, but neither of these seem to work, although the status bar updates to say "0 run, 0 passed, 0 failed".

If we breakpoint the final line of a unit test, and debug it from the Test Explorer, then the breakpoint is hit - no asserts fail and no exceptions are thrown. However, if we Continue, the test never ends and the status in the Test Explorer is never updated.

Worth noting:

any idea what is going wrong, and ow to fix it?

(I am loath to uninstall & reinstall VS, as we work from home and the process takes hours over WiFi + VPN)

Upvotes: 2

Views: 600

Answers (1)

nick
nick

Reputation: 614

We had a very similiar situation recently, where the whole solution would compile and run fine, but none of the tests would complete. In Output->Tests the last message would be "Test started" and then nothing. Stepping through it would not change the behaviour, the debugger would just not complete a step somewhere in the test.

What did solve this for us (for now) was disabling the adress sanitizer for all projects int the solution:

Project Properties->C/C++->Enable Address Sanitizer = No

This is only a workaround, because we want that feature ofc. Waiting for a patch from MS for now.

Upvotes: 1

Related Questions