Google test XML report doesn't reflect crashed tests - unit-testing

I am using Google test framework for unit testing and am generating an XML report of the tests. The XML being parsed by Jenkins. I've been noticed recently that some of my unit tests were crashed during execution with Segmentation fault. The crashed tests generated XML's as well with no failure entry., therefore I have not running tests marked as passed. I need a way to generate XML with a failure in this case, please advise.

I googled for "google test segmentation fault failed tests" and found a guide on googletest. The propagating fatal failures section might help you solve your problem.

Related

How to generate complete GCOV report when few testcases gets failed?

I need to generate the test coverage report and I have observed that when all the google testcases gets passed then only GCOV generates the coverage report. But now few of the testcases are getting failed. Is there any way to generate test coverage report with failed testcases?
Platform details :
OS - Ubuntu 18.04
Language - C++17
Test framework - Google test (gtest)
Cmake - v3.21.2
Here is the screenshot of the error.
Kindly suggest.
Thanks.

VS2017 Enterprise Code Coverage Doesn't Do It's Job

The code coverage tool in VS2017 enterprise no longer shows what application code is covered. Whether I run it on selected tests or all tests, it shows what code in the unit tests are covered, but shows the code actually being tested at 0%. When I first started using the tool it worked just fine and showed application code coverage. I only check coverage occasionally, so I'm not sure when it broke or what I might have done to cause the issue. I'm thinking that there is something in the Registry that is causing it since I haven't been able to find anything in Tools/Options/...
I installed JetBrains dotCoverage and it does the same thing even when I exclude the unit test project from the coverage session. I've tried to repair the VS installation. My next step is uninstall/reinstall. However, unless that cleans up the registry where I think the configuration error is, it will fail to address the problem.
So any suggestions on where I can look to figure this out would be appreciated.

TeamCity reports incorrect code coverage with dotCover for c# unit tests

I am somewhat new to TeamCity. I have set it up for a Visual Studio solution.
I am using NUnit step to run unit tests and dotCover for code coverage. Problem is, there are particular parts of my code that I know are covered by unit tests but in the code coverage report, it shows them with zero coverage.
I know the DLLs are created just fine because I run a dir /s command and can see all the test DLLs.
The NUnit step uses MSIL 4.0 platform and the test path looks like this:
**/bin/Debug/*Tests.dll
There are no filters under code coverage.
Many tests are run. But there are some specific tests that are not present in the search report when I search.
Why is this happening and how do I fix it?
Can you please provide information about your NUnit step, especially about .Net Coverage (Filters).
Can you also confirm that tests are actually run?
Full build log (pasted in pastebin.com or such provider) would be also appreciated.
Stupid me. The DLL that was being ignored was spelled *Test.dll instead of *Tests.dll. I use *Tests.dll in my test path.
The issue got fixed once I changed it to *Test*.dll

"Exception occurred while test discoverer was loading tests"

I'm writing a desktop Windows 8 application, and always get this error when building the project:
An exception occurred while test discoverer 'MSAppContainerTestDiscoverer' was loading tests. Exception: Object reference not set to an instance of an object.
I'm using the C++ unit test framework that's built into Visual Studio 2012, and the error doesn't seem to impact my builds or test runs. I haven't found anything about this online; any ideas what causes this error?
Post a build, it seems VS triggers all installed test-adapters (MSTest, et.all) into a discovery phase where they attempt to refresh the list of tests. If during this process, an exception occurs, the above generic error message is shown.
I faced this with NUnit - but you seem to be having the same with MSAppContainer. I'm not sure what that is. It won't affect your builds but may cause tests to be not found.
The NUnit adapter has been modified to log detailed information to the Output window (Tests) in case of a failure. For MSTest, I think this link should help uncover more details

Dotcover and Lighthouse produce no report data

I am trying to produce test coverage reports using dotCover and lighthouse. The dotcover cover command creates a 15Mb .dcvr file, but running dotcover report over that file produces empty results:
<?xml version="1.0" encoding="utf-8"?>
<Root Name="Root" CoveredStatements="0" TotalStatements="0" CoveragePercent="0" ReportType="XML" DotCoverVersion="2.0.407.25" />
I have successfully produced reports for non silverlight code unit nunit test runner so I know may way around dotCover.
Is anyone aware of any problems using this combination of tools?
At the moment dotCover doesn't provide command line coverage support for Silverlight tests. Thanks for the info, we'll investigate this issue further.
The problem is that a snapshot of the test launcher is taken instead of the process snapshot, and a null result can be caused by the fact that there is no launcher PDB's.