altcover.visualizer 8.7.3

dotnet tool install --global altcover.visualizer --version 8.7.3
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local altcover.visualizer --version 8.7.3
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=altcover.visualizer&version=8.7.3
nuke :add-package altcover.visualizer --version 8.7.3

altcover.visualizer

A global tool for displaying code coverage in a number of formats (NCover 1.x, OpenCover, LCov, Cobertura, coverlet,...), using the the cross-platform AvaloniaUI toolkit

Visualizer screenshot

User Guide

Full wiki page here

Here's the simple naming of parts

Annotated

The recently accessed list is a drop-down for quick access to coverage files of current interest. The Refresh option is there for reloading the file you're currently examining e.g. after doing another test run.

The tree view opens with just the node for the coverage file shown. Drill down to the method of interest and double-click to load the appropriate source file.

The tree view shows the structure of the assemblies in the report, including virtual groupings for modules (classes that only contain classes, so have no presence in the XML reports), for properties (get_ and/or set_), and for events (add_ and/or remove_). Also where a type is just a function (i.e. only has an Invoke method), there is separate icon for that.

Colouring

A painter's algorithm approach is used -- first the whole source file is drawn, then the covered sections, then the un-covered ones, and finally any special cases. This approach ensures that the uncovered code is shown explicitly and is not obscured when some of the line, or a multi-line enclosing sequence point, happens to be covered : it's the unflattering view for engineers, rather than the sea of green for managers.

If the coverage file contains branch information, then an icon is shown in the left margin, in red-on-white for uncovered, black-on-yellow for partial coverage and black-on-pale green for complete coverage, with the details in tool-tip text for that icon.

The source is rendered by default in grey-on-whitesmoke; covered sequence-points are painted a medium blue, and then uncovered code is painted in crimson.

With coverage generated from AltCover with the --showstatic option, normally ignored code like auto-properties is shown in the report, and if not covered will appear as black, and with the --showGenerated option other code marked as [GeneratedCode] or [CompilerGenerated] shows as gold if not covered.

Annotated v6.6 - static and generated code

For purposes of demonstration, one test method here has been manually decorated with the [GeneratedCode] attribute; if the system under test uses code generation, marking it as such should be standard practice.

Source display font

From v7.1.783, this visualizer version also offers some limited font selection for source display

Tool-bar with font selection icon

  • On Windows, this uses the native FontChooser() API, restricting to monospace fonts (the default is "Courier New Normal 10")
  • Otherwise if the Tcl/Tk wish shell (assumed to be Tcl/Tk v8.6 or later) is on the PATH, the toolbar-icon is also shown. In the latter case, this spawns wish as a separate process to use its cross-platform font selection support; terminating the process when either a font selection is made (e.g. via Okor Apply), or the selection dialog is dismissed. There are no APIs there to restrict the font chooser to monospace fonts, so choose wisely (the default is "Monospace Normal 10")

Continuous Integration

Build GitHub Build statusBuild history
Test coverage Coveralls Coverage Status

Other NuGet Packages in this suite

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
8.7.3 219 3/14/2024
8.6.125 711 1/4/2024
8.6.95 708 11/14/2023
8.6.68 8,188 7/10/2023
8.6.61 519 6/6/2023
8.6.48 5,770 3/22/2023
8.6.14 1,293 1/1/2023
8.5.842 598 12/25/2022
8.5.841 721 11/19/2022
8.4.840 855 10/17/2022
8.3.839 750 9/13/2022

This build from https://github.com/SteveGilham/altcover/tree/c273b0aa4607e96f41f2b0a2dc921c4009d21569

Q. Never mind the fluff -- how do I get started?
A. Start with the Quick Start guide : https://github.com/SteveGilham/altcover/wiki/QuickStart-Guide and
read the FAQ : https://github.com/SteveGilham/altcover/wiki/FAQ

8.7.3 (Habu series release 26)
• [Enhancement] Discussion 202 : More careful tidying of temporary .runsettings files, fixing long-standing errors of both commission and omission.
• [Enhancement] Discussion 199 : Add /p:AltCoverOutputRoot=[path] and associated APIs for dotnet test command line creation.  The [path] is a directory to be used instead of $(TargetDir) for the relative placing of the instrumented or saved files.  The use-case here is when $(TargetDir) is close to MAX_PATH and the generated sub-folders would overflow that limit._

