mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add config for measuring code coverage using MSVC 2026
It may work for older versions of MSVC, but before 2026 it wasn't available in the Community edition.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- File name extension must be .runsettings -->
|
||||
<RunSettings>
|
||||
<DataCollectionRunSettings>
|
||||
<DataCollectors>
|
||||
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<Configuration>
|
||||
<Format>coverage</Format>
|
||||
<Format>Cobertura</Format>
|
||||
<CodeCoverage>
|
||||
<ModulePaths>
|
||||
<Include>
|
||||
<ModulePath>.*\.dll$</ModulePath>
|
||||
</Include>
|
||||
<Exclude>
|
||||
<ModulePath>.*googletestadapter\.(common|core|testadapter)\.dll</ModulePath>
|
||||
</Exclude>
|
||||
</ModulePaths>
|
||||
|
||||
<Functions>
|
||||
<Exclude>
|
||||
<Function>^rust::cxxbridge1::.*</Function>
|
||||
</Exclude>
|
||||
</Functions>
|
||||
|
||||
<!-- We recommend you do not change the following values: -->
|
||||
|
||||
<!-- Set this to True to collect coverage information for functions marked with the "SecuritySafeCritical" attribute. Instead of writing directly into a memory location from such functions, code coverage inserts a probe that redirects to another function, which in turns writes into memory. -->
|
||||
<UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
|
||||
<!-- When set to True, collects coverage information from child processes that are launched with low-level ACLs, for example, UWP apps. -->
|
||||
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
|
||||
<!-- When set to True, collects coverage information from child processes that are launched by test or production code. -->
|
||||
<CollectFromChildProcesses>True</CollectFromChildProcesses>
|
||||
<!-- When set to True, restarts the IIS process and collects coverage information from it. -->
|
||||
<CollectAspDotNet>False</CollectAspDotNet>
|
||||
<!-- When set to True, static native instrumentation will be enabled. -->
|
||||
<EnableStaticNativeInstrumentation>True</EnableStaticNativeInstrumentation>
|
||||
<!-- When set to True, dynamic native instrumentation will be enabled. -->
|
||||
<EnableDynamicNativeInstrumentation>True</EnableDynamicNativeInstrumentation>
|
||||
<!-- When set to True, instrumented binaries on disk are removed and original files are restored. -->
|
||||
<EnableStaticNativeInstrumentationRestore>True</EnableStaticNativeInstrumentationRestore>
|
||||
</CodeCoverage>
|
||||
</Configuration>
|
||||
</DataCollector>
|
||||
</DataCollectors>
|
||||
</DataCollectionRunSettings>
|
||||
</RunSettings>
|
||||
@@ -253,6 +253,12 @@ if(MSVC)
|
||||
"/sdl"
|
||||
"$<$<CONFIG:Debug>:/RTC1>")
|
||||
target_link_options(libloot PRIVATE "/INCREMENTAL:NO" "/LTCG")
|
||||
|
||||
# Copy test code coverage config into build directory where MSVC expects to
|
||||
# find it.
|
||||
configure_file("${PROJECT_SOURCE_DIR}/.runsettings"
|
||||
"${PROJECT_BINARY_DIR}/.runsettings"
|
||||
COPYONLY)
|
||||
endif()
|
||||
|
||||
##############################
|
||||
|
||||
Reference in New Issue
Block a user