Get the Test Coverage analysis to work for a C++ project

After many days of trial and error I would like to reach out to the community for help.

I have a CMake / C++ project here, built using Azure Devops Pipeline. It is using SonarCloud for analysis and some of it works (static analysis, code smells, issues, etc) but the Test coverage is not. Every analysis always shows a test coverage of 0%.

The project is targeting Windows and built using VisualStudio 2022 with some own prebuilt dependencies. It uses the Boost.Test unit test framework.

I have tried many different things but here is the essence of it.

In my sonar-project.properties I have only a few test coverage lines…

sonar.cfamily.build-wrapper-output=build_wrapper_output_directory
sonar.cfamily.reportingCppStandardOverride=c++17
sonar.tests=unit_test

In azure-pipelines.yml I have this:

      - task: SonarCloudPrepare@1
        inputs:
          SonarCloud: "SonarCloud"
          organization: "myorg"
          scannerMode: "CLI"
          configMode: "file"
          extraProperties: |
            sonar.cfamily.vscoveragexml.reportsPath=$(Agent.TempDirectory)/TestResults/*/*.xml

  ... build the project in debug config using build-wrapper-win-x86-64.exe ...

      - task: VSTest@2
        inputs:
          testSelector: 'testAssemblies'
          testAssemblyVer2: Test*.exe
          searchFolder: '_build/bin/Debug/unittests'
          resultsFolder: '$(Agent.TempDirectory)/TestResults'
          pathtoCustomTestAdapters: 'C:\Program Files\Microsoft Visual Studio\2022'
          otherConsoleOptions: '/collect:"Code Coverage;Format=Xml"'
          codeCoverageEnabled: true
          testRunTitle: 'Run tests'

      - task: SonarCloudAnalyze@1

When I run this, I see the VSTest target doing its job. It correctly identifies the unit tests and everything, it writes report files and publishes them to Azure Devops, where the conducted unit tests are displayed okay.

When I output the contents of the TestResults directory I see *.trx files as well as .xml coverage files.

Only SonarCloud doesn’t seem to get it. I have tried *.coverage files by omitting the Format=Xml option in VSTest but that didn’t work either.

In the SonarCloud output I also do not see any Warnings or Errors. Nothing that would explain this.

Does anyone have a hint for me?

Cheers,
Moose

Hello,

Have you tried:

sonar.cfamily.vscoveragexml.reportsPath=$(Agent.TempDirectory)/TestResults/**/*.xml

?

The glob pattern a/*/*.xml does not match, for instance, a/file.xml nor a/b/c/file.xml,
while a/**/*.xml matches them.

Hi,

thanks for your input. I have just tried that and sadly it had no effect. Debug out showed xml files being there but I still see no coverage report.

Do you mean sonar-scanner debug logs? If that is the case, could you share them and some of the XML files? I can send you a private message if you want to keep the information private.

I wasn’t very clear here. I was referring to debug output scripts that I manually put between important steps to check for the expected files being there.

With your suggestion I just published the test results to artifacts and were able to look at the generated XML.

It is just one huge list of excluded stuff but doesn’t seem to contain anything related to my code or tests.