8.6.125 (Habu series release 25)
• [BUGFIX] Issue 197 : Update [InternalsVisibleTo] references during instrumentation.  Finally fixing an issue that's been there since 2010!

8.6.95 (Habu series release 24)
• Built with and supports net8.0 release
• Other dependency updates.
• Minor housekeeping changes, but no actual new features.

8.6.68 (Habu series release 23)
• Omit anonymous types from coverage, in the same way as other compiler generated code (auto-properties, equality and related operations on F# distributed unions, etc.)
• Supports net8.0 preview 5

8.6.61 (Habu series release 22)
• [BUGFIX] prevent possible "The lists had different lengths." exception in the collect phase (Issue 181)
• Removes some obsolete code from the dotnet test integration
• Drop support for Fake 5.23.x
• Supports net8.0 preview 4
• Updated to Cecil 11.5, removing the need for workrounds for issues noted at 11.4
• Other dependency updates.

8.6.48 (Habu series release 21a)
• [BUGFIX] Correctly package the visualizer for net5.0, as well as building it against the later platform

8.6.45 (Habu series release 21)
• [BUGFIX] Issue #179 - Improve and strengthen the heuristic for locating dependent assemblies, prossibly slightly speeding the look-up in the process by eliminating potentially duplicated effort.

8.6.40 (Habu series release 20)
• [BUGFIX] Issue #178 - possible NRE when instrumenting woven code e.g. using Fody
• [AvaloniaVisualizer] Now requires net5.0 or later
• Supports Fake 6.0.0.  This is probably the last release that will support earlier versions, as 5.23.1 is almost 6 months old.
• Supports net8.0 previews 1,2 (so far, no nasty surprises like with the 7.0.100 release)

8.6.14 (Habu series release 19)
• [GTKVisualizer] Fix an off-by-one crash for coverlet generated files
• [AvaloniaVisualizer] Fix possible crash launching the About dialog
• [Visualizer] Display coverage percentages against nodes of the tree (known issue that the synthetic F# module nodes are not thus decorated)
• [Visualizer] Improve handling of larger coverage files by deferring more processing until the tree model is actually expanded.
• [API] Types Options.CLI, Options.Logging, Options.Prepare and Options.Collect in namespace AltCover; concrete implementations of the ICLIOptions, ILoggingOptions and IPrepareOptions and ICollectOptions respectively, with getter and setter for each property.  Default values for the latter two are as per the corresponding Primitive record types.
• [API] Also on the AltCover.Fake package in the AltCoverFake.DotNet.Testing namespace (except Options.Logging which is not useful in that context)

8.5.842 (Habu series release 18)
• [VISUALIZER] As the relevant Avalonia issue is long resolved, move to having separate dialog boxes for the Avalonia Visualizer's "About" and message box, as in the GTK# version.
• ref struct types have an autogenerated [Obsolete] attribute with a standard comment - detect and ignore such attributes.  See https://turnerj.com/blog/ref-structs-are-technically-obsolete for details.

8.5.841 (Habu series release 17)
• To support Cake 3.0, move the Cake API assembly from AltCover.Api to a new package AltCover.Cake; this contains libraries built against Cake 2.0.0 at netcoreapp3.1 as well as the old ones built against Cake 1.0.0 at netstandard2.0 (present but in practice obsolete).
• Following Fake.build's policy of deprecating releases older then 6 month, drop support for versions before 5.23
• [BREAKING] Rename AltCover.Cake.DotNet.DotNetCoreTest to AltCover.Cake.DotNet.DotNetTest (even in the obsolete 1.0.0 build) to match the changes in the Cake APIs (and consequent chage to the test setting type in the argument list).  Similarly, in the version >= 2.0.0 build, the type AltCover.Cake.DotNet is now a [CakeAliasCategory("DotNet")] rather than [CakeAliasCategory("DotNetCore")]
• [API] New DotNet APIs for Fake support - ToTestPropertiesList method to emit a list of (name,value) pairs to allow customised property passing to dotnet test in the wake of the v7.0.100 regression.
• [API] Additionally ImportModuleProperties and GetVersionProperties values that are additonal lists of (name,value) pairs to append as needed.

For previous releases (8.4.840 and earlier) go here -- https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md