altcover.visualizer
8.6.14
See the version list below for details.
dotnet tool install --global altcover.visualizer --version 8.6.14
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local altcover.visualizer --version 8.6.14
#tool dotnet:?package=altcover.visualizer&version=8.6.14
nuke :add-package altcover.visualizer --version 8.6.14
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
User Guide
Full wiki page here
Here's the simple naming of parts
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.
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
- 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 thePATH
, the toolbar-icon is also shown. In the latter case, this spawnswish
as a separate process to use its cross-platform font selection support; terminating the process when either a font selection is made (e.g. viaOk
orApply
), 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 |
Test coverage | Coveralls |
Other NuGet Packages in this suite
- General purpose install -- excludes the
dotnet test
API with FAKE and CAKE integration and the AvaloniaUI visualizer - API install -- excludes the visualizer in all forms
- dotnet global tool install -- excludes the visualizer in all forms
- FAKE build task utilities -- just AltCover related helper types for FAKE scripts (v5.23.0 or later), only in this package
- Cake build task utilities -- just AltCover related helper types for Cake scripts (v2.0.0 or later), only in this package
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
8.8.53 | 10,834 | 5/16/2024 |
8.8.21 | 512 | 4/15/2024 |
8.8.10 | 318 | 4/6/2024 |
8.7.3 | 414 | 3/14/2024 |
8.6.125 | 1,960 | 1/4/2024 |
8.6.95 | 796 | 11/14/2023 |
8.6.68 | 13,619 | 7/10/2023 |
8.6.61 | 603 | 6/6/2023 |
8.6.48 | 5,839 | 3/22/2023 |
8.6.14 | 2,534 | 1/1/2023 |
8.5.842 | 666 | 12/25/2022 |
8.5.841 | 805 | 11/19/2022 |
8.4.840 | 913 | 10/17/2022 |
8.3.839 | 819 | 9/13/2022 |
This build from https://github.com/SteveGilham/altcover/tree/1acf483f1131fbb3748181c7045cd470f725ac27
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.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.
8.4.840 (Habu series release 16)
• New option --trivia to omit coverage of sequence points containing no logic (no-op, return or unconditional branches only)
• Added context for exceptions thrown during instrumentation. This is aimed at tracing what was being inspected when exceptions arise from Mono.Cecil being presented with a new corner case.
8.3.839 (Habu series release 15)
• [BUGFIX] -- Issue #161: Add retry logic to ContingentCopy task
• [BUGFIX] -- Issue #165: Work around Cecil issue #873 by omitting debug information for constants that cause that issue. N.B. will not catch cases in methods that are not instrumented.
8.3.838 (Habu series release 14)
• [GTK-VISUALIZER] Fix off-by-one error in markup for the very last line of the file
• [BUGFIX] -- Out-of-process APIs generating dotnet test: fix to allow activating ZipFile, MethodPoint, SingleVisit and SourceLink
• [BUGFIX] -- Issue #156: Out-of-process APIs generating dotnet test: fix /p:AltCoverDependencyList to work around the behaviour of dotnet test with an argument ending .dll or .exe. Users rolling their own command lines, note that the assembly list is separated and terminated with '|' characters. The --dependency command line argument for the tool is not affected.
• [BUGFIX] -- Issue #156: Make explicit dependencies through --dependency have priority over other assembly resolution lookup. This works around a Mono.Cecil misfeature (Mono.Cecil issue #863) where the netstandard2.0 Cecil binaries do not consider the GAC for Framework system assemblies, but instead will find stubs in dotnet/shared/Microsoft.NETCore.App for e.g. .net Framework WPF related assemblies
• [BUGFIX] -- Improve selection of non-embedded symbol files (between location in assembly debug header, the same directory as the assembly and any --symbolDirectory values) to avoid symbol mismatch when there are multiple possible files on offer
• Add a --verbose option for AltCover, the converse of -q. Away from the command line, adds meaning to the Verbosity option value System.Diagnostics.TraceLevel.Verbose. Currently Verbose output shows more of the selection of files for instrumentation, noting when files are excluded from the process, symbol file selection etc.
• Add a matching field, ILoggingOptions.Verbose, to the API as a sink to capture verbose output.
• Other minor build process adjustments for SDK 6.0.300/F# 6.0.4, 6.0.5
8.2.837 (Habu series release 13)
• [VISUALIZER] Critical bug fixes for GTK and Avalonia : mismatched new icon names causing crashes
• [VISUALIZER] Use new coverage data icon for the coverage report file, not a generic report icon
8.2.836 (Habu series release 12)
• [BUGFIX] Fix project file path handling in Cake support
• [BUGFIX] Improve heuristic to recognise (and ignore) state-machine injected branches in async methods; this may cause subtle changes, up or down, in branch detection for other generated code ("hidden" sequence points) contexts with branches
• Use VS2022 icons in the Visualizer
8.2.835 (Habu series release 11)
• [BUGFIX] Fix tracked methods in the Merge-OpenCover cmdlet
• [BUGFIX] Fix blocking issue in Cake support; and add operational test
• Move Fake.Build support to 5.21 as minimum; updating other supporting libraries
8.2.833 (Habu series release 10)
• [BUGFIX] Work-round more (problems with ill-formed debug data)[https://github.com/jbevain/cecil/issues/816] (issue #135)
• [BUGFIX] An infinite loop while instrumenting when faced with an inner function that is also a closure (also issue #135)
• [BUGFIX] Address issue #71 by pre-allocating storage for each instrumented assembly; rather than allocating on demand, with any timing related issues not adequately dealt with subject to catch-and-ignore
• For instrumented assemblies, write embedded debug symbols, independent of the input choice.
• Improved release note formatting
• Some overhaul and updating of neglected parts of the build and test script
• Reduce to a minimum the differences in the source between the net20 and net46-for-async versions of the recorder; then just rewrite the net20 version with the delta on demand.
• Some minor improvements to the data collector for dotnet test use, with example of how to employ explicitly in AltCover "classic" mode in the "UnitTestWithAltCoverCore" fake build target
8.2.831 (Habu series release 9)
• [BUGFIX] Make the static-linked parts of the recorder assembly internal, so only the AltCover instrumentation API is exposed -- removes type duplications from the environment that may confuse run-time assembly creation e.g. by Marten (issue #133)
• For CallContext, add async-aware tracking for all methods returning Task or Task<T> not just ones with the C# async shape. This includes functions returning the new F#6 task{} computation expression.
◦ Note there is a support gap : running this under .net Framework less than v4.6 (i.e. a test machine with a pre-2015-JUL-20 environment) will not work, even though Task is a .net 4.0 feature, as the tracking support relies on .net 4.6 async features.
• Emit (a warning)[https://stevegilham.github.io/altcover/AltCover.Engine/AltCover/AltCover.LoggingOptions/Warn-apidoc] if any of the files input to the instrumentations have previously been instrumented, leaving those files untouched (apart from any Recorder assembly, which will still be overwritten). For dotnet test this is an MSBuild warning, for powershell, it is delivered via Cmdlet.WriteWarning.
◦ This behaviour is subject to change in future releases
• Rework of the build process to keep artifacts out of the tracked directories
8.2.828 (Habu series release 8)
• Absorb .net 6 release into build tooling (awaiting a non-preview updated release of (fake.build)[https://fake.build/] to be able to upgrade to FSharp.Core 6.x -- still have to target the v5.x library even if the build uses the F#6 compiler)
• Where the debug symbols used in the instrumentation contain embedded source (e.g. from source generators), represent that within the generated report --
◦ for OpenCover format, as an altcover.embed attribute added to the File element
◦ for NCover classic, altcover.file elements are added after the method records in a module, with attributes document and embed
◦ and for the extended coverlet JSON format, as a type «AltCover.embed» with an empty method with name being the embedded text.
• [VISUALIZER] Support the extended formats for display, using the embedded source in preference to the file system whenever present
• Support these extensions in conversions between formats -- conversion to Lcov and Cobertura currently lose this information
• Other fixes/enhancements to these conversions, esp. in the cases of partial classes and inlined code
• Compute summary data correctly in the output from Json to OpenCover
• Carry both recorder versions (net20 and net46) as resources to simplify self-test behaviour
• Move baseline Cake support to v1.1.0 and Fake to v5.20.4
8.2.825 (Habu series release 7)
• Next release will be post .net 6 release to accomodate its impact, barring show-stoppers
• [BUGFIX] As noted in Q&A discussion (#107), satellite assemblies, and in issue #47 platform specific library subfolders, were not being copied appropriately relative to the instrumented location; this is now resolved.
• [BUGFIX] Prevent --localSource possibly excluding locally built assemblies using source generators.
• [VISUALIZER] Fixes and updates
◦ On the global tool, don't put expander icons (˃) on leaf nodes, i.e. most methods, all source -- such icons are an automatic feature in GTK, but are manual in Avalonia.
◦ Don't throw while trying to determine if a file that doesn't exist is outdated
8.2.824 (Habu series release 6c)
• [VISUALIZER] Fixes and updates
◦ [REGRESSION] Fix where multiple source file support broke JSON coverage support
◦ Not all coverage reports are XML -- fix root node icon
◦ Add more icons indicating non-default states (files missing, changed, via sourcelink &c)
◦ Replace most of the annoying pop-ups with tool-tips
8.2.823 (Habu series release 6b)
• [VISUALIZER] Fixes and updates
◦ [REGRESSION] Fix where multiple source file support broke methods with no source file
◦ [BUGFIX] Fix where some types were erroneously shown as functions (ƒₓ)
◦ Allow for TAB characters (which occupy 1 column only in the .PDB), and display → rather than ◻ in the global tool (TAB expands to 8 spaces in the GTK# build)
◦ Update icons to VS2019 from VS2017 (except where taken from GTK in the GTK# build), which means slightly more colours in the tree view, and a small change to the branch indicator.
8.2.822 (Habu series release 6a)
• [VISUALIZER] Support OpenCover's output from C++/CLI assemblies compiled /Zi (line information only, zero column values)
◦ account for (& simplify) the C++/CLI attribute decorations in method names
◦ allow for (& simplify) gcroot<type::with::Cpp::namespacing ^> types in method names
◦ allow source file selection for methods with code inlined from multiple source files
8.2.821 (Habu series release 6)
• Support deterministic builds /p:ContinuousIntegrationBuild=true, with or without --sourcelink//p:AltCoverSourceLink=true. Note that assemblies created by deterministic builds will be excluded by -l//p:AltCoverLocalSource=true.
• Experiment with the ReadMe feature recently added to NuGet
• Internal refactoring of the JSON processing following the replacement of System.Text.Encodings.Web in the previous release.
8.2.820 (Habu series release 5)
• Replace System.Text.Encodings.Web for JSON-escaping module, class and method names
• [BUGFIX] issue #125 -- prevent an NullReferenceException in some cases of computing cyclomatic complexity (a failure to exactly copy the algorithm from Mono.Gendarme)
• [ENHANCEMENT; API] issue #126 -- further generalise the relative-directory support for CopyAlways/CopyIfNewer from v7.4; extends the ContingentCopy MSBuild task
For previous releases (8.1.x and earlier) go here -- https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md