How do I exclude all constructors from Visual Studio Code Coverage results

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I am creating a RunSettings file that will exclude all properties and constructors from the code coverage results in VS2012. I am aware of the ExcludeFromCodeCoverage attribute, however I want to achieve this in the runsettings file using a regular expression. My regular expressions for the get and set methods do work for removing the code coverage for properties, but its not working for constructors.

<Functions>
                        <Exclude>
                            <Function>^Fabrikam.UnitTest..*</Function>
                            <Function>^std::.*</Function>
                            <Function>^ATL::.*</Function>
                            <Function>.*::__GetTestMethodInfo.*</Function>
                            <Function>^Microsoft::VisualStudio::CppCodeCoverageFramework::.*</Function>
                            <Function>^Microsoft::VisualStudio::CppUnitTestFramework::.*</Function>                             
                             <Function>.*.ctor.*</Function>                                
                              <Function>.*.set_.*</Function>
                              <Function>.*.get_.*</Function>
                        </Exclude>
                    </Functions>

Answers

Have you tried

<Function>.*..ctor.*</Function>

As the ctor already has a dot preceding it

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/14327743/how-do-i-exclude-all-constructors-from-visual-studio-code-coverage-results

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils