Sam
Sam

Reputation: 28989

VS2012 unit tests - which test is running?

I'm using Visual Studio 2012 and am using a solution which contains some unit tests.

Now when I'm running the tests it runs about 55 tests then hangs indefinitely.

So I'd like to see which test is currently running and stalling the whole build.

As far as I remember in VS2010 I could change some timeout setting, which would help, too, but I can't find this in 2012.

Upvotes: 1

Views: 687

Answers (2)

nikita
nikita

Reputation: 2817

To find out what test is currently running use TestContext.TestName. Log it at the start of each test in TestInitialize method or just look at the TestResults window.

Upvotes: 3

allen
allen

Reputation: 4647

Sam this is a limitation of the experience in VS2012 making it difficult to detect the currently executing/hung/crashing test.

There are only workarounds that I can provide eg. divide and conquer the list of tests to narrow down on the hang, enable logs or stick a debugger.

I would suggest that you upvote this feature request on uservoice.

BTW the timeout setting still exists in VS2012 and can be set on each testmethod as an attribute eg. [Timeout(60000)]

Upvotes: 3

Related Questions