Specifically the first line is interesting.
An adapter called boosttestadapter.dll is excluded due to missing symbols. Is this a clue towards no test coverage actually be created by VSTest or a red herring?

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<results>
  <skipped_modules>
    <skipped_module name="boosttestadapter.dll" path="boosttestadapter.dll" reason="no_symbols" />
    <skipped_module name="oleaut32.dll" path="oleaut32.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.qualitytools.executioncommon.dll" path="microsoft.visualstudio.qualitytools.executioncommon.dll" reason="path_is_excluded" />
    <skipped_module name="system.runtime.interopservices.runtimeinformation.dll" path="system.runtime.interopservices.runtimeinformation.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testplatform.extensions.vstestintegration.dll" path="microsoft.visualstudio.testplatform.extensions.vstestintegration.dll" reason="path_is_excluded" />
    <skipped_module name="dnsapi.dll" path="dnsapi.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.uwptesthostruntimeprovider.dll" path="microsoft.visualstudio.uwptesthostruntimeprovider.dll" reason="path_is_excluded" />
    <skipped_module name="system.xml.linq.dll" path="system.xml.linq.dll" reason="no_symbols" />
    <skipped_module name="microsoft.codecoverage.interprocess.dll" path="microsoft.codecoverage.interprocess.dll" reason="path_is_excluded" />
    <skipped_module name="system.configuration.dll" path="system.configuration.dll" reason="no_symbols" />
    <skipped_module name="sspicli.dll" path="sspicli.dll" reason="no_symbols" />
    <skipped_module name="log4net.dll" path="log4net.dll" reason="no_symbols" />
    <skipped_module name="system.xml.ni.dll" path="system.xml.ni.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testtools.cppunittestframework.testengine.dll" path="microsoft.visualstudio.testtools.cppunittestframework.testengine.dll" reason="path_is_excluded" />
    <skipped_module name="microsoft.codecoverage.instrumentation.dll" path="microsoft.codecoverage.instrumentation.dll" reason="path_is_excluded" />
    <skipped_module name="microsoft.testplatform.platformabstractions.dll" path="microsoft.testplatform.platformabstractions.dll" reason="path_is_excluded" />
    <skipped_module name="testgazecalibrationutils.exe" path="testgazecalibrationutils.exe" reason="nothing_instrumented" />
    <skipped_module name="testhost.ni.exe" path="testhost.ni.exe" reason="path_is_excluded" />
    <skipped_module name="mscorlib.ni.dll" path="mscorlib.ni.dll" reason="path_is_excluded" />
    <skipped_module name="windows.storage.dll" path="windows.storage.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testplatform.extensions.html.testlogger.dll" path="microsoft.visualstudio.testplatform.extensions.html.testlogger.dll" reason="path_is_excluded" />
    <skipped_module name="fltlib.dll" path="fltlib.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.interopservices.dll" path="system.runtime.interopservices.dll" reason="no_symbols" />
    <skipped_module name="system.numerics.dll" path="system.numerics.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testwindow.interfaces.dll" path="microsoft.visualstudio.testwindow.interfaces.dll" reason="path_is_excluded" />
    <skipped_module name="microsoft.visualstudio.testplatform.extensions.tmiadapter.dll" path="microsoft.visualstudio.testplatform.extensions.tmiadapter.dll" reason="path_is_excluded" />
    <skipped_module name="iphlpapi.dll" path="iphlpapi.dll" reason="no_symbols" />
    <skipped_module name="microsoft.codecoverage.telemetry.dll" path="microsoft.codecoverage.telemetry.dll" reason="path_is_excluded" />
    <skipped_module name="bcryptprimitives.dll" path="bcryptprimitives.dll" reason="path_is_excluded" />
    <skipped_module name="msvcp140.dll" path="msvcp140.dll" reason="path_is_excluded" />
    <skipped_module name="antlr.dot.dll" path="antlr.dot.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testtools.datacollection.videorecordercollector.dll" path="microsoft.visualstudio.testtools.datacollection.videorecordercollector.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testplatform.common.dll" path="microsoft.visualstudio.testplatform.common.dll" reason="path_is_excluded" />
    <skipped_module name="virtdisk.dll" path="virtdisk.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.qualitytools.common.dll" path="microsoft.visualstudio.qualitytools.common.dll" reason="path_is_excluded" />
    <skipped_module name="test3dtypes.exe" path="test3dtypes.exe" reason="nothing_instrumented" />
    <skipped_module name="microsoft.visualstudio.fakes.datacollector.dll" path="microsoft.visualstudio.fakes.datacollector.dll" reason="path_is_excluded" />
    <skipped_module name="msxml6.dll" path="msxml6.dll" reason="no_symbols" />
    <skipped_module name="kernel32.dll" path="kernel32.dll" reason="no_symbols" />
    <skipped_module name="testframedata.exe" path="testframedata.exe" reason="nothing_instrumented" />
    <skipped_module name="vcruntime140_1.dll" path="vcruntime140_1.dll" reason="no_symbols" />
    <skipped_module name="system.servicemodel.internals.ni.dll" path="system.servicemodel.internals.ni.dll" reason="no_symbols" />
    <skipped_module name="system.numerics.ni.dll" path="system.numerics.ni.dll" reason="no_symbols" />
    <skipped_module name="testtime.exe" path="testtime.exe" reason="nothing_instrumented" />
    <skipped_module name="diasymreader.dll" path="diasymreader.dll" reason="no_symbols" />
    <skipped_module name="system.reflection.metadata.dll" path="system.reflection.metadata.dll" reason="no_symbols" />
    <skipped_module name="system.data.ni.dll" path="system.data.ni.dll" reason="no_symbols" />
    <skipped_module name="teststimulusdata.exe" path="teststimulusdata.exe" reason="nothing_instrumented" />
    <skipped_module name="bcrypt.dll" path="bcrypt.dll" reason="no_symbols" />
    <skipped_module name="msvcp_win.dll" path="msvcp_win.dll" reason="path_is_excluded" />
    <skipped_module name="system.identitymodel.dll" path="system.identitymodel.dll" reason="no_symbols" />
    <skipped_module name="dbghelp.dll" path="dbghelp.dll" reason="no_symbols" />
    <skipped_module name="system.dll" path="system.dll" reason="no_symbols" />
    <skipped_module name="crypt32.dll" path="crypt32.dll" reason="no_symbols" />
    <skipped_module name="mscorlib.dll" path="mscorlib.dll" reason="path_is_excluded" />
    <skipped_module name="system.componentmodel.composition.dll" path="system.componentmodel.composition.dll" reason="no_symbols" />
    <skipped_module name="cryptbase.dll" path="cryptbase.dll" reason="path_is_excluded" />
    <skipped_module name="ntdll.dll" path="ntdll.dll" reason="no_symbols" />
    <skipped_module name="newtonsoft.json.dll" path="newtonsoft.json.dll" reason="no_symbols" />
    <skipped_module name="mono.cecil.pdb.dll" path="mono.cecil.pdb.dll" reason="path_is_excluded" />
    <skipped_module name="system.xml.linq.ni.dll" path="system.xml.linq.ni.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.architecturetools.pereader.dll" path="microsoft.visualstudio.architecturetools.pereader.dll" reason="no_symbols" />
    <skipped_module name="apphelp.dll" path="apphelp.dll" reason="no_symbols" />
    <skipped_module name="vsregistrydetour.dll" path="vsregistrydetour.dll" reason="no_symbols" />
    <skipped_module name="testhmdgazedata.exe" path="testhmdgazedata.exe" reason="nothing_instrumented" />
    <skipped_module name="cryptsp.dll" path="cryptsp.dll" reason="no_symbols" />
    <skipped_module name="teststimulidatareceiver.exe" path="teststimulidatareceiver.exe" reason="nothing_instrumented" />
    <skipped_module name="mono.cecil.dll" path="mono.cecil.dll" reason="path_is_excluded" />
    <skipped_module name="wshbth.dll" path="wshbth.dll" reason="no_symbols" />
    <skipped_module name="system.configuration.ni.dll" path="system.configuration.ni.dll" reason="no_symbols" />
    <skipped_module name="psapi.dll" path="psapi.dll" reason="no_symbols" />
    <skipped_module name="winrnr.dll" path="winrnr.dll" reason="no_symbols" />
    <skipped_module name="system.web.ni.dll" path="system.web.ni.dll" reason="no_symbols" />
    <skipped_module name="kernel.appcore.dll" path="kernel.appcore.dll" reason="no_symbols" />
    <skipped_module name="microsoft.testplatform.coreutilities.dll" path="microsoft.testplatform.coreutilities.dll" reason="path_is_excluded" />
    <skipped_module name="microsoft.visualstudio.testtools.cppunittestframework.discoverer.dll" path="microsoft.visualstudio.testtools.cppunittestframework.discoverer.dll" reason="path_is_excluded" />
    <skipped_module name="smdiagnostics.ni.dll" path="smdiagnostics.ni.dll" reason="no_symbols" />
    <skipped_module name="testmajordomoprotocol.exe" path="testmajordomoprotocol.exe" reason="nothing_instrumented" />
    <skipped_module name="sechost.dll" path="sechost.dll" reason="no_symbols" />
    <skipped_module name="napinsp.dll" path="napinsp.dll" reason="no_symbols" />
    <skipped_module name="microsoft.testplatform.crossplatengine.dll" path="microsoft.testplatform.crossplatengine.dll" reason="path_is_excluded" />
    <skipped_module name="system.core.ni.dll" path="system.core.ni.dll" reason="no_symbols" />
    <skipped_module name="mscoree.dll" path="mscoree.dll" reason="path_is_excluded" />
    <skipped_module name="system.valuetuple.dll" path="system.valuetuple.dll" reason="no_symbols" />
    <skipped_module name="system.identitymodel.ni.dll" path="system.identitymodel.ni.dll" reason="no_symbols" />
    <skipped_module name="mscoreei.dll" path="mscoreei.dll" reason="path_is_excluded" />
    <skipped_module name="testzmqlog.exe" path="testzmqlog.exe" reason="nothing_instrumented" />
    <skipped_module name="googletestadapter.common.dll" path="googletestadapter.common.dll" reason="no_symbols" />
    <skipped_module name="microsoft.diasymreader.dll" path="microsoft.diasymreader.dll" reason="no_symbols" />
    <skipped_module name="microsoft.testplatform.communicationutilities.dll" path="microsoft.testplatform.communicationutilities.dll" reason="path_is_excluded" />
    <skipped_module name="msvcrt.dll" path="msvcrt.dll" reason="path_is_excluded" />
    <skipped_module name="system.data.dll" path="system.data.dll" reason="no_symbols" />
    <skipped_module name="srvcli.dll" path="srvcli.dll" reason="no_symbols" />
    <skipped_module name="nuget.frameworks.dll" path="nuget.frameworks.dll" reason="no_symbols" />
    <skipped_module name="kernelbase.dll" path="kernelbase.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testplatform.objectmodel.dll" path="microsoft.visualstudio.testplatform.objectmodel.dll" reason="path_is_excluded" />
    <skipped_module name="netstandard.dll" path="netstandard.dll" reason="no_symbols" />
    <skipped_module name="nlansp_c.dll" path="nlansp_c.dll" reason="no_symbols" />
    <skipped_module name="system.componentmodel.composition.ni.dll" path="system.componentmodel.composition.ni.dll" reason="no_symbols" />
    <skipped_module name="newtonsoft.json.ni.dll" path="newtonsoft.json.ni.dll" reason="no_symbols" />
    <skipped_module name="googletestadapter.testadapter.dll" path="googletestadapter.testadapter.dll" reason="no_symbols" />
    <skipped_module name="testgazecalibrationdata.exe" path="testgazecalibrationdata.exe" reason="nothing_instrumented" />
    <skipped_module name="microsoft.nodejstools.testadapter.dll" path="microsoft.nodejstools.testadapter.dll" reason="no_symbols" />
    <skipped_module name="microsoft.pythontools.common.dll" path="microsoft.pythontools.common.dll" reason="no_symbols" />
    <skipped_module name="smdiagnostics.dll" path="smdiagnostics.dll" reason="no_symbols" />
    <skipped_module name="boosttestshared.dll" path="boosttestshared.dll" reason="no_symbols" />
    <skipped_module name="googletestadapter.diaresolver.dll" path="googletestadapter.diaresolver.dll" reason="no_symbols" />
    <skipped_module name="testvalidation.exe" path="testvalidation.exe" reason="nothing_instrumented" />
    <skipped_module name="system.collections.immutable.dll" path="system.collections.immutable.dll" reason="no_symbols" />
    <skipped_module name="microsoft.testplatform.extensions.blamedatacollector.dll" path="microsoft.testplatform.extensions.blamedatacollector.dll" reason="path_is_excluded" />
    <skipped_module name="advapi32.dll" path="advapi32.dll" reason="no_symbols" />
    <skipped_module name="urlmon.dll" path="urlmon.dll" reason="no_symbols" />
    <skipped_module name="combase.dll" path="combase.dll" reason="no_symbols" />
    <skipped_module name="system.servicemodel.internals.dll" path="system.servicemodel.internals.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.javascript.testadapter.dll" path="microsoft.visualstudio.javascript.testadapter.dll" reason="no_symbols" />
    <skipped_module name="system.collections.dll" path="system.collections.dll" reason="no_symbols" />
    <skipped_module name="testhost.exe" path="testhost.exe" reason="path_is_excluded" />
    <skipped_module name="system.xml.dll" path="system.xml.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.qualitytools.webtestframework.dll" path="microsoft.visualstudio.qualitytools.webtestframework.dll" reason="path_is_excluded" />
    <skipped_module name="microsoft.visualstudio.javascript.common.dll" path="microsoft.visualstudio.javascript.common.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.serialization.dll" path="system.runtime.serialization.dll" reason="no_symbols" />
    <skipped_module name="version.dll" path="version.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.tracedatacollector.dll" path="microsoft.visualstudio.tracedatacollector.dll" reason="path_is_excluded" />
    <skipped_module name="system.core.dll" path="system.core.dll" reason="no_symbols" />
    <skipped_module name="msvcp140_codecvt_ids.dll" path="msvcp140_codecvt_ids.dll" reason="path_is_excluded" />
    <skipped_module name="system.servicemodel.dll" path="system.servicemodel.dll" reason="no_symbols" />
    <skipped_module name="gdi32.dll" path="gdi32.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.diagnostics.servicemodelsink.dll" path="microsoft.visualstudio.diagnostics.servicemodelsink.dll" reason="no_symbols" />
    <skipped_module name="imm32.dll" path="imm32.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.telemetry.dll" path="microsoft.visualstudio.telemetry.dll" reason="no_symbols" />
    <skipped_module name="rsaenh.dll" path="rsaenh.dll" reason="no_symbols" />
    <skipped_module name="webengine4.dll" path="webengine4.dll" reason="no_symbols" />
    <skipped_module name="testpreprocess.exe" path="testpreprocess.exe" reason="nothing_instrumented" />
    <skipped_module name="testdatacollection.exe" path="testdatacollection.exe" reason="nothing_instrumented" />
    <skipped_module name="antlr4.runtime.dll" path="antlr4.runtime.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.setup.configuration.native.dll" path="microsoft.visualstudio.setup.configuration.native.dll" reason="no_symbols" />
    <skipped_module name="mono.cecil.rocks.dll" path="mono.cecil.rocks.dll" reason="path_is_excluded" />
    <skipped_module name="microsoft.visualstudio.testplatform.extensions.trx.testlogger.dll" path="microsoft.visualstudio.testplatform.extensions.trx.testlogger.dll" reason="path_is_excluded" />
    <skipped_module name="mswsock.dll" path="mswsock.dll" reason="no_symbols" />
    <skipped_module name="msvcp140_2.dll" path="msvcp140_2.dll" reason="path_is_excluded" />
    <skipped_module name="shcore.dll" path="shcore.dll" reason="no_symbols" />
    <skipped_module name="microsoft.cci.dll" path="microsoft.cci.dll" reason="no_symbols" />
    <skipped_module name="nsi.dll" path="nsi.dll" reason="no_symbols" />
    <skipped_module name="system.runtime.serialization.ni.dll" path="system.runtime.serialization.ni.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.uwptesthostruntimeprovider.deployment.dll" path="microsoft.visualstudio.uwptesthostruntimeprovider.deployment.dll" reason="path_is_excluded" />
    <skipped_module name="system.web.dll" path="system.web.dll" reason="no_symbols" />
    <skipped_module name="userenv.dll" path="userenv.dll" reason="no_symbols" />
    <skipped_module name="testthreadedslots.exe" path="testthreadedslots.exe" reason="nothing_instrumented" />
    <skipped_module name="googletestadapter.common.dynamic.dll" path="googletestadapter.common.dynamic.dll" reason="no_symbols" />
    <skipped_module name="testserialization.exe" path="testserialization.exe" reason="nothing_instrumented" />
    <skipped_module name="win32u.dll" path="win32u.dll" reason="no_symbols" />
    <skipped_module name="rpcrt4.dll" path="rpcrt4.dll" reason="no_symbols" />
    <skipped_module name="system.servicemodel.ni.dll" path="system.servicemodel.ni.dll" reason="no_symbols" />
    <skipped_module name="iertutil.dll" path="iertutil.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testplatform.extensions.codedwebtestadapter.dll" path="microsoft.visualstudio.testplatform.extensions.codedwebtestadapter.dll" reason="path_is_excluded" />
    <skipped_module name="ucrtbase.dll" path="ucrtbase.dll" reason="no_symbols" />
    <skipped_module name="system.ni.dll" path="system.ni.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testplatform.extensions.webtestadapter.dll" path="microsoft.visualstudio.testplatform.extensions.webtestadapter.dll" reason="path_is_excluded" />
    <skipped_module name="user32.dll" path="user32.dll" reason="no_symbols" />
    <skipped_module name="powrprof.dll" path="powrprof.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testtools.datacollection.mediarecorder.model.dll" path="microsoft.visualstudio.testtools.datacollection.mediarecorder.model.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.interop.dll" path="microsoft.visualstudio.interop.dll" reason="no_symbols" />
    <skipped_module name="shell32.dll" path="shell32.dll" reason="no_symbols" />
    <skipped_module name="googletestadapter.core.dll" path="googletestadapter.core.dll" reason="no_symbols" />
    <skipped_module name="cmd.exe" path="cmd.exe" reason="no_symbols" />
    <skipped_module name="microsoft.testplatform.testhostruntimeprovider.dll" path="microsoft.testplatform.testhostruntimeprovider.dll" reason="path_is_excluded" />
    <skipped_module name="ws2_32.dll" path="ws2_32.dll" reason="no_symbols" />
    <skipped_module name="microsoft.pythontools.testadapter.dll" path="microsoft.pythontools.testadapter.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testtools.cppunittestframework.cppunittestextension.dll" path="microsoft.visualstudio.testtools.cppunittestframework.cppunittestextension.dll" reason="path_is_excluded" />
    <skipped_module name="vcruntime140.dll" path="vcruntime140.dll" reason="no_symbols" />
    <skipped_module name="clrjit.dll" path="clrjit.dll" reason="path_is_excluded" />
    <skipped_module name="gdi32full.dll" path="gdi32full.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.qualitytools.resource.dll" path="microsoft.visualstudio.qualitytools.resource.dll" reason="path_is_excluded" />
    <skipped_module name="propsys.dll" path="propsys.dll" reason="no_symbols" />
    <skipped_module name="umpdc.dll" path="umpdc.dll" reason="no_symbols" />
    <skipped_module name="netutils.dll" path="netutils.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.qualitytools.unittestframework.dll" path="microsoft.visualstudio.qualitytools.unittestframework.dll" reason="path_is_excluded" />
    <skipped_module name="profapi.dll" path="profapi.dll" reason="no_symbols" />
    <skipped_module name="ole32.dll" path="ole32.dll" reason="no_symbols" />
    <skipped_module name="microsoft.testplatform.extensions.eventlogcollector.dll" path="microsoft.testplatform.extensions.eventlogcollector.dll" reason="path_is_excluded" />
    <skipped_module name="system.runtime.dll" path="system.runtime.dll" reason="no_symbols" />
    <skipped_module name="microsoft.visualstudio.testtools.cppunittestframework.cominterfaces.dll" path="microsoft.visualstudio.testtools.cppunittestframework.cominterfaces.dll" reason="path_is_excluded" />
    <skipped_module name="microsoft.codecoverage.core.dll" path="microsoft.codecoverage.core.dll" reason="path_is_excluded" />
  </skipped_modules>
