altcover.fake
9.0.1
dotnet add package altcover.fake --version 9.0.1
NuGet\Install-Package altcover.fake -Version 9.0.1
<PackageReference Include="altcover.fake" Version="9.0.1" />
paket add altcover.fake --version 9.0.1
#r "nuget: altcover.fake, 9.0.1"
// Install altcover.fake as a Cake Addin #addin nuget:?package=altcover.fake&version=9.0.1 // Install altcover.fake as a Cake Tool #tool nuget:?package=altcover.fake&version=9.0.1
altcover.fake
Contains options to run AltCover as part of dotnet test
within a Fake build script.
Usage
Given specifications prepare
, process
and collect
(part of the API), extend a dotnet test
invocation with coverage collection
open AltCoverFake.DotNet.DotNet // extension method WithAltCoverOptions
Fake.DotNet.DotNet.test (fun to' -> to'.WithAltCoverOptions prepare collect process) "dotnettest.fsproj"
See the Wiki page for full details
What's in the box?
APIs for integration into Fake build scripts -- what one might expect to see as a module Fake.DotNet.Testing.AltCover
, just like the other Fake.DotNet.Testing.*
modules, only built and maintained with the rest of the tool.
Why altcover?
As the name suggests, it's an alternative coverage approach. Rather than working by hooking the .net profiling API at run-time, it works by weaving the same sort of extra IL into the assemblies of interest ahead of execution. This means that it should work pretty much everywhere, whatever your platform, so long as the executing process has write access to the results file. You can even mix-and-match between platforms used to instrument and those under test.
In particular, while instrumenting .net core assemblies "just works" with this approach, it also supports Mono, as long as suitable .mdb
(or .pdb
, in recent versions) symbols are available. One major limitation here is that the .mdb
format only stores the start location in the source of any code sequence point, and not the end; consequently any nicely coloured reports that take that information into account may show a bit strangely.
Why altcover? -- the back-story of why it was ever a thing
Back in 2010, the new .net version finally removed the deprecated profiling APIs that the free NCover 1.5.x series relied upon. The first version of AltCover was written to both fill a gap in functionality, and to give me an excuse for a ground-up F# project to work on. As such, it saw real production use for about a year and a half, until OpenCover reached a point where it could be used for .net4/x64 work (and I could find time to adapt everything downstream that consumed NCover format input).
Fast forwards to autumn 2017, and I get the chance to dust the project off, with the intention of saying that it worked on Mono, too -- and realise that it's déja vu all over again, because .net core didn't yet have profiler based coverage tools either, and the same approach would work there as well.
Continuous Integration
Build | GitHub |
Test coverage | Coveralls |
Possible retirement/obsolescence of support
tl;dr -- legacy framework/Mono support is not going away any time soon.
As net472
can consume netstandard2.0
libraries (everything but the recorder), and .net core 2+ can consume net20
libraries (the recorder), legacy framework/Mono support continues until such a time as it is no longer possible to retain those API levels.
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
- Visualizer dotnet global tool -- just the .net core/Avalonia Visualizer as a global tool
- 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.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
- BlackFox.CommandLine (>= 1.0.0)
- FAKE.Core.Environment (>= 6.1.3)
- FAKE.Core.Process (>= 6.1.3)
- FAKE.DotNet.Cli (>= 6.1.3)
- FSharp.Core (>= 9.0.100)
- System.Collections.Immutable (>= 1.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.0.1 | 88 | 11/14/2024 |
8.9.3 | 129 | 8/17/2024 |
8.8.173 | 79 | 7/27/2024 |
8.8.165 | 77 | 7/23/2024 |
8.8.74 | 106 | 5/31/2024 |
8.8.53 | 90 | 5/16/2024 |
8.8.21 | 139 | 4/15/2024 |
8.8.10 | 127 | 4/6/2024 |
8.7.3 | 117 | 3/14/2024 |
8.6.125 | 224 | 1/4/2024 |
8.6.95 | 267 | 11/14/2023 |
8.6.68 | 272 | 7/10/2023 |
8.6.61 | 213 | 6/6/2023 |
8.6.45 | 299 | 3/21/2023 |
8.6.40 | 273 | 3/16/2023 |
8.6.14 | 853 | 1/1/2023 |
8.5.842 | 342 | 12/25/2022 |
8.5.841 | 573 | 11/19/2022 |
8.4.840 | 3,028 | 10/17/2022 |
8.3.839 | 465 | 9/13/2022 |
This build from https://github.com/SteveGilham/altcover/tree/abb5ba82ebd90a626bd4a5a40c4c52bc88ef029d
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
9.0.1 (Indori series release 1)
• [BREAKING] Minimum platforms for the tools and API are net472, netstandard2.0 and net8.0. NOTE the recorder assembly still targets net20 (or net46 when async is detected)
• [BREAKING] SDK updates to latest current for Cake (5.0.0) and MSBuild (17.12.6) packages; build with Fake.build 6.1.3 but supports back to 6.0.0
• [BREAKING] API change : --all and --eager replace --single and --defer, so the default behaviour is now deferred (Unload/Exit time) reporting, and first visit only per context. NOTE in some cases, use of .Net Framework AppDomains may require the use of --eager as the unload handler gives no guarantees about execution time.
8.9.3 (Habu series release 33)
• Add -p/--package and equivalents to specify package roots for Cobertura output for all coverage collection methods, plus the PowerShell ConvertTo-Cobertura cmdlet
• [ADVISORY] The Fake.build related assemblies (in the altcover.api and altcover.fake packages) support Fake 6.1.0
• [PERFORMANCE] revise the OpenCover to LCov conversion to speed the mapping of methods from source files.
For previous releases (8.8.173 and earlier) go here -- https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md