</results>

Your tests are called Test*.exe right? They show with

<skipped_module name="teststimulidatareceiver.exe" path="teststimulidatareceiver.exe" reason="nothing_instrumented" />

I have not been able to find a single mention of what nothing_instrumented means, but I would check whether generating debug information is enabled. This may help.

Yes, they are all executables with names beginning with Test*.exe

PDB files are created in the directory they are in. However, they are not built in a “real” debug configuration but with Release runtime and disabled optimization plus PDB debug files. I always do this due to the way we are being linked and to avoid having separate debug and release dependencies. Could this be the reason?

The Microsoft documentation says

So it may be the way the software is built. I am afraid I can not be of much more help, though. I can only suggest looking at their Troubleshooting guide and see if something rings.

Yes, thank you. It’s been a while since I was forced to use real debug builds but I’m currently trying to convert the pipeline to this effect. Let’s see how this turns out.
In any case, many thanks for your help!

I will post here if the real debug was a success, even though I doubt it.

For posterity:

After much more trial end error it is finally solved. Turns out, fake debug is okay after all and Real Debug runtime is not needed.
The reason for the missing coverage was the following compile switch:

/DEBUG:FASTLINK

it’s gotta be:

/DEBUG:FULL

This was the only thing that made a difference between having coverage or not. D’oh!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.