diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f9cdc50ef..b410b2d01 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-reportgenerator-globaltool": { - "version": "5.3.8", + "version": "5.4.0", "commands": [ "reportgenerator" ], @@ -38,7 +38,7 @@ "rollForward": false }, "nbgv": { - "version": "3.6.141", + "version": "3.6.146", "commands": [ "nbgv" ], diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ae7fbe3d..85d42a2a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.400' + dotnet-version: '9.0.100' - name: Tools run: dotnet tool restore - name: Setup @@ -63,7 +63,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.400' + dotnet-version: '9.0.100' - name: Tools run: dotnet tool restore - name: Setup diff --git a/.gitignore b/.gitignore index 6216a12ee..0d3a48cda 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,7 @@ InternalTrace.*.log nunit-agent_*.log $*/ *.orig +ThirdParty/BlackFox.CommandLine.8.dll +ThirdParty/BlackFox.CommandLine.il +ThirdParty/FSharpOptimizationData.BlackFox.CommandLine +ThirdParty/FSharpSignatureData.BlackFox.CommandLine diff --git a/AltCover.Api.Tests/AltCover.Api.Tests.fsproj b/AltCover.Api.Tests/AltCover.Api.Tests.fsproj index e7549747d..dde159c7e 100644 --- a/AltCover.Api.Tests/AltCover.Api.Tests.fsproj +++ b/AltCover.Api.Tests/AltCover.Api.Tests.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 false AltCover.Api.Tests false @@ -74,22 +74,6 @@ contentfiles - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.dll - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.Mdb.dll - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.Pdb.dll - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.Rocks.dll - - - ..\ThirdParty\Unquote.dll - diff --git a/AltCover.Avalonia/AltCover.Avalonia.fsproj b/AltCover.Avalonia/AltCover.Avalonia.fsproj index f98dc3753..e04a353cc 100644 --- a/AltCover.Avalonia/AltCover.Avalonia.fsproj +++ b/AltCover.Avalonia/AltCover.Avalonia.fsproj @@ -2,7 +2,7 @@ WinExe - net5.0 + net8.0 AltCover.Visualizer AltCover.Visualizer True diff --git a/AltCover.Avalonia/AltCover.Avalonia11.fsproj b/AltCover.Avalonia/AltCover.Avalonia11.fsproj index 3707e9cb2..d5bf101be 100644 --- a/AltCover.Avalonia/AltCover.Avalonia11.fsproj +++ b/AltCover.Avalonia/AltCover.Avalonia11.fsproj @@ -2,7 +2,7 @@ WinExe - net5.0 + net8.0 AltCover.Visualizer AltCover.Visualizer True @@ -28,10 +28,10 @@ AltCover.App.xaml - + AltCover.AboutBox.xaml - + diff --git a/AltCover.Avalonia/MainWindow.fs b/AltCover.Avalonia/MainWindow.fs index 439b52791..1d692dd45 100644 --- a/AltCover.Avalonia/MainWindow.fs +++ b/AltCover.Avalonia/MainWindow.fs @@ -137,6 +137,7 @@ type MainWindow() as this = let ofd = OpenFileDialog() #endif + // fsharplint:disable-next-line RedundantNewKeyword let iconMaker (x: Stream) = new Bitmap(x) [] @@ -841,7 +842,11 @@ type MainWindow() as this = "exit" ] |> Seq.iter (fun n -> let cap = - n.First().ToString().ToUpper() + n.Substring(1) + n + .First() + .ToString() + .ToUpper(CultureInfo.InvariantCulture) + + n.Substring(1) let raw = Resource.GetResourceString(n + "Button.Label") @@ -1091,8 +1096,9 @@ type MainWindow() as this = t.Text <- String.Empty // clear format stashes -- TODO #if !AVALONIA11 - t.FormattedText.Spans <- [] - t.Tag <- t.FormattedText.Spans + let ft = t.FormattedText + ft.Spans <- [] + t.Tag <- ft.Spans #endif ) @@ -1159,4 +1165,10 @@ type MainWindow() as this = Target = "AltCover.MainWindow", Justification = "God Object, alas")>] #endif +[,AltCover.GuiCommon/CodeTag)", + Justification = "Wrong paradigm")>] () \ No newline at end of file diff --git a/AltCover.Avalonia/Persistence.fs b/AltCover.Avalonia/Persistence.fs index b4eb5401e..041819575 100644 --- a/AltCover.Avalonia/Persistence.fs +++ b/AltCover.Avalonia/Persistence.fs @@ -1,6 +1,7 @@ namespace AltCover open System +open System.Diagnostics.CodeAnalysis open Avalonia open Avalonia.Controls diff --git a/AltCover.Cake/AltCover.Cake.csproj b/AltCover.Cake/AltCover.Cake.csproj index 141f7e53a..6b74c4a04 100644 --- a/AltCover.Cake/AltCover.Cake.csproj +++ b/AltCover.Cake/AltCover.Cake.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp3.1 + net8.0;netstandard2.1 false AltCover.Cake AltCover.Cake @@ -27,10 +27,8 @@ - - - - + + all runtime; build; native; contentfiles; analyzers diff --git a/AltCover.Cake/CakeMix.cs b/AltCover.Cake/CakeMix.cs new file mode 100644 index 000000000..b33071d06 --- /dev/null +++ b/AltCover.Cake/CakeMix.cs @@ -0,0 +1,114 @@ +using System; +using System.ComponentModel; +using System.Collections.Generic; + +#if NETSTANDARD2_1 + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +namespace Cake.Core +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ICakeContext + { + Cake.Core.Diagnostics.ICakeLog Log { get; } + } +} + +namespace Cake.Core.Diagnostics +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ICakeLog + { + void Write(Verbosity v, LogLevel l, string format); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public enum Verbosity + { + Normal, + Verbose + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public enum LogLevel + { + Information, + Error, + Warning, + Verbose + } +} + +namespace Cake.Core.IO +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public class ProcessArgumentBuilder + { + public void Append(string s) + { } + + public void Append(IProcessArgument s) + { } + + public IEnumerable Skip(int n) + { return null; } + + public IEnumerable Take(int n) + { return null; } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public interface IProcessArgument + { } + + [EditorBrowsable(EditorBrowsableState.Never)] + public class FilePath + { + public FilePath GetFilename() + { return null; } + + public string FullPath + { get { return String.Empty; } } + } +} + +namespace Cake.Core.Annotations +{ + [EditorBrowsable(EditorBrowsableState.Never)] + [AttributeUsage(AttributeTargets.Method)] + public class CakeMethodAliasAttribute : Attribute + { } + + [EditorBrowsable(EditorBrowsableState.Never)] + [AttributeUsage(AttributeTargets.All)] + public class CakeAliasCategoryAttribute : Attribute + { + public CakeAliasCategoryAttribute(string s) + { } + } +} + +namespace Cake.Common.Tools.DotNet +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public static class DotNetAliases + { + public static void DotNetTest( + Cake.Core.ICakeContext context, + string fullPath, + Cake.Common.Tools.DotNet.Test.DotNetTestSettings testSettings) + { } + } +} + +namespace Cake.Common.Tools.DotNet.Test +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public class DotNetTestSettings + { + public Func ArgumentCustomization { get; set; } + } +} + +#endif \ No newline at end of file diff --git a/AltCover.Cake/DotNet.cs b/AltCover.Cake/DotNet.cs index 563985ae2..1590376dd 100644 --- a/AltCover.Cake/DotNet.cs +++ b/AltCover.Cake/DotNet.cs @@ -1,14 +1,5 @@ -#if !NETSTANDARD2_0 -using Cake.Common.Tools.DotNet; +using Cake.Common.Tools.DotNet; using Cake.Common.Tools.DotNet.Test; -#else - -using DotNetTestSettings = Cake.Common.Tools.DotNetCore.Test.DotNetCoreTestSettings; - -#endif - -using Cake.Common.Tools.DotNetCore; -using Cake.Common.Tools.DotNetCore.Test; using Cake.Core; using Cake.Core.Annotations; using Cake.Core.IO; @@ -21,148 +12,142 @@ namespace AltCover.Cake { + /// + /// Combines the coverage process arguments into one object for use with `dotnet test` + /// + public class CoverageSettings + { /// - /// Combines the coverage process arguments into one object for use with `dotnet test` + /// Gets or sets the parameters for the preparation phase /// - public class CoverageSettings - { - /// - /// Gets or sets the parameters for the preparation phase - /// - public Abstract.IPrepareOptions PreparationPhase { get; set; } + public Abstract.IPrepareOptions PreparationPhase { get; set; } - /// - /// Gets or sets the parameters for the collection phase - /// - public Abstract.ICollectOptions CollectionPhase { get; set; } - - /// - /// Gets or sets the other command line options for the operation - /// - public FSDotNet.ICLIOptions Options { get; set; } + /// + /// Gets or sets the parameters for the collection phase + /// + public Abstract.ICollectOptions CollectionPhase { get; set; } - /// - /// Provides simple validation support for the options; of necessity, it runs in the "before preparation" state. - /// - /// A validated command line containing any errors, or an empty one if all is ok - public AltCover.ValidatedCommandLine WhatIf() - { - var prep = PreparationPhase.WhatIf(); - if (prep.Errors.Any()) - return prep; - else - { - var collect = CollectionPhase.WhatIf(false); - if (collect.Errors.Any()) - return collect; - } + /// + /// Gets or sets the other command line options for the operation + /// + public FSDotNet.ICLIOptions Options { get; set; } - return new AltCover.ValidatedCommandLine(FSharpList.Empty, Enumerable.Empty()); - } + /// + /// Provides simple validation support for the options; of necessity, it runs in the "before preparation" state. + /// + /// A validated command line containing any errors, or an empty one if all is ok + public AltCover.ValidatedCommandLine WhatIf() + { + var prep = PreparationPhase.WhatIf(); + if (prep.Errors.Any()) + return prep; + else + { + var collect = CollectionPhase.WhatIf(false); + if (collect.Errors.Any()) + return collect; + } + + return new AltCover.ValidatedCommandLine(FSharpList.Empty, Enumerable.Empty()); + } - /// - /// For applying these settings in a pipeline; returns a delegate to transform a `ProcessArgumentBuilder` based on the current settings - /// - /// `ProcessArgumentBuilder` to `ProcessArgumentBuilder` transform - public Func Customize() + /// + /// For applying these settings in a pipeline; returns a delegate to transform a `ProcessArgumentBuilder` based on the current settings + /// + /// `ProcessArgumentBuilder` to `ProcessArgumentBuilder` transform + public Func Customize() + { + return pabIn => + { + var pabOut = new ProcessArgumentBuilder(); + if (pabIn != null) { - return pabIn => - { - var pabOut = new ProcessArgumentBuilder(); - if (pabIn != null) - { - // take while?? - foreach (var arg in pabIn.Take(2)) - pabOut.Append(arg); - } - - var args = FSDotNet.ToTestArgumentList( - this.PreparationPhase, - this.CollectionPhase, - this.Options).ToArray(); - Array.ForEach( - args, - t => pabOut.Append(t)); - - if (pabIn != null) - { - // skip while?? - foreach (var arg in pabIn.Skip(2)) - pabOut.Append(arg); - } - - return pabOut; - }; + // take while?? + foreach (var arg in pabIn.Take(2)) + pabOut.Append(arg); } - /// - /// For applying these settings in a pipeline; returns a delegate to transform a `ProcessArgumentBuilder` based on the current settings, - /// combined with the input value - /// - /// Another `ProcessArgumentBuilder` to `ProcessArgumentBuilder` transform to apply before the `AltCover` one. - /// A concatenated `ProcessArgumentBuilder` to `ProcessArgumentBuilder` transform - public Func Concatenate(Func customIn) + var args = FSDotNet.ToTestArgumentList( + this.PreparationPhase, + this.CollectionPhase, + this.Options).ToArray(); + Array.ForEach( + args, + t => pabOut.Append(t)); + + if (pabIn != null) { - var altcover = Customize(); - if (customIn == null) - { - return altcover; - } - else - { - return args => altcover(customIn(args)); - } + // skip while?? + foreach (var arg in pabIn.Skip(2)) + pabOut.Append(arg); } + + return pabOut; + }; } /// - /// Extensions for `dotnet`. This class is a `[CakeAliasCategory("DotNet")]` + /// For applying these settings in a pipeline; returns a delegate to transform a `ProcessArgumentBuilder` based on the current settings, + /// combined with the input value /// -#if NETSTANDARD2_0 - [CakeAliasCategory("DotNetCore")] -#else - [CakeAliasCategory("DotNet")] -#endif - public static class DotNet + /// Another `ProcessArgumentBuilder` to `ProcessArgumentBuilder` transform to apply before the `AltCover` one. + /// A concatenated `ProcessArgumentBuilder` to `ProcessArgumentBuilder` transform + public Func Concatenate(Func customIn) { - /// - /// Hooks into the Cake wrapper for `dotnet test` and injects the AltCover command line arguments as specified. - /// Equivalent to - /// - /// settings.ArgumentCustomization = altcover.Concatenate(settings.ArgumentCustomization); - /// context.DotNetTest(project.FullPath, settings); - /// - /// This method is a `[CakeMethodAlias]` extension method on `ICakeContext`, and `[CakeAliasCategory("Test")]`. - /// - /// The Cake build script `ICakeContext`; a `this` parameter - /// The project to test as a `FilePath` - /// The `DotNetTestSettings` for the test - /// The `CoverageSettings` for the test instrumentation - [CakeMethodAlias] - [CakeAliasCategory("Test")] + var altcover = Customize(); + if (customIn == null) + { + return altcover; + } + else + { + return args => altcover(customIn(args)); + } + } + } + + /// + /// Extensions for `dotnet`. This class is a `[CakeAliasCategory("DotNet")]` + /// + + [CakeAliasCategory("DotNet")] + public static class DotNet + { + /// + /// Hooks into the Cake wrapper for `dotnet test` and injects the AltCover command line arguments as specified. + /// Equivalent to + /// + /// settings.ArgumentCustomization = altcover.Concatenate(settings.ArgumentCustomization); + /// context.DotNetTest(project.FullPath, settings); + /// + /// This method is a `[CakeMethodAlias]` extension method on `ICakeContext`, and `[CakeAliasCategory("Test")]`. + /// + /// The Cake build script `ICakeContext`; a `this` parameter + /// The project to test as a `FilePath` + /// The `DotNetTestSettings` for the test + /// The `CoverageSettings` for the test instrumentation + [CakeMethodAlias] + [CakeAliasCategory("Test")] #pragma warning disable IDE0079 // Remove unnecessary suppression - [SuppressMessage( - "Gendarme.Rules.Maintainability", "AvoidUnnecessarySpecializationRule", - Justification = "AvoidSpeculativeGenerality too")] - [SuppressMessage("Microsoft.Design", - "CA1011:ConsiderPassingBaseTypesAsParameters", - Justification = "The Cake.Core.IO.FilePath won't be any other Cake.Core.IO.Path subclass")] - public static void DotNetTest( - this ICakeContext context, - FilePath project, - DotNetTestSettings testSettings, - CoverageSettings coverageSettings) - { - if (project == null) throw new ArgumentNullException(nameof(project)); - if (testSettings == null) throw new ArgumentNullException(nameof(testSettings)); - if (coverageSettings == null) throw new ArgumentNullException(nameof(coverageSettings)); + [SuppressMessage( + "Gendarme.Rules.Maintainability", "AvoidUnnecessarySpecializationRule", + Justification = "AvoidSpeculativeGenerality too")] + [SuppressMessage("Microsoft.Design", + "CA1011:ConsiderPassingBaseTypesAsParameters", + Justification = "The Cake.Core.IO.FilePath won't be any other Cake.Core.IO.Path subclass")] + public static void DotNetTest( + this ICakeContext context, + FilePath project, + DotNetTestSettings testSettings, + CoverageSettings coverageSettings) + { + if (project == null) throw new ArgumentNullException(nameof(project)); + if (testSettings == null) throw new ArgumentNullException(nameof(testSettings)); + if (coverageSettings == null) throw new ArgumentNullException(nameof(coverageSettings)); + + testSettings.ArgumentCustomization = coverageSettings.Concatenate(testSettings.ArgumentCustomization); - testSettings.ArgumentCustomization = coverageSettings.Concatenate(testSettings.ArgumentCustomization); -#if NETSTANDARD2_0 - context.DotNetCoreTest(project.FullPath, testSettings); -#else DotNetAliases.DotNetTest(context, project.GetFilename().FullPath, testSettings); -#endif - } } + } } \ No newline at end of file diff --git a/AltCover.Cake/Options.cs b/AltCover.Cake/Options.cs index 6642a5fde..b1bebfbad 100644 --- a/AltCover.Cake/Options.cs +++ b/AltCover.Cake/Options.cs @@ -168,9 +168,9 @@ public class PrepareOptions : Abstract.IPrepareOptions public virtual bool MethodPoint => false; /// - /// Corresponds to command line option `--single` + /// Corresponds to command line option `--all` /// - public virtual bool SingleVisit => false; + public virtual bool All => false; /// /// Corresponds to command line option `--linecover` @@ -222,7 +222,7 @@ public class PrepareOptions : Abstract.IPrepareOptions [SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", Justification = "Means 'do not use'")] - public bool Defer => throw new NotImplementedException("Defer not used"); + public bool Eager => throw new NotImplementedException("Eager not used"); /// /// Corresponds to command line option `-l, --localSource` diff --git a/AltCover.DataCollector/AltCover.DataCollector.csproj b/AltCover.DataCollector/AltCover.DataCollector.csproj index 1a7f0000f..10fc497be 100644 --- a/AltCover.DataCollector/AltCover.DataCollector.csproj +++ b/AltCover.DataCollector/AltCover.DataCollector.csproj @@ -22,7 +22,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/AltCover.DotNet/AssemblyInfo.fs b/AltCover.DotNet/AssemblyInfo.fs index e4b4859b0..707baf8ab 100644 --- a/AltCover.DotNet/AssemblyInfo.fs +++ b/AltCover.DotNet/AssemblyInfo.fs @@ -10,5 +10,9 @@ open System.Diagnostics.CodeAnalysis Target = "System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute", Justification = "Injected type")>] - +[] do () \ No newline at end of file diff --git a/AltCover.DotNet/DotNet.fs b/AltCover.DotNet/DotNet.fs index 5f4e3ce82..60c5f8801 100644 --- a/AltCover.DotNet/DotNet.fs +++ b/AltCover.DotNet/DotNet.fs @@ -125,7 +125,7 @@ module DotNet = let internal toPrepareArgArgumentList (prepare: Abstract.IPrepareOptions) = [ (arg, "ZipFile", "true", prepare.ZipFile) //="true|false"` - set "true" to store the coverage report in a `.zip` archive (arg, "MethodPoint", "true", prepare.MethodPoint) //="true|false"` - set "true" to record only the first point of each method - (arg, "Single", "true", prepare.SingleVisit) //="true|false"` - set "true" to record only the first visit to each point + (arg, "All", "true", prepare.All) //="true|false"` - set "true" to record every visit to each point (arg, "LineCover", "true", prepare.LineCover) //="true|false"` - set "true" to record only line coverage in OpenCover format (arg, "BranchCover", "true", prepare.BranchCover) //="true|false"` - set "true" to record only branch coverage in OpenCover format (arg, "SourceLink", "true", prepare.SourceLink) //=true|false` to opt for SourceLink document URLs for tracked files @@ -145,7 +145,7 @@ module DotNet = "AvoidMethodWithUnusedGenericTypeRule", Justification = "It just be like that")>] let internal toCollectListArgArgumentList (collect: Abstract.ICollectOptions) = - [ fromList, "Packages", collect.Packages ] //=`"pipe `'|'` separated list of method name regexs" + [ fromList, "Packages", collect.Packages ] //=`"pipe `'|'` separated list of source root paths" let internal toSharedFromValueArgumentList (verbosity: System.Diagnostics.TraceLevel) @@ -240,14 +240,15 @@ module DotNet = [] #else -[.$DotNet.#.cctor()", - Justification = "Compiler generated")>] +//[.$DotNet.#.cctor()", +// Justification = "Compiler generated")>] + #endif () \ No newline at end of file diff --git a/AltCover.DotNet/Options.fs b/AltCover.DotNet/Options.fs index 612300b3b..07ae30bd6 100644 --- a/AltCover.DotNet/Options.fs +++ b/AltCover.DotNet/Options.fs @@ -115,13 +115,13 @@ module Options = member val Save = true with get, set member val ZipFile = false with get, set member val MethodPoint = false with get, set - member val SingleVisit = false with get, set + member val All = false with get, set member val LineCover = false with get, set member val BranchCover = false with get, set member val CommandLine = Seq.empty with get, set member val ExposeReturnCode = true with get, set member val SourceLink = false with get, set - member val Defer = false with get, set + member val Eager = false with get, set member val LocalSource = false with get, set member val VisibleBranches = false with get, set member val ShowStatic = "-" with get, set @@ -175,7 +175,7 @@ module Options = member self.Save = self.Save member self.ZipFile = self.ZipFile member self.MethodPoint = self.MethodPoint - member self.SingleVisit = self.SingleVisit + member self.All = self.All member self.LineCover = self.LineCover member self.BranchCover = self.BranchCover member self.CommandLine = self.CommandLine @@ -184,7 +184,7 @@ module Options = self.ExposeReturnCode member self.SourceLink = self.SourceLink - member self.Defer = self.Defer + member self.Eager = self.Eager member self.LocalSource = self.LocalSource member self.VisibleBranches = diff --git a/AltCover.Engine/Abstract.fs b/AltCover.Engine/Abstract.fs index 8c049c184..cdaa0faeb 100644 --- a/AltCover.Engine/Abstract.fs +++ b/AltCover.Engine/Abstract.fs @@ -106,7 +106,6 @@ module Abstract = //The members correspond to the like-named command line options for `AltCover`, except //* `ExposeReturnCode` being the converse of the `dropReturnCode` option //* `CommandLine` being the material after a `-- ` -//* `SingleVisit` being the name for `--single` // // ``` /// @@ -218,9 +217,9 @@ module Abstract = /// abstract member MethodPoint : bool with get /// - /// Corresponds to command line option `--single` + /// Corresponds to command line option `--all` /// - abstract member SingleVisit : bool with get + abstract member All : bool with get /// /// Corresponds to command line option `--linecover` /// @@ -242,9 +241,9 @@ module Abstract = /// abstract member SourceLink : bool with get /// - /// Corresponds to command line option `--defer` + /// Corresponds to command line option `--eager` /// - abstract member Defer : bool with get + abstract member Eager : bool with get /// /// Corresponds to command line option `-l, --localSource` /// diff --git a/AltCover.Engine/AltCover.Engine.fsproj b/AltCover.Engine/AltCover.Engine.fsproj index 978b48a99..2b1eb7d9b 100644 --- a/AltCover.Engine/AltCover.Engine.fsproj +++ b/AltCover.Engine/AltCover.Engine.fsproj @@ -80,19 +80,7 @@ all runtime; build; native; contentfiles; analyzers - - - ..\ThirdParty\cecil\Mono.Cecil.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Rocks.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Mdb.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Pdb.dll - + contentfiles diff --git a/AltCover.Engine/AltCover.fs b/AltCover.Engine/AltCover.fs index 0a15ccc39..030234964 100644 --- a/AltCover.Engine/AltCover.fs +++ b/AltCover.Engine/AltCover.fs @@ -46,8 +46,24 @@ module AltCover = Environment.NewLine, Seq.concat [ [| cl |] |> Array.toSeq; self.Errors ] ) + + let validateArraySimple a f = a |> Seq.iter (f >> ignore) + + let validateArray a f key = validateArraySimple a (f key) + + let validateOptional f key x = + if x |> String.IsNullOrWhiteSpace |> not then + f key x |> ignore + #endif + let toSeq (s: 'a seq) = + match s with + | null -> Seq.empty<'a> + | _ -> s + + let toList (s: 'a seq) = s |> toSeq |> Seq.toList + [ Seq.empty - | _ -> s - member self.RecorderDirectory = match self with | Primitive p -> p.RecorderDirectory @@ -118,8 +129,8 @@ module AltCover = member self.CommandLine = match self with - | Primitive p -> p.CommandLine |> CollectOptions.ToSeq - | Abstract a -> a.CommandLine |> CollectOptions.ToSeq + | Primitive p -> p.CommandLine |> toSeq + | Abstract a -> a.CommandLine |> toSeq | TypeSafe t -> t.CommandLine.AsStrings() member self.ExposeReturnCode = @@ -212,41 +223,34 @@ module AltCover = | TypeSafe of TypeSafe.PrepareOptions | Abstract of Abstract.IPrepareOptions - static member private ToSeq(s: 'a seq) = - match s with - | null -> Seq.empty<'a> - | _ -> s - - static member private ToList(s: 'a seq) = s |> PrepareOptions.ToSeq |> Seq.toList - member self.InputDirectories = match self with - | Primitive p -> p.InputDirectories |> PrepareOptions.ToList - | Abstract a -> a.InputDirectories |> PrepareOptions.ToList + | Primitive p -> p.InputDirectories |> toList + | Abstract a -> a.InputDirectories |> toList | TypeSafe t -> t.InputDirectories.AsStrings() member self.OutputDirectories = match self with - | Primitive p -> p.OutputDirectories |> PrepareOptions.ToList - | Abstract a -> a.OutputDirectories |> PrepareOptions.ToList + | Primitive p -> p.OutputDirectories |> toList + | Abstract a -> a.OutputDirectories |> toList | TypeSafe t -> t.OutputDirectories.AsStrings() member self.SymbolDirectories = match self with - | Primitive p -> p.SymbolDirectories |> PrepareOptions.ToList - | Abstract a -> a.SymbolDirectories |> PrepareOptions.ToList + | Primitive p -> p.SymbolDirectories |> toList + | Abstract a -> a.SymbolDirectories |> toList | TypeSafe t -> t.SymbolDirectories.AsStrings() member self.Dependencies = match self with - | Primitive p -> p.Dependencies |> PrepareOptions.ToList - | Abstract a -> a.Dependencies |> PrepareOptions.ToList + | Primitive p -> p.Dependencies |> toList + | Abstract a -> a.Dependencies |> toList | TypeSafe t -> t.Dependencies.AsStrings() member self.Keys = match self with - | Primitive p -> p.Keys |> PrepareOptions.ToList - | Abstract a -> a.Keys |> PrepareOptions.ToList + | Primitive p -> p.Keys |> toList + | Abstract a -> a.Keys |> toList | TypeSafe t -> t.Keys.AsStrings() member self.StrongNameKey = @@ -263,68 +267,68 @@ module AltCover = member self.FileFilter = match self with - | Primitive p -> p.FileFilter |> PrepareOptions.ToList - | Abstract a -> a.FileFilter |> PrepareOptions.ToList + | Primitive p -> p.FileFilter |> toList + | Abstract a -> a.FileFilter |> toList | TypeSafe t -> t.FileFilter.AsStrings() member self.AssemblyFilter = match self with - | Primitive p -> p.AssemblyFilter |> PrepareOptions.ToList - | Abstract a -> a.AssemblyFilter |> PrepareOptions.ToList + | Primitive p -> p.AssemblyFilter |> toList + | Abstract a -> a.AssemblyFilter |> toList | TypeSafe t -> t.AssemblyFilter.AsStrings() member self.AssemblyExcludeFilter = match self with - | Primitive p -> p.AssemblyExcludeFilter |> PrepareOptions.ToList - | Abstract a -> a.AssemblyExcludeFilter |> PrepareOptions.ToList + | Primitive p -> p.AssemblyExcludeFilter |> toList + | Abstract a -> a.AssemblyExcludeFilter |> toList | TypeSafe t -> t.AssemblyExcludeFilter.AsStrings() member self.TypeFilter = match self with - | Primitive p -> p.TypeFilter |> PrepareOptions.ToList - | Abstract a -> a.TypeFilter |> PrepareOptions.ToList + | Primitive p -> p.TypeFilter |> toList + | Abstract a -> a.TypeFilter |> toList | TypeSafe t -> t.TypeFilter.AsStrings() member self.MethodFilter = match self with - | Primitive p -> p.MethodFilter |> PrepareOptions.ToList - | Abstract a -> a.MethodFilter |> PrepareOptions.ToList + | Primitive p -> p.MethodFilter |> toList + | Abstract a -> a.MethodFilter |> toList | TypeSafe t -> t.MethodFilter.AsStrings() member self.AttributeFilter = match self with - | Primitive p -> p.AttributeFilter |> PrepareOptions.ToList - | Abstract a -> a.AttributeFilter |> PrepareOptions.ToList + | Primitive p -> p.AttributeFilter |> toList + | Abstract a -> a.AttributeFilter |> toList | TypeSafe t -> t.AttributeFilter.AsStrings() member self.PathFilter = match self with - | Primitive p -> p.PathFilter |> PrepareOptions.ToList - | Abstract a -> a.PathFilter |> PrepareOptions.ToList + | Primitive p -> p.PathFilter |> toList + | Abstract a -> a.PathFilter |> toList | TypeSafe t -> t.PathFilter.AsStrings() member self.AttributeTopLevel = match self with - | Primitive p -> p.AttributeTopLevel |> PrepareOptions.ToList - | Abstract a -> a.AttributeTopLevel |> PrepareOptions.ToList + | Primitive p -> p.AttributeTopLevel |> toList + | Abstract a -> a.AttributeTopLevel |> toList | TypeSafe t -> t.AttributeTopLevel.AsStrings() member self.TypeTopLevel = match self with - | Primitive p -> p.TypeTopLevel |> PrepareOptions.ToList - | Abstract a -> a.TypeTopLevel |> PrepareOptions.ToList + | Primitive p -> p.TypeTopLevel |> toList + | Abstract a -> a.TypeTopLevel |> toList | TypeSafe t -> t.TypeTopLevel.AsStrings() member self.MethodTopLevel = match self with - | Primitive p -> p.MethodTopLevel |> PrepareOptions.ToList - | Abstract a -> a.MethodTopLevel |> PrepareOptions.ToList + | Primitive p -> p.MethodTopLevel |> toList + | Abstract a -> a.MethodTopLevel |> toList | TypeSafe t -> t.MethodTopLevel.AsStrings() member self.CallContext = match self with - | Primitive p -> p.CallContext |> PrepareOptions.ToList - | Abstract a -> a.CallContext |> PrepareOptions.ToList + | Primitive p -> p.CallContext |> toList + | Abstract a -> a.CallContext |> toList | TypeSafe t -> t.CallContext.AsStrings() member self.ReportFormat = @@ -363,11 +367,11 @@ module AltCover = | Abstract a -> a.MethodPoint | TypeSafe t -> t.MethodPoint.AsBool() - member self.SingleVisit = + member self.All = match self with - | Primitive p -> p.SingleVisit - | Abstract a -> a.SingleVisit - | TypeSafe t -> t.SingleVisit.AsBool() + | Primitive p -> p.All + | Abstract a -> a.All + | TypeSafe t -> t.All.AsBool() member self.LineCover = match self with @@ -383,8 +387,8 @@ module AltCover = member self.CommandLine = match self with - | Primitive p -> p.CommandLine |> PrepareOptions.ToSeq - | Abstract a -> a.CommandLine |> PrepareOptions.ToSeq + | Primitive p -> p.CommandLine |> toSeq + | Abstract a -> a.CommandLine |> toSeq | TypeSafe t -> t.CommandLine.AsStrings() member self.ExposeReturnCode = @@ -399,11 +403,11 @@ module AltCover = | Abstract a -> a.SourceLink | TypeSafe t -> t.SourceLink.AsBool() - member self.Defer = + member self.Eager = match self with - | Primitive p -> p.Defer - | Abstract a -> a.Defer - | TypeSafe t -> t.Defer.AsBool() + | Primitive p -> p.Eager + | Abstract a -> a.Eager + | TypeSafe t -> t.Eager.AsBool() member self.LocalSource = match self with @@ -455,73 +459,72 @@ module AltCover = interface Abstract.IPrepareOptions with member self.InputDirectories = - self.InputDirectories |> PrepareOptions.ToSeq + self.InputDirectories |> toSeq member self.OutputDirectories = - self.OutputDirectories |> PrepareOptions.ToSeq + self.OutputDirectories |> toSeq member self.SymbolDirectories = - self.SymbolDirectories |> PrepareOptions.ToSeq + self.SymbolDirectories |> toSeq member self.Dependencies = - self.Dependencies |> PrepareOptions.ToSeq + self.Dependencies |> toSeq - member self.Keys = - self.Keys |> PrepareOptions.ToSeq + member self.Keys = self.Keys |> toSeq member self.StrongNameKey = self.StrongNameKey member self.Report = self.Report member self.FileFilter = - self.FileFilter |> PrepareOptions.ToSeq + self.FileFilter |> toSeq member self.AssemblyFilter = - self.AssemblyFilter |> PrepareOptions.ToSeq + self.AssemblyFilter |> toSeq member self.AssemblyExcludeFilter = - self.AssemblyExcludeFilter |> PrepareOptions.ToSeq + self.AssemblyExcludeFilter |> toSeq member self.TypeFilter = - self.TypeFilter |> PrepareOptions.ToSeq + self.TypeFilter |> toSeq member self.MethodFilter = - self.MethodFilter |> PrepareOptions.ToSeq + self.MethodFilter |> toSeq member self.AttributeFilter = - self.AttributeFilter |> PrepareOptions.ToSeq + self.AttributeFilter |> toSeq member self.PathFilter = - self.PathFilter |> PrepareOptions.ToSeq + self.PathFilter |> toSeq member self.AttributeTopLevel = - self.AttributeTopLevel |> PrepareOptions.ToSeq + self.AttributeTopLevel |> toSeq member self.TypeTopLevel = - self.TypeTopLevel |> PrepareOptions.ToSeq + self.TypeTopLevel |> toSeq member self.MethodTopLevel = - self.MethodTopLevel |> PrepareOptions.ToSeq + self.MethodTopLevel |> toSeq member self.CallContext = - self.CallContext |> PrepareOptions.ToSeq + self.CallContext |> toSeq member self.ReportFormat = self.ReportFormat member self.InPlace = self.InPlace member self.Save = self.Save member self.ZipFile = self.ZipFile member self.MethodPoint = self.MethodPoint - member self.SingleVisit = self.SingleVisit + member self.All = self.All member self.LineCover = self.LineCover member self.BranchCover = self.BranchCover member self.CommandLine = - self.CommandLine |> PrepareOptions.ToSeq + self.CommandLine |> toSeq member self.ExposeReturnCode = self.ExposeReturnCode member self.SourceLink = self.SourceLink - member self.Defer = self.Defer + member self.Eager = self.Eager member self.LocalSource = self.LocalSource member self.VisibleBranches = @@ -535,14 +538,6 @@ module AltCover = member self.Portable = self.Portable #if RUNNER - static member private ValidateArray a f key = - PrepareOptions.ValidateArraySimple a (f key) - - static member private ValidateArraySimple a f = a |> Seq.iter (f >> ignore) - - static member private ValidateOptional f key x = - if x |> String.IsNullOrWhiteSpace |> not then - f key x |> ignore member private self.Consistent() = if self.LineCover && self.BranchCover then @@ -569,41 +564,35 @@ module AltCover = | _ -> false context - |> PrepareOptions.ToSeq + |> toSeq |> Seq.fold select false |> ignore try CommandLine.error <- [] - PrepareOptions.ValidateArray + validateArray self.InputDirectories CommandLine.validateDirectory "--inputDirectory" - PrepareOptions.ValidateArray - self.OutputDirectories - CommandLine.validatePath - "--outputDirectory" + validateArray self.OutputDirectories CommandLine.validatePath "--outputDirectory" - PrepareOptions.ValidateOptional + validateOptional CommandLine.validateStrongNameKey "--strongNameKey" self.StrongNameKey - PrepareOptions.ValidateOptional CommandLine.validatePath "--report" self.Report + validateOptional CommandLine.validatePath "--report" self.Report - PrepareOptions.ValidateArray + validateArray self.SymbolDirectories CommandLine.validateDirectory "--symbolDirectory" - PrepareOptions.ValidateArray - self.Dependencies - CommandLine.validateAssembly - "--dependency" + validateArray self.Dependencies CommandLine.validateAssembly "--dependency" - PrepareOptions.ValidateArray self.Keys CommandLine.validateStrongNameKey "--key" + validateArray self.Keys CommandLine.validateStrongNameKey "--key" [ self.FileFilter self.AssemblyFilter @@ -612,8 +601,7 @@ module AltCover = self.MethodFilter self.AttributeFilter self.PathFilter ] - |> Seq.iter (fun a -> - PrepareOptions.ValidateArraySimple a CommandLine.validateRegexes) + |> Seq.iter (fun a -> validateArraySimple a CommandLine.validateRegexes) self.Consistent() validateContext self.CallContext diff --git a/AltCover.Engine/AltCover.fsi b/AltCover.Engine/AltCover.fsi index 1d1cae30b..7a7c8c29e 100644 --- a/AltCover.Engine/AltCover.fsi +++ b/AltCover.Engine/AltCover.fsi @@ -150,7 +150,6 @@ namespace AltCoverFake.DotNet.Testing //The members correspond to the like-named command line options for `AltCover`, except //* `ExposeReturnCode` being the converse of the `dropReturnCode` option //* `CommandLine` being the material after a `-- ` -//* `SingleVisit` being the name for `--single` // // ``` /// @@ -265,9 +264,9 @@ namespace AltCoverFake.DotNet.Testing /// member MethodPoint : bool /// - /// Corresponds to command line option `--single` + /// Corresponds to command line option `--all` /// - member SingleVisit : bool + member All : bool /// /// Corresponds to command line option `--linecover` /// @@ -289,9 +288,9 @@ namespace AltCoverFake.DotNet.Testing /// member SourceLink : bool /// - /// Corresponds to command line option `--defer` + /// Corresponds to command line option `--eager` /// - member Defer : bool + member Eager : bool /// /// Corresponds to command line option `-l, --localSource` /// diff --git a/AltCover.Engine/Args.fs b/AltCover.Engine/Args.fs index 625512e90..e9c3285d7 100644 --- a/AltCover.Engine/Args.fs +++ b/AltCover.Engine/Args.fs @@ -82,12 +82,12 @@ module internal Args = ("--save", args.Save) ("--zipfile", args.ZipFile) ("--methodpoint", args.MethodPoint) - ("--single", args.SingleVisit) + ("--all", args.All) ("--linecover", args.LineCover) ("--branchcover", args.BranchCover) ("--dropReturnCode", (args.ExposeReturnCode |> not)) ("--sourcelink", args.SourceLink) - ("--defer", args.Defer) + ("--eager", args.Eager) ("--localSource", args.LocalSource) ("--visibleBranches", args.VisibleBranches) ("--showGenerated", args.ShowGenerated) diff --git a/AltCover.Engine/CecilEx.fs b/AltCover.Engine/CecilEx.fs index e2b8e1bdb..eb4aa19da 100644 --- a/AltCover.Engine/CecilEx.fs +++ b/AltCover.Engine/CecilEx.fs @@ -100,11 +100,13 @@ type internal AssemblyResolver() as self = static member ReadAssembly(path: String) = let reader = ReaderParameters() + // fsharplint:disable-next-line RedundantNewKeyword reader.AssemblyResolver <- new AssemblyResolver() AssemblyDefinition.ReadAssembly(path, reader) static member ReadAssembly(file: Stream) = let reader = ReaderParameters() + // fsharplint:disable-next-line RedundantNewKeyword reader.AssemblyResolver <- new AssemblyResolver() AssemblyDefinition.ReadAssembly(file, reader) @@ -379,4 +381,12 @@ module internal CecilExtension = |> Seq.filter (fun i -> i.OpCode = OpCodes.Tail) |> Seq.iter (fun i -> i.OpCode <- OpCodes.Nop - i.Operand <- nullObject) \ No newline at end of file + i.Operand <- nullObject) + +[)", + Justification = "code inlined")>] +() \ No newline at end of file diff --git a/AltCover.Engine/Instrument.fs b/AltCover.Engine/Instrument.fs index a07293942..6b05a0875 100644 --- a/AltCover.Engine/Instrument.fs +++ b/AltCover.Engine/Instrument.fs @@ -82,8 +82,11 @@ type internal AsyncSupport = let wait = task.Methods - |> Seq.filter (fun f -> - f.FullName = "System.Boolean System.Threading.Tasks.Task::Wait(System.Int32)") + |> Seq.filter + _.FullName.Equals( + "System.Boolean System.Threading.Tasks.Task::Wait(System.Int32)", + StringComparison.Ordinal + ) |> Seq.head let def2 = @@ -95,7 +98,7 @@ type internal AsyncSupport = let runsynch = fsasync.Methods - |> Seq.filter (fun f -> f.Name = "RunSynchronously") + |> Seq.filter _.Name.Equals("RunSynchronously", StringComparison.Ordinal) |> Seq.head { TaskAssembly = def @@ -395,8 +398,8 @@ module internal Instrument = ("get_Sample", (fun (w: ILProcessor) -> w.Create(OpCodes.Ldc_I4, CoverageParameters.sampling ()))) - ("get_Defer", - (fun (w: ILProcessor) -> w.Create(CoverageParameters.deferOpCode ()))) ] + ("get_Eager", + (fun (w: ILProcessor) -> w.Create(CoverageParameters.eagerOpCode ()))) ] |> List.iter (fun (property, value) -> let pathGetterDef = definition.MainModule.GetTypes() @@ -1479,6 +1482,6 @@ module internal Instrument = "PreferStringComparisonOverrideRule", Scope = "member", // MethodDefinition Target = - "AltCover.Instrument/I/tag@243::Invoke(System.String)", + "AltCover.Instrument/I/tag@246::Invoke(System.String)", Justification = "Replace override not available")>] () \ No newline at end of file diff --git a/AltCover.Engine/Main.fs b/AltCover.Engine/Main.fs index 3aeb370e2..07ed42b70 100644 --- a/AltCover.Engine/Main.fs +++ b/AltCover.Engine/Main.fs @@ -34,7 +34,7 @@ module internal Main = CommandLine.verbosity <- 0 CommandLine.error <- [] CommandLine.dropReturnCode.Value <- false // ddFlag - CoverageParameters.defer.Value <- false // ddflag + CoverageParameters.eager.Value <- false // ddflag CoverageParameters.theInputDirectories.Clear() CoverageParameters.theOutputDirectories.Clear() CoverageParameters.configurationHash <- None @@ -70,7 +70,7 @@ module internal Main = CoverageParameters.inplace.Value <- false // ddFlag CoverageParameters.collect.Value <- false // ddFlag CoverageParameters.local.Value <- false // ddFlag - CoverageParameters.single <- false // more complicated + CoverageParameters.all <- false // more complicated CoverageParameters.coverstyle <- CoverStyle.All CoverageParameters.sourcelink.Value <- false // ddFlag CoverageParameters.coalesceBranches.Value <- false // ddFlag @@ -266,14 +266,14 @@ module internal Main = (CommandLine.ddFlag "save" CoverageParameters.collect) (CommandLine.ddFlag "zipfile" CoverageParameters.zipReport) (CommandLine.ddFlag "methodpoint" CoverageParameters.methodPoint) - ("single", + ("all", (fun _ -> - if CoverageParameters.single then + if CoverageParameters.all then CommandLine.error <- - CommandLine.Format.Local("MultiplesNotAllowed", "--single") + CommandLine.Format.Local("MultiplesNotAllowed", "--all") :: CommandLine.error else - CoverageParameters.single <- true)) + CoverageParameters.all <- true)) ("linecover", (fun _ -> match CoverageParameters.coverstyle with @@ -300,7 +300,7 @@ module internal Main = | _ -> CoverageParameters.coverstyle <- CoverStyle.BranchOnly)) (CommandLine.ddFlag "dropReturnCode" CommandLine.dropReturnCode) (CommandLine.ddFlag "sourcelink" CoverageParameters.sourcelink) - (CommandLine.ddFlag "defer" CoverageParameters.defer) + (CommandLine.ddFlag "eager" CoverageParameters.eager) (CommandLine.ddFlag "v|visibleBranches" CoverageParameters.coalesceBranches) ("showstatic:", (fun x -> @@ -434,8 +434,13 @@ module internal Main = tidy (x) let internal matchType = + let os = + System.Environment.GetEnvironmentVariable("OS") + |> Option.ofObj + |> Option.defaultValue String.Empty + Maybe - (System.Environment.GetEnvironmentVariable("OS") = "Windows_NT") + (os.Equals("Windows_NT", StringComparison.Ordinal)) StringComparison.OrdinalIgnoreCase StringComparison.Ordinal @@ -809,7 +814,7 @@ module internal Main = Assembly.GetExecutingAssembly().Location |> Path.GetDirectoryName - [ "../netcoreapp2.0" + [ "../net8.0" "../netstandard2.0" "../any" ] |> Seq.map (fun d -> diff --git a/AltCover.Engine/NativeJson.fs b/AltCover.Engine/NativeJson.fs index 6476ec047..5e0f2d3c4 100644 --- a/AltCover.Engine/NativeJson.fs +++ b/AltCover.Engine/NativeJson.fs @@ -1474,8 +1474,7 @@ type internal DocumentType = [.$NativeJson.#.cctor()", + Target = "AltCover.NativeJson.#.cctor()", Justification = "Compiler Generated")>] #endif diff --git a/AltCover.Engine/PostProcess.fs b/AltCover.Engine/PostProcess.fs index f6d02eeca..fc863aeb1 100644 --- a/AltCover.Engine/PostProcess.fs +++ b/AltCover.Engine/PostProcess.fs @@ -515,4 +515,40 @@ module internal PostProcess = Target = "AltCover.PostProcess/Pipe #2 stage #1 at line 330@331-1::Invoke(AltCover.XmlElementAbstraction)", Justification = "Compiler generated")>] +[] +[] +[] +[] +[] +[] () \ No newline at end of file diff --git a/AltCover.Engine/Primitive.fs b/AltCover.Engine/Primitive.fs index 8c5afc91c..2a4a9ed44 100644 --- a/AltCover.Engine/Primitive.fs +++ b/AltCover.Engine/Primitive.fs @@ -82,13 +82,13 @@ module Primitive = Save: bool ZipFile: bool MethodPoint: bool - SingleVisit: bool + All: bool LineCover: bool BranchCover: bool CommandLine: String seq ExposeReturnCode: bool SourceLink: bool - Defer: bool + Eager: bool LocalSource: bool VisibleBranches: bool ShowStatic: string @@ -121,13 +121,13 @@ module Primitive = Save = true ZipFile = false MethodPoint = false - SingleVisit = false + All = false LineCover = false BranchCover = false CommandLine = [] ExposeReturnCode = true SourceLink = false - Defer = false + Eager = false LocalSource = false VisibleBranches = false ShowStatic = "-" diff --git a/AltCover.Engine/Primitive.fsi b/AltCover.Engine/Primitive.fsi index 862a216b8..7d53e1440 100644 --- a/AltCover.Engine/Primitive.fsi +++ b/AltCover.Engine/Primitive.fsi @@ -101,7 +101,6 @@ namespace AltCoverFake.DotNet.Testing //The members correspond to the like-named command line options for `AltCover`, except //* `ExposeReturnCode` being the converse of the `dropReturnCode` option //* `CommandLine` being the material after a `-- ` -//* `SingleVisit` being the name for `--single` // // ``` /// @@ -203,9 +202,9 @@ namespace AltCoverFake.DotNet.Testing /// MethodPoint: bool /// - /// Corresponds to command line option `--single` + /// Corresponds to command line option `--all` /// - SingleVisit: bool + All: bool /// /// Corresponds to command line option `--linecover` /// @@ -227,9 +226,9 @@ namespace AltCoverFake.DotNet.Testing /// SourceLink: bool /// - /// Corresponds to command line option `--defer` + /// Corresponds to command line option `--eager` /// - Defer: bool + Eager: bool /// /// Corresponds to command line option `-l, --localSource` /// diff --git a/AltCover.Engine/Runner.fs b/AltCover.Engine/Runner.fs index c685903de..10aad5601 100644 --- a/AltCover.Engine/Runner.fs +++ b/AltCover.Engine/Runner.fs @@ -1552,4 +1552,16 @@ module internal Runner = Target = "AltCover.TeamCityFormat+Tags.#R", MessageId = "R", Justification = "TeamCity notation")>] +[)", + Justification = "Generated comparison")>] +[] () \ No newline at end of file diff --git a/AltCover.Engine/Strings.eo.resx b/AltCover.Engine/Strings.eo.resx index d97bc31ed..6d9021c7c 100644 --- a/AltCover.Engine/Strings.eo.resx +++ b/AltCover.Engine/Strings.eo.resx @@ -155,7 +155,7 @@ Vidu ankaŭ '--inplace' Krei dosierujon {0} - AltCover [/i[nputDirectory]=VALO] [/o[utputDirectory]=VALO] [/y|symbolDirectory=VALO] [/d[ependency]=VALO] [/k[ey]=VALO] [/sn|strongNameKey=VALO] [/r[eport]=VALO] [/f[ileFilter]=VALO] [/p[athFilter]=VALO] [/s|assemblyFilter=VALO] [/e|assemblyExcludeFilter=VALO] [/t[ypeFilter]=VALO] [/m[ethodFilter]=VALO] [/a[ttributeFilter]=VALO] [/attributetoplevel=VALO] [/typetoplevel=VALO] [/methodtoplevel=VALO] [--l[ocalSource]] [/c[allContext]=VALO] [/reportFormat=VALO] [--inplace] [--save] [--zipfile] [--methodpoint] [--single] [--linecover] [--branchcover] [--dropReturnCode] [--sourcelink] [--defer] [--v[isibleBranches]] [/showstatic[=VALO]] [--showGenerated] [--trivia] [--portable] [-q] [--verbose] [--?|help|h] [-- ] [...] + AltCover [/i[nputDirectory]=VALO] [/o[utputDirectory]=VALO] [/y|symbolDirectory=VALO] [/d[ependency]=VALO] [/k[ey]=VALO] [/sn|strongNameKey=VALO] [/r[eport]=VALO] [/f[ileFilter]=VALO] [/p[athFilter]=VALO] [/s|assemblyFilter=VALO] [/e|assemblyExcludeFilter=VALO] [/t[ypeFilter]=VALO] [/m[ethodFilter]=VALO] [/a[ttributeFilter]=VALO] [/attributetoplevel=VALO] [/typetoplevel=VALO] [/methodtoplevel=VALO] [--l[ocalSource]] [/c[allContext]=VALO] [/reportFormat=VALO] [--inplace] [--save] [--zipfile] [--methodpoint] [--all] [--linecover] [--branchcover] [--dropReturnCode] [--sourcelink] [--eager] [--v[isibleBranches]] [/showstatic[=VALO]] [--showGenerated] [--trivia] [--portable] [-q] [--verbose] [--?|help|h] [-- ] [...] aŭ AltCover Runner [/r[ecorderDirectory]=VALO] [/w[orkingDirectory]=VALO] [/x|executable=VALO] [--collect] [/l[covReport]=VALO] [/t[hreshold]=VALO] [/c[obertura]=VALO] [/p[ackage]=VALO] [/o[utputFile]=VALO] [--dropReturnCode] [/summary|teamcity[=VALO]] [-q] [--verbose] [--?|help|h] [-- ] [...] aŭ @@ -356,8 +356,8 @@ Nuloj / forestantaj valoroj estas ignorataj. Se priraportada rezulto estas sub s Komandlinioj opcioj {0} kaj {1} estas reciproke ekskluzivaj. - - Laŭvola: registru la unuan trafon nur en iu ajn loko, aŭ unue trafu por ĉiu kunteksto se --callContext funkcias. + + Laŭvola: registri ĉiun sukceson en ajna loko, kaj por ĉiu kunteksto se --callContext funkcias. Laŭvola: Ne registru branĉan kovradon. Ignorita en la kazo de la opcio --reportFormat = NCover. @@ -387,8 +387,8 @@ Nuloj / forestantaj valoroj estas ignorataj. Se priraportada rezulto estas sub s Se la opcio ĉeestas, sed havas neniun valoron, tio estas la sama kiel 'B' Se la opcio ne ĉeestas, tiam la defaŭlta estas 'OC'. - - Laŭvola, transdono de skriba kurant-reĝimaj priraportado ĝis elira procezo. + + Laŭvola, tuj skribas priraportajn datumojn pri kuristo. {0} estis jam specifita por {1} diff --git a/AltCover.Engine/Strings.resx b/AltCover.Engine/Strings.resx index 7603e40f4..68bbf40be 100644 --- a/AltCover.Engine/Strings.resx +++ b/AltCover.Engine/Strings.resx @@ -155,7 +155,7 @@ See also '--inplace' Creating folder {0} - AltCover [/i[nputDirectory]=VALUE] [/o[utputDirectory]=VALUE] [/y|symbolDirectory=VALUE] [/d[ependency]=VALUE] [/k[ey]=VALUE] [/sn|strongNameKey=VALUE] [/r[eport]=VALUE] [/f[ileFilter]=VALUE] [/p[athFilter]=VALUE] [/s|assemblyFilter=VALUE] [/e|assemblyExcludeFilter=VALUE] [/t[ypeFilter]=VALUE] [/m[ethodFilter]=VALUE] [/a[ttributeFilter]=VALUE] [/attributetoplevel=VALUE] [/typetoplevel=VALUE] [/methodtoplevel=VALUE] [--l[ocalSource]] [/c[allContext]=VALUE] [/reportFormat=VALUE] [--inplace] [--save] [--zipfile] [--methodpoint] [--single] [--linecover] [--branchcover] [--dropReturnCode] [--sourcelink] [--defer] [--v[isibleBranches]] [/showstatic[=VALUE]] [--showGenerated] [--trivia] [--portable] [-q] [--verbose] [--?|help|h] [-- ] [...] + AltCover [/i[nputDirectory]=VALUE] [/o[utputDirectory]=VALUE] [/y|symbolDirectory=VALUE] [/d[ependency]=VALUE] [/k[ey]=VALUE] [/sn|strongNameKey=VALUE] [/r[eport]=VALUE] [/f[ileFilter]=VALUE] [/p[athFilter]=VALUE] [/s|assemblyFilter=VALUE] [/e|assemblyExcludeFilter=VALUE] [/t[ypeFilter]=VALUE] [/m[ethodFilter]=VALUE] [/a[ttributeFilter]=VALUE] [/attributetoplevel=VALUE] [/typetoplevel=VALUE] [/methodtoplevel=VALUE] [--l[ocalSource]] [/c[allContext]=VALUE] [/reportFormat=VALUE] [--inplace] [--save] [--zipfile] [--methodpoint] [--all] [--linecover] [--branchcover] [--dropReturnCode] [--sourcelink] [--eager] [--v[isibleBranches]] [/showstatic[=VALUE]] [--showGenerated] [--trivia] [--portable] [-q] [--verbose] [--?|help|h] [-- ] [...] or AltCover Runner [/r[ecorderDirectory]=VALUE] [/w[orkingDirectory]=VALUE] [/x|executable=VALUE] [--collect] [/l[covReport]=VALUE] [/t[hreshold]=VALUE] [/c[obertura]=VALUE] [/p[ackage]=VALUE] [/o[utputFile]=VALUE] [--dropReturnCode] [/summary|teamcity[=VALUE]] [-q] [--verbose] [--?|help|h] [-- ] [...] or @@ -360,8 +360,8 @@ Zero/absent values are ignored. If a coverage result is below threshold, or the Command line options {0} and {1} are mutally exclusive. - - Optional: only record the first hit at any location, or first hit for each context if --callContext is operating. + + Optional: record every hit at any location, and for each context if --callContext is operating. Optional: Do not record branch coverage. Ignored for the --reportFormat=NCover option. @@ -391,8 +391,8 @@ Zero/absent values are ignored. If a coverage result is below threshold, or the If the option is present, but has no value, this is the same as 'B' If the option is not present, then the default is 'OC'. - - Optional, defers writing runner-mode coverage data until process exit. + + Optional, writes runner-mode coverage data immediately. {0} was already specified for {1} diff --git a/AltCover.Engine/Tasks.fs b/AltCover.Engine/Tasks.fs index 0c25ed247..89d9d5314 100644 --- a/AltCover.Engine/Tasks.fs +++ b/AltCover.Engine/Tasks.fs @@ -121,7 +121,7 @@ type Prepare() = member val Save = true with get, set member val ZipFile = false with get, set member val MethodPoint = false with get, set - member val SingleVisit = false with get, set + member val All = false with get, set member val LineCover = false with get, set member val BranchCover = false with get, set @@ -131,7 +131,7 @@ type Prepare() = member val CommandLine: string array = [||] with get, set member val SourceLink = false with get, set - member val Defer = true with get, set + member val Eager = false with get, set member val VisibleBranches = false with get, set member val ShowStatic = "-" with get, set member val ShowGenerated = false with get, set @@ -180,13 +180,13 @@ type Prepare() = Save = self.Save ZipFile = self.ZipFile MethodPoint = self.MethodPoint - SingleVisit = self.SingleVisit + All = self.All LineCover = self.LineCover BranchCover = self.BranchCover CommandLine = self.CommandLine ExposeReturnCode = self.ExposeReturnCode SourceLink = self.SourceLink - Defer = self.Defer + Eager = self.Eager LocalSource = self.LocalSource VisibleBranches = self.VisibleBranches ShowStatic = self.ShowStatic diff --git a/AltCover.Engine/Tasks.fsi b/AltCover.Engine/Tasks.fsi index e2b834585..9866f4361 100644 --- a/AltCover.Engine/Tasks.fsi +++ b/AltCover.Engine/Tasks.fsi @@ -5,14 +5,14 @@ // For the C# programmer, attributes have the extra angle-brackets, while `member [Name] : [type] with get, set` is a `[type]` valued property called `[Name]`; and `string array` is just `string[]` spelled out longhand. // // -// For `AltCover.Prepare` and `AltCover.Collect`, the task parameters match the command line arguments in name and function, except that `SymbolDirectories` is pluralised, `SingleVisit` represents the `--single` option, `ExposeReturnCode` is the converse of the command line option `dropReturnCode`, and `CommandLine` is everything after a `--` . If `AltCover.Collect`'s `Executable` parameter is set, that switches the virtual `--collect` flag off. +// For `AltCover.Prepare` and `AltCover.Collect`, the task parameters match the command line arguments in name and function, except that `SymbolDirectories` is pluralised, `ExposeReturnCode` is the converse of the command line option `dropReturnCode`, and `CommandLine` is everything after a `--` . If `AltCover.Collect`'s `Executable` parameter is set, that switches the virtual `--collect` flag off. // ``` namespace AltCover open Microsoft.Build.Framework //// no doc open Microsoft.Build.Utilities //// no doc // ``` // ## Task `AltCover.Prepare` -// This is the instrumentation mode with `--save --inplace --defer` as default. Associated parameters are +// This is the instrumentation mode with `--save --inplace` as default. Associated parameters are // ``` /// /// Description of the `AltCover` command @@ -122,9 +122,9 @@ type Prepare = /// member MethodPoint : bool with get, set /// - /// Corresponds to command line option `--single` + /// Corresponds to command line option `--all` /// - member SingleVisit : bool with get, set + member All : bool with get, set /// /// Corresponds to command line option `--linecover` /// @@ -146,9 +146,9 @@ type Prepare = /// member SourceLink : bool with get, set /// - /// Corresponds to command line option `--defer` + /// Corresponds to command line option `--eager` /// - member Defer : bool with get, set + member Eager : bool with get, set /// /// Corresponds to command line option `-l, --localSource` /// diff --git a/AltCover.Engine/TypeSafe.fs b/AltCover.Engine/TypeSafe.fs index facd66e30..f6ac93529 100644 --- a/AltCover.Engine/TypeSafe.fs +++ b/AltCover.Engine/TypeSafe.fs @@ -313,13 +313,13 @@ module TypeSafe = Save: Flag ZipFile: Flag MethodPoint: Flag - SingleVisit: Flag + All: Flag LineCover: Flag BranchCover: Flag CommandLine: CommandLine ExposeReturnCode: Flag SourceLink: Flag - Defer: Flag + Eager: Flag LocalSource: Flag VisibleBranches: Flag ShowStatic: StaticFormat @@ -352,13 +352,13 @@ module TypeSafe = Save = Set ZipFile = Clear MethodPoint = Clear - SingleVisit = Clear + All = Clear LineCover = Clear BranchCover = Clear CommandLine = NoCommand ExposeReturnCode = Set SourceLink = Clear - Defer = Clear + Eager = Clear LocalSource = Clear VisibleBranches = Clear ShowStatic = StaticFormat.Default diff --git a/AltCover.Engine/TypeSafe.fsi b/AltCover.Engine/TypeSafe.fsi index aabf4fc3e..194523143 100644 --- a/AltCover.Engine/TypeSafe.fsi +++ b/AltCover.Engine/TypeSafe.fsi @@ -118,7 +118,7 @@ namespace AltCoverFake.DotNet.Testing // ### Cobertura package roots // ``` /// - /// Corresponds to a value after `-- ` on the command line + /// Corresponds to a cobertura package source root /// [] type Package = @@ -128,13 +128,13 @@ namespace AltCoverFake.DotNet.Testing | Package of System.String with /// - /// Returns the string to be used in the effective command line + /// Returns the string to be used as a package root /// - ///the string to be used in the effective command line + ///the string to be used as a package root member AsString : unit -> System.String end /// - /// Corresponds to the values after `-- ` on the command line + /// Corresponds to a collection of cobertura package source roots /// [] type Packages = @@ -148,9 +148,9 @@ namespace AltCoverFake.DotNet.Testing | NoPackage with /// - /// Returns the strings to be used in the effective command line + /// Returns the strings to be used to be used as package roots /// - ///the strings to be used in the effective command line + ///the strings to be used as package roots member AsStrings : unit -> seq end // ``` @@ -570,7 +570,6 @@ namespace AltCoverFake.DotNet.Testing //The members correspond to the like-named command line options for `AltCover`, except //* `ExposeReturnCode` being the converse of the `dropReturnCode` option //* `CommandLine` being the material after a `-- ` -//* `SingleVisit` being the name for `--single` // // ``` /// @@ -672,9 +671,9 @@ namespace AltCoverFake.DotNet.Testing /// MethodPoint: Flag /// - /// Corresponds to command line option `--single` + /// Corresponds to command line option `--all` /// - SingleVisit: Flag + All: Flag /// /// Corresponds to command line option `--linecover` /// @@ -696,9 +695,9 @@ namespace AltCoverFake.DotNet.Testing /// SourceLink: Flag /// - /// Corresponds to command line option `--defer` + /// Corresponds to command line option `--eager` /// - Defer: Flag + Eager: Flag /// /// Corresponds to command line option `-l, --localSource` /// diff --git a/AltCover.Engine/Visitor.fs b/AltCover.Engine/Visitor.fs index ad07d0022..c6e2ce833 100644 --- a/AltCover.Engine/Visitor.fs +++ b/AltCover.Engine/Visitor.fs @@ -267,6 +267,9 @@ module internal KeyStore = type internal Fix<'T> = delegate of 'T -> Fix<'T> [] +[] module internal CoverageParameters = let internal hash = System.Security.Cryptography.SHA256.Create() @@ -303,22 +306,22 @@ module internal CoverageParameters = let internal coalesceBranches = ref false // ddFlag let internal local = ref false // ddFlag - let mutable internal single = false // more complicated + let mutable internal all = false // more complicated let internal sampling () = - (if single then - Sampling.Single + (if all then + Sampling.All else - Sampling.All) + Sampling.Single) |> int let internal sourcelink = ref false // ddFlag - let internal defer = ref false + let internal eager = ref false let internal trivia = ref false let internal portable = ref false - let internal deferOpCode () = - if defer.Value then + let internal eagerOpCode () = + if eager.Value then OpCodes.Ldc_I4_1 else OpCodes.Ldc_I4_0 @@ -1725,18 +1728,24 @@ module internal Visitor = "InstantiateArgumentExceptionCorrectlyRule", Scope = "member", // MethodDefinition Target = - "AltCover.Visitor/I/finish@1263::Invoke(Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Collections.FSharpList`1)", + "AltCover.Visitor/I/start@1263::Invoke(Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Collections.FSharpList`1)", Justification = "Inlined library code")>] [] [] +[,Microsoft.FSharp.Collections.FSharpList`1)", Justification = "Inlined library code")>] () \ No newline at end of file diff --git a/AltCover.Expecto.Tests/AltCover.Expecto.Tests.fsproj b/AltCover.Expecto.Tests/AltCover.Expecto.Tests.fsproj index b8c23a3b5..91b36b147 100644 --- a/AltCover.Expecto.Tests/AltCover.Expecto.Tests.fsproj +++ b/AltCover.Expecto.Tests/AltCover.Expecto.Tests.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 DEBUG;TRACE;EXPECTO_MAIN false diff --git a/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs b/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs index 329be3622..b6144ebd8 100644 --- a/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs +++ b/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs @@ -113,13 +113,13 @@ module AltCoverCommand = Save = a.Save ZipFile = a.ZipFile MethodPoint = a.MethodPoint - SingleVisit = a.SingleVisit + All = a.All LineCover = a.LineCover BranchCover = a.BranchCover CommandLine = args |> toSeq ExposeReturnCode = a.ExposeReturnCode SourceLink = a.SourceLink - Defer = a.Defer + Eager = a.Eager LocalSource = a.LocalSource VisibleBranches = a.VisibleBranches ShowStatic = a.ShowStatic diff --git a/AltCover.Fake/Fake.fs b/AltCover.Fake/Fake.fs index 521d5f93c..cde0e2875 100644 --- a/AltCover.Fake/Fake.fs +++ b/AltCover.Fake/Fake.fs @@ -152,6 +152,11 @@ module DotNet = Scope = "type", Target = "AltCoverFake.DotNet.Testing.DotNet", Justification = "That's life I'm afraid")>] +[] #endif [ - + all runtime; build; native; contentfiles; analyzers diff --git a/AltCover.Monitor.Tests/AltCover.Monitor.Tests.fsproj b/AltCover.Monitor.Tests/AltCover.Monitor.Tests.fsproj index e9d264f69..c27275b11 100644 --- a/AltCover.Monitor.Tests/AltCover.Monitor.Tests.fsproj +++ b/AltCover.Monitor.Tests/AltCover.Monitor.Tests.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 false AltCover.Monitor.Tests false diff --git a/AltCover.Monitor.Tests/MonitorTest.fs b/AltCover.Monitor.Tests/MonitorTest.fs index 6997a9dd9..4d7ab0d3c 100644 --- a/AltCover.Monitor.Tests/MonitorTest.fs +++ b/AltCover.Monitor.Tests/MonitorTest.fs @@ -16,7 +16,7 @@ module MonitorTests = [ (261, 0) ] // 0 because NCover format Path.Combine( AltCover.SolutionRoot.location, - "_Reports/MonitorTestWithAltCoverCoreRunner.net8.0.xml" + "_Reports/MonitorTestWithAltCoverCoreRunner.net9.0.xml" ), [ (260, 37); (260, 36) ] ] |> List.filter (fst >> File.Exists) diff --git a/AltCover.Monitor/Monitor.cs b/AltCover.Monitor/Monitor.cs index bbf4bc0e9..85c472eac 100644 --- a/AltCover.Monitor/Monitor.cs +++ b/AltCover.Monitor/Monitor.cs @@ -214,7 +214,7 @@ internal static PointCount CountVisitPoints(XmlDocument doc) /// /// The visited point counts if running under AltCover coverage /// True if running under AltCover coverage - /// Current implementation requires `dotnet test`, or other command-line testing with `--defer` set, in which the cumulative visit numbers are available, rather than everything having been dumped to file instead. + /// Current implementation requires `dotnet test`, or other command-line testing with `--eager` NOT set, in which the cumulative visit numbers are available, rather than everything having been dumped to file instead. public static bool TryGetVisitTotals(out PointCount totals) { var counter = TypeInstance("Counter"); diff --git a/AltCover.PowerShell/Accelerator.fs b/AltCover.PowerShell/Accelerator.fs index b10a78210..98d52d7c3 100644 --- a/AltCover.PowerShell/Accelerator.fs +++ b/AltCover.PowerShell/Accelerator.fs @@ -92,7 +92,10 @@ type AddAcceleratorCommand() = let sma = env - |> Seq.find (fun a -> a.GetName().Name = "System.Management.Automation") + |> Seq.find (fun a -> + a + .GetName() + .Name.Equals("System.Management.Automation", StringComparison.Ordinal)) let acceleratorsType = sma.GetType("System.Management.Automation.TypeAccelerators") @@ -119,10 +122,10 @@ type AddAcceleratorCommand() = finalmap |> Seq.filter (fun kv -> (((self.Accelerator.IsPresent - && kv.Key = "accelerators" + && kv.Key.Equals("accelerators", StringComparison.Ordinal) && kv.Value = acceleratorsType) || (self.XDocument.IsPresent - && kv.Key = "xdoc" + && kv.Key.Equals("xdoc", StringComparison.Ordinal) && kv.Value = typeof)) |> not)) |> Seq.map (fun kv -> sprintf "%A = %A" kv.Key kv.Value.FullName) @@ -176,7 +179,10 @@ type GetAcceleratorCommand() = let sma = env - |> Seq.find (fun a -> a.GetName().Name = "System.Management.Automation") + |> Seq.find (fun a -> + a + .GetName() + .Name.Equals("System.Management.Automation", StringComparison.Ordinal)) let acceleratorsType = sma.GetType("System.Management.Automation.TypeAccelerators") diff --git a/AltCover.PowerShell/AltCover.PowerShell.fsproj b/AltCover.PowerShell/AltCover.PowerShell.fsproj index 014c999b5..ce90ef0ab 100644 --- a/AltCover.PowerShell/AltCover.PowerShell.fsproj +++ b/AltCover.PowerShell/AltCover.PowerShell.fsproj @@ -35,19 +35,6 @@ contentfiles - - - ..\ThirdParty\cecil\Mono.Cecil.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Rocks.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Mdb.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Pdb.dll - diff --git a/AltCover.PowerShell/Command.fs b/AltCover.PowerShell/Command.fs index 08274048e..ebff89c60 100644 --- a/AltCover.PowerShell/Command.fs +++ b/AltCover.PowerShell/Command.fs @@ -519,7 +519,7 @@ type InvokeAltCoverCommand() = Mandatory = false, ValueFromPipeline = false, ValueFromPipelineByPropertyName = false)>] - member val Single: SwitchParameter = SwitchParameter(false) with get, set + member val All: SwitchParameter = SwitchParameter(false) with get, set /// /// Do not record branch coverage. Is not compatible with the -ReportFormat "ncover" option. Incompatible with `-BranchCover`. @@ -572,13 +572,13 @@ type InvokeAltCoverCommand() = member val SourceLink: SwitchParameter = SwitchParameter(false) with get, set /// - /// Defers writing runner-mode coverage data until process exit. + /// Write runner-mode coverage data immediately. /// [] - member val Defer: SwitchParameter = SwitchParameter(false) with get, set + member val Eager: SwitchParameter = SwitchParameter(false) with get, set /// /// Don't instrument code for which the source file is not present. @@ -726,13 +726,13 @@ type InvokeAltCoverCommand() = Save = self.Save.IsPresent ZipFile = self.ZipFile.IsPresent MethodPoint = self.MethodPoint.IsPresent - SingleVisit = self.Single.IsPresent + All = self.All.IsPresent LineCover = self.LineCover.IsPresent BranchCover = self.BranchCover.IsPresent CommandLine = self.CommandLine ExposeReturnCode = not self.DropReturnCode.IsPresent SourceLink = self.SourceLink.IsPresent - Defer = self.Defer.IsPresent + Eager = self.Eager.IsPresent LocalSource = self.LocalSource.IsPresent VisibleBranches = self.VisibleBranches.IsPresent ShowStatic = showStatic.[self.ShowStatic |> int] diff --git a/AltCover.PowerShell/CoverageFormats.fs b/AltCover.PowerShell/CoverageFormats.fs index db91836bd..4f0111f95 100644 --- a/AltCover.PowerShell/CoverageFormats.fs +++ b/AltCover.PowerShell/CoverageFormats.fs @@ -249,7 +249,7 @@ type ConvertToCoberturaCommand() = member val OutputFile: string = String.Empty with get, set /// - /// Output as file path + /// Package source roots /// [ self.WriteObject finally Directory.SetCurrentDirectory here -#endif \ No newline at end of file +#endif + +[] +() \ No newline at end of file diff --git a/AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj b/AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj index 3a8a34a7d..e62fcb29d 100644 --- a/AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj +++ b/AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 false AltCover.Recorder.Tests false diff --git a/AltCover.Recorder/Recorder.cs b/AltCover.Recorder/Recorder.cs index d7c35a4d3..c4ae77757 100644 --- a/AltCover.Recorder/Recorder.cs +++ b/AltCover.Recorder/Recorder.cs @@ -53,10 +53,10 @@ internal static string CanonicalPath(string path) /// Gets whether to defer output until process exit /// This property's IL code is modified to store the actual value /// - public static bool Defer + public static bool Eager { [MethodImpl(MethodImplOptions.NoInlining)] - get { return false; } + get { return true; } } /// @@ -688,7 +688,7 @@ internal static void VisitImpl(string moduleId, int hitPointId, Track context) (Sample == Sampling.All || TakeSample(Sample, moduleId, hitPointId, context)) { - if (Defer || supervision || !Trace.IsConnected) + if (!Eager || supervision || !Trace.IsConnected) { AddVisit(moduleId, hitPointId, context); } diff --git a/AltCover.Recorder/Recorder.fs b/AltCover.Recorder/Recorder.fs index 88d975734..6a0fcbd56 100644 --- a/AltCover.Recorder/Recorder.fs +++ b/AltCover.Recorder/Recorder.fs @@ -40,7 +40,7 @@ module Instance = /// This property's IL code is modified to store the actual value /// [] - let Defer = false + let Eager = false /// /// Gets the style of the associated report @@ -423,7 +423,7 @@ module Instance = || takeSample Sample moduleId hitPointId context) then let adder = - if Defer || supervision || (trace.IsConnected |> not) then + if !Eager || supervision || (trace.IsConnected |> not) then addVisit else traceVisit diff --git a/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj b/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj index 425492cfc..1b89d6dd4 100644 --- a/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj +++ b/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 false AltCover.Recorder2.Tests false diff --git a/AltCover.Tests/AltCover.Tests.fsproj b/AltCover.Tests/AltCover.Tests.fsproj index acb1eddf4..2b23c19cf 100644 --- a/AltCover.Tests/AltCover.Tests.fsproj +++ b/AltCover.Tests/AltCover.Tests.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 false AltCover.Tests MONO diff --git a/AltCover.Tests/AltCover.Usage.txt b/AltCover.Tests/AltCover.Usage.txt index cb07e794b..d23156c8f 100644 --- a/AltCover.Tests/AltCover.Usage.txt +++ b/AltCover.Tests/AltCover.Usage.txt @@ -81,9 +81,8 @@ --methodpoint Optional: record only whether a method has been visited or not. Overrides the --linecover and -- branchcover options. - --single Optional: only record the first hit at any - location, or first hit for each context if -- - callContext is operating. + --all Optional: record every hit at any location, and + for each context if --callContext is operating. --linecover Optional: Do not record branch coverage. Ignored for the --reportFormat=NCover option. Incompatible with --branchcover. @@ -94,8 +93,8 @@ from a launched process. --sourcelink Optional: Display sourcelink URLs rather than file paths if present. - --defer Optional, defers writing runner-mode coverage data - until process exit. + --eager Optional, writes runner-mode coverage data + immediately. -v, --visibleBranches Optional: Hide complex internal IL branching implementation details in switch/match constructs, and just show what the source level diff --git a/AltCover.Tests/Expecto.fs b/AltCover.Tests/Expecto.fs index 5a6d137b2..30842a39b 100644 --- a/AltCover.Tests/Expecto.fs +++ b/AltCover.Tests/Expecto.fs @@ -792,9 +792,9 @@ module ExpectoTestManifest = Tests.AltCoverTests3.ParsingSaveGivesSave, "Tests3.ParsingSaveGivesSave" Tests.AltCoverTests3.ParsingMultipleSaveGivesFailure, "Tests3.ParsingMultipleSaveGivesFailure" - Tests.AltCoverTests3.ParsingSingleGivesSingle, "Tests3.ParsingSingleGivesSingle" - Tests.AltCoverTests3.ParsingMultipleSingleGivesFailure, - "Tests3.ParsingMultipleSingleGivesFailure" + Tests.AltCoverTests3.ParsingAllGivesAll, "Tests3.ParsingAllGivesAll" + Tests.AltCoverTests3.ParsingMultipleAllGivesFailure, + "Tests3.ParsingMultipleAllGivesFailure" Tests.AltCoverTests3.ParsingLineCoverGivesLineCover, "Tests3.ParsingLineCoverGivesLineCover" Tests.AltCoverTests3.OpenCoverIsCompatibleWithLineCover, @@ -818,9 +818,9 @@ module ExpectoTestManifest = Tests.AltCoverTests3.ParsingDropGivesDrop, "Tests3.ParsingDropGivesDrop" Tests.AltCoverTests3.ParsingMultipleDropGivesFailure, "Tests3.ParsingMultipleDropGivesFailure" - Tests.AltCoverTests3.ParsingDeferWorks, "Tests3.ParsingDeferWorks" - Tests.AltCoverTests3.ParsingMultipleDeferGivesFailure, - "Tests3.ParsingMultipleDeferGivesFailure" + Tests.AltCoverTests3.ParsingEagerWorks, "Tests3.ParsingEagerWorks" + Tests.AltCoverTests3.ParsingMultipleEagerGivesFailure, + "Tests3.ParsingMultipleEagerGivesFailure" Tests.AltCoverTests3.ParsingStaticGivesStatic, "Tests3.ParsingStaticGivesStatic" Tests.AltCoverTests3.ParsingStaticPlusGivesStatic, "Tests3.ParsingStaticPlusGivesStatic" diff --git a/AltCover.Tests/Runner.Tests.fs b/AltCover.Tests/Runner.Tests.fs index 66eef823e..5de4a3263 100644 --- a/AltCover.Tests/Runner.Tests.fs +++ b/AltCover.Tests/Runner.Tests.fs @@ -2267,7 +2267,7 @@ module AltCoverRunnerTests = let path = Path.Combine( SolutionRoot.location, - "_Binaries/Sample12/Debug+AnyCPU/net8.0/Sample12.dll" + "_Binaries/Sample12/Debug+AnyCPU/net9.0/Sample12.dll" ) #endif diff --git a/AltCover.Tests/Tests.fs b/AltCover.Tests/Tests.fs index 9f6b70ccc..bd45b0f0a 100644 --- a/AltCover.Tests/Tests.fs +++ b/AltCover.Tests/Tests.fs @@ -72,7 +72,7 @@ module AltCoverTests = #if !NET472 let dir = - Path.Combine(SolutionDir(), "_Binaries/AltCover.Tests/Debug+AnyCPU/net8.0") + Path.Combine(SolutionDir(), "_Binaries/AltCover.Tests/Debug+AnyCPU/net9.0") #else let dir = Path.Combine(SolutionDir(), "_Binaries/AltCover.Tests/Debug+AnyCPU/net472") @@ -85,15 +85,22 @@ module AltCoverTests = Path.Combine(SolutionDir(), "_Binaries/Sample1/Debug+AnyCPU/net20/Sample1.exe") #if !NET472 + let sample2path = + Path.Combine(SolutionDir(), "_Binaries/Sample2/Debug+AnyCPU/net9.0/Sample2.dll") + let sample4path = - Path.Combine(SolutionDir(), "_Binaries/Sample4/Debug+AnyCPU/net8.0/Sample4.dll") + Path.Combine(SolutionDir(), "_Binaries/Sample4/Debug+AnyCPU/net9.0/Sample4.dll") let sample8path = - Path.Combine(SolutionDir(), "_Binaries/Sample8/Debug+AnyCPU/net8.0/Sample8.dll") + Path.Combine(SolutionDir(), "_Binaries/Sample8/Debug+AnyCPU/net9.0/Sample8.dll") let sample32path = - Path.Combine(SolutionDir(), "_Binaries/Sample32/Debug+AnyCPU/net8.0/Sample32.dll") + Path.Combine(SolutionDir(), "_Binaries/Sample32/Debug+AnyCPU/net9.0/Sample32.dll") + #else + let sample2path = + Path.Combine(SolutionDir(), "_Binaries/Sample2/Debug+AnyCPU/net472/Sample2.dll") + let sample4path = Path.Combine(SolutionDir(), "_Binaries/Sample4/Debug+AnyCPU/net472/Sample4.dll") @@ -910,13 +917,8 @@ module AltCoverTests = [] let CanIdentifyExcludedFSharpMethods () = - let tracer = DU.returnFoo 23 - - let location = - tracer.GetType().Assembly.Location - let sourceAssembly = - AssemblyResolver.ReadAssembly(location) + AssemblyResolver.ReadAssembly(sample2path) let direct = sourceAssembly.MainModule.Types @@ -952,10 +954,24 @@ module AltCoverTests = |> Seq.sort |> Seq.toList + let flaky = + Seq.concat [ direct; indirect; indirect2 ] + |> Seq.collect _.Methods + |> Seq.filter _.Name.Equals(".ctor") + |> Seq.filter _.DeclaringType.Name.Equals("get_MyBar@44") + |> Seq.head + + let skips = + [ ("System.Void N.DU/get_MyBar@44::.ctor(N.DU/MyUnion)", 0) + ("System.Void N.DU/MyUnion/get_MyBar@44::.ctor(N.DU/MyUnion)", 1) ] // filtered as algebraic + |> Map.ofSeq + + let skip = skips |> Map.find flaky.FullName + let expected = - [ ".ctor" - ".ctor" - "Invoke" + [ ".ctor" // "System.Void N.DU/MyClass::.ctor()"; + ".ctor" // "System.Void N.DU/get_MyBar@44::.ctor(N.DU/MyUnion)"; <= flaky + "Invoke" // "N.DU/MyUnion N.DU/get_MyBar@44::Invoke(Microsoft.FSharp.Core.Unit)"; "as_bar" "bytes" "get_MyBar" @@ -968,7 +984,11 @@ module AltCoverTests = "testMakeThing" "testMakeUnion" ] - Assert.That(pass, Is.EquivalentTo(expected), sprintf "Got sequence %A" pass) + Assert.That( + pass, + Is.EquivalentTo(expected |> List.skip skip), + sprintf "Got sequence %A" pass + ) [] let CanIdentifyExcludedCSharpAutoProperties () = @@ -1105,15 +1125,15 @@ module AltCoverTests = [] let CanSwitchSampling () = - let save = CoverageParameters.single + let save = CoverageParameters.all try - CoverageParameters.single <- true + CoverageParameters.all <- false test <@ CoverageParameters.sampling () = 1 @> - CoverageParameters.single <- false + CoverageParameters.all <- true test <@ CoverageParameters.sampling () = 0 @> finally - CoverageParameters.single <- save + CoverageParameters.all <- save [] let ValidateStaticExemption () = @@ -3334,8 +3354,8 @@ module AltCoverTests = "GetOperandType" "#ctor" ".cctor" - "get_Defer" - "set_Defer" + "get_Eager" + "set_Eager" "get_Property" "set_Property" "get_ReportFile" @@ -3389,8 +3409,8 @@ module AltCoverTests = "System.Int32 AltCover.Sample3.Class3.GetOperandType(Mono.Cecil.Cil.Instruction)" "System.Void AltCover.Sample3.Class3.#ctor()" "System.Void AltCover.Sample3.Class3..cctor()" - "System.Boolean AltCover.Sample3.Class3+Class4.get_Defer()" - "System.Void AltCover.Sample3.Class3+Class4.set_Defer(System.Boolean)" + "System.Boolean AltCover.Sample3.Class3+Class4.get_Eager()" + "System.Void AltCover.Sample3.Class3+Class4.set_Eager(System.Boolean)" "AltCover.Sample3.Class1 AltCover.Sample3.Class3+Class4.get_Property()" "System.Void AltCover.Sample3.Class3+Class4.set_Property(AltCover.Sample3.Class1)" "System.String AltCover.Sample3.Class3+Class4.get_ReportFile()" @@ -3856,7 +3876,7 @@ module AltCoverTests = Main.I.selectReportGenerator () let path = - Path.Combine(SolutionDir(), "_Binaries/Sample4/Debug+AnyCPU/net8.0/Sample4.dll") + Path.Combine(SolutionDir(), "_Binaries/Sample4/Debug+AnyCPU/net9.0/Sample4.dll") "Main" |> (Regex @@ -4166,7 +4186,7 @@ module AltCoverTests = sample4path .Replace("4", "5") .Replace("572", "472") - .Replace("net8.0", "netstandard2.0") + .Replace("net9.0", "netstandard2.0") let path6 = sample4path @@ -5898,9 +5918,9 @@ module AltCoverTests = OpenCover.reportGenerator () let sample21 = - Path.Combine(SolutionDir(), "./_Binaries/Sample21/Debug+AnyCPU/net8.0/Sample21.dll") + Path.Combine(SolutionDir(), "./_Binaries/Sample21/Debug+AnyCPU/net9.0/Sample21.dll") - Assert.That(File.Exists sample21, "Test file Sample21 for net8.0 not built") + Assert.That(File.Exists sample21, "Test file Sample21 for net9.0 not built") try "Program" @@ -5979,7 +5999,7 @@ module AltCoverTests = let path = Path.Combine( SolutionDir(), - "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.0/AltCover.Engine.dll" + "_Binaries/AltCover/Debug+AnyCPU/net8.0/AltCover.Engine.dll" ) Visitor.visit diff --git a/AltCover.Tests/Tests2.fs b/AltCover.Tests/Tests2.fs index 6f3dc66e3..725755030 100644 --- a/AltCover.Tests/Tests2.fs +++ b/AltCover.Tests/Tests2.fs @@ -723,7 +723,7 @@ module AltCoverTests2 = CoverageParameters.theReportPath <- Some unique CoverageParameters.theReportFormat <- Some AltCover.ReportFormat.OpenCover CoverageParameters.theInterval <- Some 1234567890 - CoverageParameters.single <- true + CoverageParameters.all <- false CoverageParameters.zipReport.Value <- true Assert.That( @@ -827,7 +827,7 @@ module AltCoverTests2 = finally alc.Unload() finally - CoverageParameters.single <- false + CoverageParameters.all <- false CoverageParameters.theReportPath <- save CoverageParameters.theReportFormat <- save2 CoverageParameters.theInterval <- save3 @@ -844,7 +844,7 @@ module AltCoverTests2 = ) |> Seq.iter (fun f -> maybeIOException (fun () -> File.Delete f)) - Assert.That(CoverageParameters.sampling (), Sampling.All |> int |> Is.EqualTo) + Assert.That(CoverageParameters.sampling (), Sampling.Single |> int |> Is.EqualTo) finally CoverageParameters.keys.Clear() @@ -940,7 +940,7 @@ module AltCoverTests2 = (* was IL_0000: ldarg.0 - IL_0001: ldfld bool Sample31.Class3/Class4::'k__BackingField' + IL_0001: ldfld bool Sample31.Class3/Class4::'k__BackingField' IL_0006: stloc.0 IL_0007: br IL_000c @@ -2804,7 +2804,7 @@ has been prefixed with Ldc_I4_1 (1 byte) ProgramDatabase.readSymbols def |> ignore let npath = - typeof.Assembly.Location + typeof.Assembly.Location use ndef = AssemblyResolver.ReadAssembly npath diff --git a/AltCover.Tests/Tests3.fs b/AltCover.Tests/Tests3.fs index 565810e88..b1144ea03 100644 --- a/AltCover.Tests/Tests3.fs +++ b/AltCover.Tests/Tests3.fs @@ -223,7 +223,7 @@ module AltCoverTests3 = |> Seq.sort |> Seq.toList - // dotnet test loses commandline, defer, exposereturncode, save + // dotnet test loses commandline, eager, exposereturncode, save // N/A, fixed, N/A, fixed // inplace is explicitly hard-coded testWithFallback @@ -2321,13 +2321,13 @@ module AltCoverTests3 = CoverageParameters.collect.Value <- false [] - let ParsingSingleGivesSingle () = + let ParsingAllGivesAll () = Main.init () try - CoverageParameters.single <- false + CoverageParameters.all <- false let options = Main.I.declareOptions () - let input = [| "--single" |] + let input = [| "--all" |] let parse = CommandLine.parseCommandLine input options @@ -2337,18 +2337,18 @@ module AltCoverTests3 = Assert.That(y, Is.SameAs options) Assert.That(x, Is.Empty) - Assert.That(CoverageParameters.single, Is.True) + Assert.That(CoverageParameters.all, Is.True) finally - CoverageParameters.single <- false + CoverageParameters.all <- false [] - let ParsingMultipleSingleGivesFailure () = + let ParsingMultipleAllGivesFailure () = Main.init () try - CoverageParameters.single <- false + CoverageParameters.all <- false let options = Main.I.declareOptions () - let input = [| "--single"; "--single" |] + let input = [| "--all"; "--all" |] let parse = CommandLine.parseCommandLine input options @@ -2360,10 +2360,10 @@ module AltCoverTests3 = Assert.That( CommandLine.error |> Seq.head, - Is.EqualTo "--single : specify this only once" + Is.EqualTo "--all : specify this only once" ) finally - CoverageParameters.single <- false + CoverageParameters.all <- false [] let ParsingLineCoverGivesLineCover () = @@ -2680,12 +2680,12 @@ module AltCoverTests3 = CommandLine.dropReturnCode.Value <- false [] - let ParsingDeferWorks () = + let ParsingEagerWorks () = Main.init () try let options = Main.I.declareOptions () - let input = [| "--defer" |] + let input = [| "--eager" |] let parse = CommandLine.parseCommandLine input options @@ -2695,18 +2695,18 @@ module AltCoverTests3 = Assert.That(y, Is.SameAs options) Assert.That(x, Is.Empty) - Assert.That(CoverageParameters.defer.Value) - Assert.That(CoverageParameters.deferOpCode (), Is.EqualTo OpCodes.Ldc_I4_1) + Assert.That(CoverageParameters.eager.Value) + Assert.That(CoverageParameters.eagerOpCode (), Is.EqualTo OpCodes.Ldc_I4_1) finally - CoverageParameters.defer.Value <- false + CoverageParameters.eager.Value <- false [] - let ParsingMultipleDeferGivesFailure () = + let ParsingMultipleEagerGivesFailure () = Main.init () try let options = Main.I.declareOptions () - let input = [| "--defer"; "--defer" |] + let input = [| "--eager"; "--eager" |] let parse = CommandLine.parseCommandLine input options @@ -2718,11 +2718,11 @@ module AltCoverTests3 = Assert.That( CommandLine.error |> Seq.head, - Is.EqualTo "--defer : specify this only once" + Is.EqualTo "--eager : specify this only once" ) finally - CoverageParameters.defer.Value <- false + CoverageParameters.eager.Value <- false [] let ParsingQuietWorks () = @@ -3986,8 +3986,7 @@ module AltCoverTests3 = Is.EquivalentTo [ "--reportFormat" "OpenCover" - "--save" - "--defer" ] + "--save" ] ) finally Main.effectiveMain <- save @@ -4044,8 +4043,7 @@ module AltCoverTests3 = Is.EquivalentTo( [ "--reportFormat" "OpenCover" - "--save" - "--defer" ] + "--save" ] @ q ), level @@ -4095,7 +4093,6 @@ module AltCoverTests3 = "--reportFormat" "Ncover" "--save" - "--defer" "--" "testing" "1" @@ -4138,7 +4135,6 @@ module AltCoverTests3 = "--reportFormat" "ncover" "--save" - "--defer" "--" "testing" "1" @@ -4811,7 +4807,7 @@ module AltCoverTests3 = Path.Combine( SolutionRoot.location, #if !NET472 - "_Binaries/Sample4/Debug+AnyCPU/net8.0" + "_Binaries/Sample4/Debug+AnyCPU/net9.0" ) #else "_Binaries/Sample4/Debug+AnyCPU/net472" diff --git a/AltCover.Tests/XTests.fs b/AltCover.Tests/XTests.fs index 88b7f5b3f..ed68f31b5 100644 --- a/AltCover.Tests/XTests.fs +++ b/AltCover.Tests/XTests.fs @@ -647,7 +647,7 @@ module AltCoverXTests = { Primitive.PrepareOptions.Create() with BranchCover = true LineCover = true - SingleVisit = true + All = true CallContext = [| "0" |] } let scan = @@ -662,7 +662,7 @@ module AltCoverXTests = { TypeSafe.PrepareOptions.Create() with BranchCover = TypeSafe.Flag true LineCover = TypeSafe.Flag true - SingleVisit = TypeSafe.Flag true + All = TypeSafe.Flag true CallContext = TypeSafe.Context [| TypeSafe.TimeItem 0uy |] } |> AltCover.PrepareOptions.TypeSafe @@ -677,7 +677,7 @@ module AltCoverXTests = "--reportFormat" "OpenCover" "--save" - "--single" + "--all" "--linecover" "--branchcover" ] @> @@ -758,7 +758,7 @@ module AltCoverXTests = let here = SolutionDir() let path = - Path.Combine(here, "_Binaries/Sample4/Debug+AnyCPU/net8.0") + Path.Combine(here, "_Binaries/Sample4/Debug+AnyCPU/net9.0") let key0 = Path.Combine(here, "Build/SelfTest.snk") diff --git a/AltCover.Toolkit/AltCover.Toolkit.fsproj b/AltCover.Toolkit/AltCover.Toolkit.fsproj index 3e256b994..9bf75d2d9 100644 --- a/AltCover.Toolkit/AltCover.Toolkit.fsproj +++ b/AltCover.Toolkit/AltCover.Toolkit.fsproj @@ -48,19 +48,6 @@ contentfiles - - - $(MSBuildThisFileDirectory)\..\ThirdParty\cecil\Mono.Cecil.dll - - - $(MSBuildThisFileDirectory)\..\ThirdParty\cecil\Mono.Cecil.Mdb.dll - - - $(MSBuildThisFileDirectory)\..\ThirdParty\cecil\Mono.Cecil.Pdb.dll - - - $(MSBuildThisFileDirectory)\..\ThirdParty\cecil\Mono.Cecil.Rocks.dll - diff --git a/AltCover.Toolkit/AssemblyInfo.fs b/AltCover.Toolkit/AssemblyInfo.fs index fa4bffabe..70c5c649a 100644 --- a/AltCover.Toolkit/AssemblyInfo.fs +++ b/AltCover.Toolkit/AssemblyInfo.fs @@ -10,4 +10,9 @@ open System.Diagnostics.CodeAnalysis Target = "System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute", Justification = "Injected type")>] +[] do () \ No newline at end of file diff --git a/AltCover.Toolkit/OpenCover.fs b/AltCover.Toolkit/OpenCover.fs index a8c5c1626..bf92e672a 100644 --- a/AltCover.Toolkit/OpenCover.fs +++ b/AltCover.Toolkit/OpenCover.fs @@ -1251,7 +1251,7 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove [] [] + +[.$NativeJson.#.cctor()", + Justification = "F# Compiler did this")>] () \ No newline at end of file diff --git a/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj b/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj index 22282ba33..2df253b45 100644 --- a/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj +++ b/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 false 2024.6.28.12460 ..\packages\altcode.gendarme\$(GendarmeVersion)\tools\ @@ -9,7 +9,6 @@ AltCover.ValidateGendarmeEmulation false - MSB3277 @@ -26,19 +25,7 @@ $(GendarmeToolDir)Gendarme.Rules.Maintainability.dll - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.dll - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.Mdb.dll - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.Pdb.dll - - - $(SolutionDir)\ThirdParty\cecil\Mono.Cecil.Rocks.dll - + ..\ThirdParty\Unquote.dll diff --git a/AltCover.ValidateGendarmeEmulation/Tests.fs b/AltCover.ValidateGendarmeEmulation/Tests.fs index b37472a16..f9d98a834 100644 --- a/AltCover.ValidateGendarmeEmulation/Tests.fs +++ b/AltCover.ValidateGendarmeEmulation/Tests.fs @@ -38,7 +38,7 @@ module ValidateGendarmeEmulation = let path = Path.Combine( SolutionRoot.location, - "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.0/AltCover.Engine.dll" + "_Binaries/AltCover/Debug+AnyCPU/net8.0/AltCover.Engine.dll" ) let def = diff --git a/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj b/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj index f650d4061..638530b22 100644 --- a/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj +++ b/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 false false AltCover.Tests.Visualizer @@ -33,25 +33,10 @@ + contentfiles - - - ..\ThirdParty\cecil\Mono.Cecil.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Rocks.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Mdb.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Pdb.dll - - - ..\ThirdParty\Unquote.dll - diff --git a/AltCover.Visualizer/AltCover.Visualizer3.fsproj b/AltCover.Visualizer/AltCover.Visualizer3.fsproj index 8dc6d5ba2..267619a74 100644 --- a/AltCover.Visualizer/AltCover.Visualizer3.fsproj +++ b/AltCover.Visualizer/AltCover.Visualizer3.fsproj @@ -2,8 +2,7 @@ WinExe - netcoreapp2.1;netstandard2.0 - netcoreapp2.1 + net8.0 AltCover.Visualizer AltCover.Visualizer True @@ -30,7 +29,7 @@ - + diff --git a/AltCover.Visualizer/Handler.fs b/AltCover.Visualizer/Handler.fs index d87c71c92..15dee404b 100644 --- a/AltCover.Visualizer/Handler.fs +++ b/AltCover.Visualizer/Handler.fs @@ -162,7 +162,7 @@ type internal Handler() = (messageType: AltCover.MessageType) = use md = - new MessageDialog( + new MessageDialog( // fsharplint:disable-line RedundantNewKeyword parent, DialogFlags.Modal ||| DialogFlags.DestroyWithParent, diff --git a/AltCover.Visualizer/Persistence.fs b/AltCover.Visualizer/Persistence.fs index 5c5f22ac1..c5a41117f 100644 --- a/AltCover.Visualizer/Persistence.fs +++ b/AltCover.Visualizer/Persistence.fs @@ -221,4 +221,9 @@ module internal Persistence = Target = ".$Persistence.#.cctor()", Justification = "Compiler generated")>] +[] () \ No newline at end of file diff --git a/AltCover.Visualizer/Visualizer.fs b/AltCover.Visualizer/Visualizer.fs index 91bc4faa5..dc4f63912 100644 --- a/AltCover.Visualizer/Visualizer.fs +++ b/AltCover.Visualizer/Visualizer.fs @@ -1,5 +1,7 @@ namespace AltCover +// fsharplint:disable RedundantNewKeyword + open System open System.Collections.Generic open System.IO @@ -232,6 +234,9 @@ module private Gui = [] + [] type FileOpenDialog(dialog: FileChooserDialog) = member self.Run() = dialog.SetCurrentFolder(Persistence.readFolder ()) @@ -247,6 +252,9 @@ module private Gui = [] + [] member self.InitialDirectory with set (value) = dialog.SetCurrentFolder(value) |> ignore @@ -1031,6 +1039,11 @@ module private Gui = Target = ".$Visualizer.#.cctor()", Justification = "Compiler generated")>] +[] #if NET472 [ Exe - netcoreapp2.1;netcoreapp2.0;netstandard2.0;net472 - netcoreapp2.1;netcoreapp2.0;net472 - altcover - True + net8.0;netstandard2.0;net472 + net8.0;net472 + altcover + True AltCover AltCover AltCover.ico @@ -17,17 +17,15 @@ - TRACE;DEBUG;CODE_ANALYSIS TRACE;DEBUG;CODE_ANALYSIS - TRACE;DEBUG;CODE_ANALYSIS;GLOBALTOOL - TRACE;DEBUG;CODE_ANALYSIS;GLOBALTOOL + TRACE;DEBUG;CODE_ANALYSIS;GLOBALTOOL - TRACE - TRACE;GLOBALTOOL + TRACE + TRACE;GLOBALTOOL - + PreserveNewest diff --git a/Build/Build.fsproj b/Build/Build.fsproj index 70777e580..5c234f335 100644 --- a/Build/Build.fsproj +++ b/Build/Build.fsproj @@ -26,20 +26,23 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + contentfiles + diff --git a/Build/Directory.Build.props b/Build/Directory.Build.props index 64e9ecb87..cee1f2587 100644 --- a/Build/Directory.Build.props +++ b/Build/Directory.Build.props @@ -2,7 +2,7 @@ $ Exe - net8.0 + net9.0 \ No newline at end of file diff --git a/Build/DriveApi.fs b/Build/DriveApi.fs index e5e43dda1..89651c8d2 100644 --- a/Build/DriveApi.fs +++ b/Build/DriveApi.fs @@ -65,6 +65,7 @@ module DriveApi = let prepare = AltCover.PrepareOptions.Primitive { Primitive.PrepareOptions.Create() with + All = true TypeFilter = [| "a"; "b" |] } // let t = prepare.GetType() @@ -94,6 +95,7 @@ module DriveApi = let p2 = { Primitive.PrepareOptions.Create() with LocalSource = true + All = true CallContext = [| "[Fact]"; "0" |] AssemblyFilter = [| "xunit" |] } diff --git a/Build/DriveApi.fsproj b/Build/DriveApi.fsproj index e05060d3b..72a805c43 100644 --- a/Build/DriveApi.fsproj +++ b/Build/DriveApi.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 MSB3243;NU1902,NU1903,NU1904 NU1901;NU1902;NU1903;NU1904 @@ -14,8 +14,9 @@ - - + + + \ No newline at end of file diff --git a/Build/NuGet.csproj b/Build/NuGet.csproj index fbb33f3d0..227360c79 100644 --- a/Build/NuGet.csproj +++ b/Build/NuGet.csproj @@ -17,7 +17,10 @@ all runtime; build; native; contentfiles; analyzers - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -29,6 +32,6 @@ - + \ No newline at end of file diff --git a/Build/Pester.Tests.ps1 b/Build/Pester.Tests.ps1 index 61f77a62c..d5cfd6100 100644 --- a/Build/Pester.Tests.ps1 +++ b/Build/Pester.Tests.ps1 @@ -42,15 +42,15 @@ Describe "Add-Accelerator" { Describe "Invoke-Altcover" { It "instruments and collects" { - $o = "./_Binaries/Invoke-Altcover_Sample2/Debug+AnyCPU/net8.0" + $o = "./_Binaries/Invoke-Altcover_Sample2/Debug+AnyCPU/net9.0" $x = "./_Reports/PesterFSharpTypesDotNetRunner.xml" - $i = "./_Binaries/Sample2/Debug+AnyCPU/net8.0" + $i = "./_Binaries/Sample2/Debug+AnyCPU/net9.0" if (Test-Path $o) { Remove-Item -Force -Recurse $o } if (Test-Path $x) { Remove-Item -force $x } - Invoke-AltCover -Report $x -OutputDirectory $o -InputDirectory $i -AssemblyFilter ("?Sample2", "Adapter") -ReportFormat NCover -InformationAction Continue -Verbosity Verbose + Invoke-AltCover -Report $x -OutputDirectory $o -InputDirectory $i -AssemblyFilter ("?Sample2", "Adapter") -ReportFormat NCover -All -InformationAction Continue -Verbosity Verbose $o | Should -Exist $x | Should -Exist $xm = [xml](Get-Content $x) @@ -69,7 +69,7 @@ Describe "Invoke-Altcover" { $w | Should -Be "A total of 0 visits recorded" $env:AltCoverTag = "Invoke-Altcover_" - $summary = Invoke-AltCover -InformationAction Continue -Runner -RecorderDirectory $o -WorkingDirectory "./Samples/Sample2" -Executable "dotnet" -CommandLine @("test", "--no-build", "--configuration", "Debug", "--framework", "net8.0", "Sample2.fsproj") #, "/p:AltCoverTag=Invoke-Altcover_") + $summary = Invoke-AltCover -InformationAction Continue -Runner -RecorderDirectory $o -WorkingDirectory "./Samples/Sample2" -Executable "dotnet" -CommandLine @("test", "--no-build", "--configuration", "Debug", "--framework", "net9.0", "Sample2.fsproj") #, "/p:AltCoverTag=Invoke-Altcover_") $env:AltCoverTag = "" $xm2 = [xml](Get-Content $x) $result = [string]::Join(" ", $xm2.coverage.module.method.seqpnt.visitcount) @@ -79,7 +79,7 @@ Describe "Invoke-Altcover" { } It "Fails on garbage" { - $o = "./Samples/Sample2/_Binaries/Sample2/Debug+AnyCPU/net8.0" + $o = "./Samples/Sample2/_Binaries/Sample2/Debug+AnyCPU/net9.0" $x = "./_Reports/PesterFSharpTypesDotNetRunner.xml" try { @@ -375,7 +375,7 @@ Describe "ConvertTo-BarChart" { Describe "ConvertFrom-NCover" { It "converts" { $assemblies = @() - $assemblies += "./_Binaries/Sample4/Debug+AnyCPU/net8.0/Sample4.dll" + $assemblies += "./_Binaries/Sample4/Debug+AnyCPU/net9.0/Sample4.dll" $xml = ConvertFrom-NCover -InputFile "./_Reports/ReleaseXUnitFSharpTypesDotNetRunner.xml" -Assembly $Assemblies -OutputFile "./_Packaging/AltCoverFSharpTypes.xml" $xml | Should -BeOfType [xdoc] @@ -400,10 +400,10 @@ Describe "ConvertFrom-NCover" { $expected = $expected.Replace("Sample4|Program.fs", (Join-Path $fullpath "Program.fs")) $expected = $expected.Replace("Sample4|Tests.fs", (Join-Path $fullpath "Tests.fs")) $expected = $expected.Replace("./_Binaries/Sample4/Debug+AnyCPU/net6.0/Sample4.dll", - "" + [System.IO.Path]::GetFullPath("./_Binaries/Sample4/Debug+AnyCPU/net8.0/Sample4.dll")) + "" + [System.IO.Path]::GetFullPath("./_Binaries/Sample4/Debug+AnyCPU/net9.0/Sample4.dll")) $result = $sw.ToString().Replace("`r", "").Replace("utf-16", "utf-8") - $result = $result.Replace("rapScore=`"13.12", "rapScore=`"13.13").Replace("rapScore=`"8.12", "rapScore=`"8.13") + $result = $result.Replace("rapScore=`"13.12", "rapScore=`"13.13").Replace("rapScore=`"8.12", "rapScore=`"8.13").Replace("Tests.DU/MyUnion/get_MyBa", "Tests.DU/get_MyBa") $result | Should -Be $expected.Replace("`r", "") $written = $written.Replace("rapScore=`"13.12", "rapScore=`"13.13").Replace("rapScore=`"8.12", "rapScore=`"8.13").Replace("`r", "") @@ -412,7 +412,7 @@ Describe "ConvertFrom-NCover" { It "converts from the pipeline" { $assemblies = @() - $assemblies += "./_Binaries/Sample4/Debug+AnyCPU/net8.0/Sample4.dll" + $assemblies += "./_Binaries/Sample4/Debug+AnyCPU/net9.0/Sample4.dll" $xml = [xdoc]::Load("./_Reports/ReleaseXUnitFSharpTypesDotNetRunner.xml") | ConvertFrom-NCover -Assembly $Assemblies $xml | Should -BeOfType [xdoc] @@ -437,10 +437,10 @@ Describe "ConvertFrom-NCover" { $expected = $expected.Replace("Sample4|Program.fs", (Join-Path $fullpath "Program.fs")) $expected = $expected.Replace("Sample4|Tests.fs", (Join-Path $fullpath "Tests.fs")) $expected = $expected.Replace("./_Binaries/Sample4/Debug+AnyCPU/net6.0/Sample4.dll", - "" + [System.IO.Path]::GetFullPath("./_Binaries/Sample4/Debug+AnyCPU/net8.0/Sample4.dll")) + "" + [System.IO.Path]::GetFullPath("./_Binaries/Sample4/Debug+AnyCPU/net9.0/Sample4.dll")) $result = $sw.ToString().Replace("`r", "").Replace("utf-16", "utf-8") - $result = $result.Replace("rapScore=`"13.12", "rapScore=`"13.13").Replace("rapScore=`"8.12", "rapScore=`"8.13") + $result = $result.Replace("rapScore=`"13.12", "rapScore=`"13.13").Replace("rapScore=`"8.12", "rapScore=`"8.13").Replace("Tests.DU/MyUnion/get_MyBa", "Tests.DU/get_MyBa") $result | Should -Be $expected.Replace("`r", "") } diff --git a/Build/Setup.fsproj b/Build/Setup.fsproj index 7b878a431..bae77245b 100644 --- a/Build/Setup.fsproj +++ b/Build/Setup.fsproj @@ -11,11 +11,11 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/Build/actions.fs b/Build/actions.fs index 256ba1079..33ccfe975 100644 --- a/Build/actions.fs +++ b/Build/actions.fs @@ -578,6 +578,7 @@ a:hover {color: #ecc;} coverageDocument.Descendants(XName.Get("Method")) |> Seq.collect _.Descendants(XName.Get("Name")) |> Seq.map _.Value.Replace("Tests.Program", "Program/Program") + |> Seq.map _.Replace("Tests.DU/MyUnion/get_MyBar", "Tests.DU/get_MyBar") // flaky |> Seq.sort |> Seq.toList diff --git a/Build/build.cake b/Build/build.cake index fad34dd60..71ed7e805 100644 --- a/Build/build.cake +++ b/Build/build.cake @@ -37,6 +37,7 @@ Task("Build") public override System.Diagnostics.TraceLevel Verbosity => System.Diagnostics.TraceLevel.Verbose; public override string Report => "coverage.build.cake." + CakeVersion +".xml"; public override string OutputRoot => System.IO.Path.GetFullPath($"../_Binaries/cake_dotnettest/OutputRoot"); + public override bool All => true; } Task("Test") diff --git a/Build/merge-coverage.ps1 b/Build/merge-coverage.ps1 index 1ac30a92f..f701289c1 100644 --- a/Build/merge-coverage.ps1 +++ b/Build/merge-coverage.ps1 @@ -1,12 +1,12 @@ -Import-Module "./_Packaging/Unpack/tools/netcoreapp2.0/AltCover.PowerShell.dll" +Import-Module "./_Packaging/Unpack/tools/net8.0/AltCover.PowerShell.dll" $files = ("_Reports/UnitTestWithAltCoverCoreRunner.xml", - "_Reports/ApiTestWithAltCoverCoreRunner.net8.0.xml", - "_Reports/MonitorTestWithAltCoverCoreRunner.net8.0.xml", - "_Reports/RecorderTestWithAltCoverCoreRunner.net8.0.xml", "_Reports/Recorder2TestWithAltCoverCoreRunner.xml", - "_Reports/ValidateGendarmeEmulationUnitTestWithAltCoverCoreRunner.net8.0.xml", + "_Reports/ApiTestWithAltCoverCoreRunner.net9.0.xml", + "_Reports/MonitorTestWithAltCoverCoreRunner.net9.0.xml", + "_Reports/RecorderTestWithAltCoverCoreRunner.net9.0.xml", + "_Reports/ValidateGendarmeEmulationUnitTestWithAltCoverCoreRunner.net9.0.xml", "_Reports/Pester.xml" ) $xml = $files | Merge-OpenCover -OutputFile "_Reports/CombinedTestWithAltCoverRunner.coveralls" \ No newline at end of file diff --git a/Build/msbuildtest.proj b/Build/msbuildtest.proj index 0d611d22f..519f35456 100644 --- a/Build/msbuildtest.proj +++ b/Build/msbuildtest.proj @@ -1,18 +1,18 @@ + AssemblyFile="$(MSBuildThisFileDirectory)../_Packaging/Unpack/tools/net8.0/AltCover.Engine.dll" /> + AssemblyFile="$(MSBuildThisFileDirectory)../_Packaging/Unpack/tools/net8.0/AltCover.Engine.dll" /> - - + + - + - + + RecorderDirectory="$(MSBuildThisFileDirectory)../_Binaries/$(AltCoverTag)Sample4/Debug+AnyCPU/net9.0" /> \ No newline at end of file diff --git a/Build/prepareDocumentation.ps1 b/Build/prepareDocumentation.ps1 index 9428b9791..13b984a95 100644 --- a/Build/prepareDocumentation.ps1 +++ b/Build/prepareDocumentation.ps1 @@ -348,8 +348,6 @@ or, for the global tool only * valid arguments for ``--teamcity`` are ``B``, ``R``, ``+B``, ``+R`` or nothing at all (same as ``B``). The letter indicates which symbol to use in the TeamCity format for branch coverage (``B`` is for ``Block``, which by experiment did show in the build report, and ``R`` is for ``bRanch`` which is documented, but did not show when I tried it), the optional ``+`` indicates that the OpenCover summary should also be emitted. -* valid arguments for ``--defer`` are ``+``, ``-`` or nothing at all (same as ``+``). ``+`` keeps coverage data in memory until process exit, ``-`` writes promptly to file in runner mode, i.e. acts as in previous releases since 1.6). - * ``ImportModule`` will print a string on Mono/non-Windows, but Windows PowerShell won't be there to make use of it. #### ``-e`` vs ``-s`` : what gives? diff --git a/Build/targets.fs b/Build/targets.fs index 323d39985..95f8d373f 100644 --- a/Build/targets.fs +++ b/Build/targets.fs @@ -39,21 +39,6 @@ module Targets = let mutable Copyright = String.Empty let mutable Version = String.Empty - let localCecil = - let xml = - "./Directory.Build.props" - |> Path.getFullName - |> XDocument.Load - - xml.Descendants() - |> Seq.filter (fun (e: XElement) -> - e.Name.LocalName.Equals("LocalCecil", StringComparison.OrdinalIgnoreCase)) - |> Seq.map (fun x -> x.Value |> Boolean.TryParse |> snd) - |> Seq.tryLast - |> Option.defaultValue false - - printfn "Local Cecil = %A" localCecil - let currentBranch = "." |> Path.getFullName @@ -444,7 +429,7 @@ module Targets = >> common ) with NoBuild = true - Framework = fwk // Some "net8.0" + Framework = fwk // Some "net9.0" Configuration = DotNet.BuildConfiguration.Debug } let defaultDotNetTestCommandLine fwk project = @@ -466,7 +451,7 @@ module Targets = Configuration = DotNet.BuildConfiguration.Debug ResultsDirectory = Some report NoBuild = true - Framework = Some "net8.0" + Framework = Some "net9.0" Settings = Some "./_Generated/coverletArgs.runsettings" Collect = Some "XPlat Code Coverage" } |> (testWithCLITaggedArguments tag) @@ -600,13 +585,7 @@ module Targets = let dotnetBuildDebug proj = DotNet.build (fun p -> - { p.WithCommon( - dotnetOptions - >> dotnetOptionsWithSkipGtkInstall - >> (fun o -> - { o with - Verbosity = Some DotNet.Verbosity.Minimal }) - ) with + { p.WithCommon(dotnetOptions >> dotnetOptionsWithSkipGtkInstall) with Configuration = DotNet.BuildConfiguration.Debug } |> buildWithCLIArguments) (Path.GetFullPath proj) @@ -672,21 +651,6 @@ module Targets = Information.showName "." commitHash printfn "Build at %A" infoV - - // let hash = System.Security.Cryptography.SHA256.Create() - - // let formatSecret (s : string) = - // if s |> isNull - // then "(null)" - // else if String.IsNullOrEmpty s - // then "(empty)" - // else if String.IsNullOrWhiteSpace s - // then "(whitespace)" - // else s - // |> System.Text.Encoding.UTF8.GetBytes - // |> hash.ComputeHash - // |> Convert.ToBase64String - //---------------------------------------------------------------- let _Target s f = @@ -997,7 +961,7 @@ module Targets = "./Samples/Sample28/SourceGenerators.sln" ] |> Seq.iter dotnetBuildDebug - Shell.copy "./_SourceLink" (!! "./_Binaries/Sample14/Debug+AnyCPU/net8.0/*")) + Shell.copy "./_SourceLink" (!! "./_Binaries/Sample14/Debug+AnyCPU/net9.0/*")) let BuildMonoSamples = (fun () -> @@ -1082,16 +1046,19 @@ module Targets = let failOnIssuesFound (issuesFound: bool) = Assert.That(issuesFound, Is.False, "Lint issues were found") - [ !! "./**/*.fsproj" + [ !! "./**/*.fs" |> Seq.sortBy (Path.GetFileName) |> Seq.filter (fun f -> ((f.Contains demo) + || (f.Contains "AltCover.Recorder") // obsolete || (f.Contains regress) || (f.Contains underscore) || (f.Contains sample)) |> not) !! "./Build/*.fsx" |> Seq.map Path.GetFullPath ] |> Seq.concat + // |> Seq.map (fun f -> printfn "Linting %A" f + // (doLint f).ExitCode) |> Seq.map doLintAsync |> throttle |> Async.RunSynchronously @@ -1143,10 +1110,10 @@ module Targets = [ "_Binaries/AltCover.Engine/Debug+AnyCPU/netstandard2.0/AltCover.Engine.dll" "_Binaries/AltCover.Base/Debug+AnyCPU/netstandard2.0/AltCover.Base.dll" ]) ("./Build/build-rules.xml", - [ "$Binaries/Setup/Debug+AnyCPU/net8.0/Setup.dll" - "$Binaries/Build/Debug+AnyCPU/net8.0/Build.dll" ]) + [ "$Binaries/Setup/Debug+AnyCPU/net9.0/Setup.dll" + "$Binaries/Build/Debug+AnyCPU/net9.0/Build.dll" ]) ("./Build/common-rules.xml", - [ "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.0/AltCover.dll" + [ "_Binaries/AltCover/Debug+AnyCPU/net8.0/AltCover.dll" "_Binaries/AltCover.Recorder/Debug+AnyCPU/net20/AltCover.Recorder.dll" "_Binaries/AltCover.Async/Debug+AnyCPU/net46/AltCover.Async.dll" "_Binaries/AltCover.PowerShell/Debug+AnyCPU/netstandard2.0/AltCover.PowerShell.dll" @@ -1154,22 +1121,20 @@ module Targets = "_Binaries/AltCover.DotNet/Debug+AnyCPU/netstandard2.0/AltCover.DotNet.dll" "_Binaries/AltCover.Toolkit/Debug+AnyCPU/netstandard2.0/AltCover.Toolkit.dll" "_Binaries/AltCover.UICommon/Debug+AnyCPU/netstandard2.0/AltCover.UICommon.dll" - "_Binaries/AltCover.Visualizer3/Debug+AnyCPU/netcoreapp2.1/AltCover.Visualizer.dll" // GTK3 (obsolete) - "_Binaries/AltCover.Cake/Debug+AnyCPU/netcoreapp3.1/AltCover.Cake.dll" // Cake 2+ + "_Binaries/AltCover.Visualizer3/Debug+AnyCPU/net8.0/AltCover.Visualizer.dll" // GTK3 (obsolete) + "_Binaries/AltCover.Cake/Debug+AnyCPU/net8.0/AltCover.Cake.dll" // Cake 2+ "_Binaries/AltCover.Fake.DotNet.Testing.AltCover/Debug+AnyCPU/netstandard2.0/AltCover.Fake.DotNet.Testing.AltCover.dll" ]) ("./Build/common-rules.xml", // Framework builds [ "_Binaries/AltCover/Debug+AnyCPU/net472/AltCover.exe" // framework builds "_Binaries/AltCover.Visualizer/Debug+AnyCPU/net472/AltCover.Visualizer.exe" ]) ("./Build/common-rules.xml", - [ "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.1/AltCover.dll" // global tool builds - "_Binaries/AltCover.Avalonia/Debug+AnyCPU/net5.0/AltCover.Visualizer.dll" ]) + [ "_Binaries/AltCover.Avalonia/Debug+AnyCPU/net8.0/AltCover.Visualizer.dll" ]) //("./Build/common-rules.xml", - // [ "_Binaries/AltCover.Avalonia11/Debug+AnyCPU/net5.0/AltCover.Visualizer.dll" ]) + // [ "_Binaries/AltCover.Avalonia11/Debug+AnyCPU/net8.0/AltCover.Visualizer.dll" ]) ("./Build/csharp-rules.xml", [ "_Binaries/AltCover.DataCollector/Debug+AnyCPU/netstandard2.0/AltCover.DataCollector.dll" "_Binaries/AltCover.Monitor/Debug+AnyCPU/netstandard2.0/AltCover.Local.Monitor.dll" - "_Binaries/AltCover.FontSupport/Debug+AnyCPU/netstandard2.0/AltCover.FontSupport.dll" - "_Binaries/AltCover.Cake/Debug+AnyCPU/netstandard2.0/AltCover.Cake.dll" ]) + "_Binaries/AltCover.FontSupport/Debug+AnyCPU/netstandard2.0/AltCover.FontSupport.dll" ]) ("./Build/csharp-rules.xml", // Framework builds [ "_Binaries/AltCover.Monitor/Debug+AnyCPU/net20/AltCover.Local.Monitor.dll" "_Binaries/AltCover.FontSupport/Debug+AnyCPU/net472/AltCover.FontSupport.dll" ]) ] @@ -1283,7 +1248,6 @@ module Targets = "-Microsoft.Design#CA1031" // :DoNotCatchGeneralExceptionTypes" "-Microsoft.Usage#CA2208" // :InstantiateArgumentExceptionsCorrectly" "-Microsoft.Usage#CA1801" // :ReviewUnusedParameters" - //"-Microsoft.Globalization#CA1307" // :SpecifyStringComparison" "-Microsoft.Design#CA1028" // :EnumStorageShouldBeInt32" "-Microsoft.Design#CA1002" ] // :DoNotExposeGenericLists" @@ -1368,18 +1332,12 @@ module Targets = defaultRules) (dixon, Option.get refdir, - [ // new platform "_Binaries/AltCover.Visualizer/Debug+AnyCPU/netcoreapp2.1/AltCover.Visualizer.dll" // GTK3 - "_Binaries/AltCover.Visualizer3/Debug+AnyCPU/netstandard2.0/AltCover.Visualizer.dll" // surrogate for above - "_Binaries/AltCover.PowerShell/Debug+AnyCPU/netstandard2.0/AltCover.PowerShell.dll" - "_Binaries/AltCover.Fake/Debug+AnyCPU/netstandard2.0/AltCover.Fake.dll" - "_Binaries/AltCover.Fake.DotNet.Testing.AltCover/Debug+AnyCPU/netstandard2.0/AltCover.Fake.DotNet.Testing.AltCover.dll" ], + [ "_Binaries/AltCover.PowerShell/Debug+AnyCPU/netstandard2.0/AltCover.PowerShell.dll" ], [], defaultRules) (dixon, Option.get refdir, - [ "_Binaries/AltCover.FontSupport/Debug+AnyCPU/netstandard2.0/AltCover.FontSupport.dll" - // new platform "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.0/AltCover.dll" // same as net472 - "_Binaries/AltCover.DataCollector/Debug+AnyCPU/netstandard2.0/AltCover.DataCollector.dll" ], + [ "_Binaries/AltCover.FontSupport/Debug+AnyCPU/netstandard2.0/AltCover.FontSupport.dll" ], [], minimalRules) (dixon, @@ -1387,16 +1345,6 @@ module Targets = [ "_Binaries/AltCover/Debug+AnyCPU/netstandard2.0/AltCover.dll" ], // new platform "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.1/AltCover.dll" [], minimalRules) - // (dixon, // new platform - // Option.get refdir, - // [ // new platform "_Binaries/AltCover.Avalonia/Debug+AnyCPU/net5.0/AltCover.Visualizer.dll" // Avalonia - // // GetReaderForFile returned an unexpected HResult: 0x80004005. // same at net472 if built thus - // "_Binaries/AltCover.Avalonia/Debug+AnyCPU/net5.0/AltCover.Visualizer.dll" ], [], defaultRules) - (dixon, - Option.get refdir, - [ "_Binaries/AltCover.Cake/Debug+AnyCPU/netstandard2.0/AltCover.Cake.dll" ], - [], - defaultCSharpRules) (dixon, Option.get refdir, [ "_Binaries/AltCover.UICommon/Debug+AnyCPU/netstandard2.0/AltCover.UICommon.dll" @@ -1407,8 +1355,7 @@ module Targets = defaultRules) (dixon, Option.get refdir, - [ "_Binaries/AltCover.Base/Debug+AnyCPU/netstandard2.0/AltCover.Base.dll" - "_Binaries/AltCover.Engine/Debug+AnyCPU/netstandard2.0/AltCover.Engine.dll" ], + [ "_Binaries/AltCover.Base/Debug+AnyCPU/netstandard2.0/AltCover.Base.dll" (*"_Binaries/AltCover.Engine/Debug+AnyCPU/netstandard2.0/AltCover.Engine.dll"*) ], [], List.concat [ defaultRules @@ -1440,11 +1387,11 @@ module Targets = nugetCache @@ "cake.common/" + (ddItem "cake.common") - + "/lib/netstandard2.0" + + "/lib/net8.0" nugetCache @@ "cake.core/" + (ddItem "cake.core") - + "/lib/netstandard2.0" + + "/lib/net8.0" nugetCache @@ "communitytoolkit.diagnostics/" + (ddItem "communitytoolkit.diagnostics") @@ -1485,13 +1432,13 @@ module Targets = @@ "gtksharp/" + (ddItem "gtksharp") + "/lib/netstandard2.0" - if localCecil then - Path.GetFullPath "./ThirdParty/cecil" - else - nugetCache - @@ "mono.cecil/" - + (ddItem "mono.cecil") - + "/lib/netstandard2.0" + //if localCecil then + // Path.GetFullPath "./ThirdParty/cecil" + //else + nugetCache + @@ "mono.cecil/" + + (ddItem "mono.cecil") + + "/lib/netstandard2.0" nugetCache @@ "mono.options/" + (ddItem "mono.options") @@ -1540,20 +1487,10 @@ module Targets = |> Path.getFullName |> XDocument.Load - let skip = - if localCecil then - "mono.cecil" - else - "$$$$$$$" - let packages = xml.Descendants(XName.Get("PackageReference")) |> Seq.filter (_.Attribute(XName.Get("Include")) >> isNull >> not) |> Seq.map _.Attribute(XName.Get("Include")).Value - |> Seq.filter ( - _.Equals(skip, StringComparison.OrdinalIgnoreCase) - >> not - ) //CECIL |> Seq.toList let dirs = @@ -1775,7 +1712,7 @@ module Targets = DotNet.build (fun p -> { p.WithCommon dotnetOptions with Configuration = DotNet.BuildConfiguration.Debug - Framework = Some "net8.0" } + Framework = Some "net9.0" } |> (buildWithCLITaggedArguments "UnitTestDotNet")) !!(@"./*Test*/*Tests.fsproj") |> Seq.iter buildIt @@ -1793,7 +1730,7 @@ module Targets = DotNet.test (fun p -> { p.WithCommon dotnetOptions with Configuration = DotNet.BuildConfiguration.Debug - Framework = Some "net8.0" + Framework = Some "net9.0" NoBuild = true } |> (testWithCLITaggedArguments "UnitTestDotNet")) @@ -1825,7 +1762,6 @@ module Targets = Path.getFullName "./AltCover.Api.Tests/AltCover.Api.Tests.fsproj" Path.getFullName "./AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj" Path.getFullName "./AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj" - //Path.getFullName "./AltCover.Monitor.Tests/AltCover.Monitor.Tests.fsproj" Path.getFullName "./AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj" Path.getFullName "./AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj" ] // project @@ -1833,7 +1769,7 @@ module Targets = DotNet.build (fun p -> { p.WithCommon dotnetOptions with Configuration = DotNet.BuildConfiguration.Debug - Framework = Some "net8.0" } + Framework = Some "net9.0" } |> (buildWithCLITaggedArguments "Coverlet")) )) @@ -1845,7 +1781,6 @@ module Targets = let l = [ Path.getFullName "./AltCover.Expecto.Tests/AltCover.Expecto.Tests.fsproj" Path.getFullName "./AltCover.Api.Tests/AltCover.Api.Tests.fsproj" - //Path.getFullName "./AltCover.Monitor.Tests/AltCover.Monitor.Tests.fsproj" Path.getFullName "./AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj" Path.getFullName "./AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj" Path.getFullName @@ -1936,13 +1871,8 @@ module Targets = let testFiles = [ Path.getFullName "_Binaries/AltCover.Api.Tests/Debug+AnyCPU/net472/AltCover.Api.Tests.dll" - //Path.getFullName "_Binaries/AltCover.Expecto.Tests/Debug+AnyCPU/net472/AltCover.Expecto.Tests.dll" - //Path.getFullName "_Binaries/AltCover.Monitor.Tests/Debug+AnyCPU/net472/AltCover.Monitor.Tests.dll" - //Path.getFullName "_Binaries/AltCover.Recorder.Tests/Debug+AnyCPU/net472/AltCover.Recorder.Tests.dll" - //Path.getFullName "_Binaries/AltCover.Recorder2.Tests/Debug+AnyCPU/net472/AltCover.Recorder2.Tests.dll" Path.getFullName "_Binaries/AltCover.Tests/Debug+AnyCPU/net472/AltCover.Tests.dll" - //Path.getFullName "_Binaries/AltCover.Tests.Visualizer/Debug+AnyCPU/net472/AltCover.Tests.Visualizer.dll" Path.getFullName "_Binaries/AltCover.ValidateGendarmeEmulation/Debug+AnyCPU/net472/AltCover.ValidateGendarmeEmulation.dll" ] @@ -2188,6 +2118,13 @@ module Targets = // Only use let baseFilter = AltCoverFilterTypeSafe + let eager (p: TypeSafe.PrepareOptions) = + { p with + Eager = TypeSafe.Flag true + All = TypeSafe.Flag false } + + let eagerfilter = baseFilter >> eager + let tests = [ (Path.getFullName "_Binaries/AltCover.Tests/Debug+AnyCPU/net472", // test directory "./__UnitTestWithAltCoverRunner", // relative output @@ -2195,7 +2132,7 @@ module Targets = "./_Reports/UnitTestWithAltCoverRunnerReport.xml", // relative nunit reporting [ Path.getFullName // test assemblies "_Binaries/AltCover.Tests/Debug+AnyCPU/net472/__UnitTestWithAltCoverRunner/AltCover.Tests.dll" ], - baseFilter, + eagerfilter, // And single visit, too keyfile) (Path.getFullName "_Binaries/AltCover.Api.Tests/Debug+AnyCPU/net472", // test directory "./__ApiTestWithAltCoverRunner", // relative output @@ -2205,16 +2142,6 @@ module Targets = "_Binaries/AltCover.Api.Tests/Debug+AnyCPU/net472/__ApiTestWithAltCoverRunner/AltCover.Api.Tests.dll" ], baseFilter, keyfile) - // ( - // Path.getFullName "_Binaries/AltCover.Monitor.Tests/Debug+AnyCPU/net472", // test directory - // "./__MonitorTestWithAltCoverRunner", // relative output - // "MonitorTestWithAltCoverRunner.xml", // coverage report - // "./_Reports/MonitorTestWithAltCoverRunnerReport.xml", // relative nunit reporting - // [ Path.getFullName // test assemblies - // "_Binaries/AltCover.Monitor.Tests/Debug+AnyCPU/net472/__MonitorTestWithAltCoverRunner/AltCover.Monitor.Tests.dll" ], - // baseFilter, - // keyfile - // ) (Path.getFullName "_Binaries/AltCover.Visualizer.Tests/Debug+AnyCPU/net472", // test directory "./__VisualizerTestWithAltCoverRunner", // relative output "VisualizerTestWithAltCoverRunner.xml", // coverage report @@ -2262,7 +2189,7 @@ module Targets = OutputDirectories = TypeSafe.DirectoryPaths [| TypeSafe.DirectoryPath outputDirectory |] StrongNameKey = TypeSafe.FilePath signingKey - SingleVisit = TypeSafe.Set + All = TypeSafe.Set InPlace = TypeSafe.Clear //CallContext = TypeSafe.Context [ TypeSafe.TimeItem 3uy ] Save = TypeSafe.Clear } @@ -2383,50 +2310,50 @@ module Targets = let reports = Path.getFullName "./_Reports" let altcover = - Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" - let tests = // TODo monitor!not, Visualizer - [ (Path.getFullName "_Binaries/AltCover.Expecto.Tests/Debug+AnyCPU/net8.0", // testDirectory + let tests = // TODO monitor!not, Visualizer + [ (Path.getFullName "_Binaries/AltCover.Expecto.Tests/Debug+AnyCPU/net9.0", // testDirectory Path.getFullName - "_Binaries/UnitTestWithAltCoverCore_AltCover.Expecto.Tests/Debug+AnyCPU/net8.0", // output + "_Binaries/UnitTestWithAltCoverCore_AltCover.Expecto.Tests/Debug+AnyCPU/net9.0", // output reports @@ "UnitTestWithAltCoverCore.xml", // report "AltCover.Expecto.Tests.fsproj", // project Path.getFullName "AltCover.Expecto.Tests") // workingDirectory - (Path.getFullName "_Binaries/AltCover.Recorder.Tests/Debug+AnyCPU/net8.0", + (Path.getFullName "_Binaries/AltCover.Recorder.Tests/Debug+AnyCPU/net9.0", Path.getFullName - "_Binaries/UnitTestWithAltCoverCore_AltCover.Recorder.Tests/Debug+AnyCPU/net8.0", + "_Binaries/UnitTestWithAltCoverCore_AltCover.Recorder.Tests/Debug+AnyCPU/net9.0", reports @@ "RecorderTestWithAltCoverCore.xml", "AltCover.Recorder.Tests.fsproj", Path.getFullName "AltCover.Recorder.Tests") - (Path.getFullName "_Binaries/AltCover.Recorder2.Tests/Debug+AnyCPU/net8.0", + (Path.getFullName "_Binaries/AltCover.Recorder2.Tests/Debug+AnyCPU/net9.0", Path.getFullName - "_Binaries/UnitTestWithAltCoverCore_AltCover.Recorder2.Tests/Debug+AnyCPU/net8.0", + "_Binaries/UnitTestWithAltCoverCore_AltCover.Recorder2.Tests/Debug+AnyCPU/net9.0", reports @@ "Recorder2TestWithAltCoverCore.xml", "AltCover.Recorder2.Tests.fsproj", Path.getFullName "AltCover.Recorder2.Tests") - (Path.getFullName "_Binaries/AltCover.Api.Tests/Debug+AnyCPU/net8.0", // testDirectory + (Path.getFullName "_Binaries/AltCover.Api.Tests/Debug+AnyCPU/net9.0", // testDirectory Path.getFullName - "_Binaries/UnitTestWithAltCoverCore_AltCover.Api.Tests/Debug+AnyCPU/net8.0", // output + "_Binaries/UnitTestWithAltCoverCore_AltCover.Api.Tests/Debug+AnyCPU/net9.0", // output reports @@ "ApiUnitTestWithAltCoverCore.xml", // report "AltCover.Api.Tests.fsproj", // project Path.getFullName "AltCover.Api.Tests") // workingDirectory - (Path.getFullName "_Binaries/AltCover.Monitor.Tests/Debug+AnyCPU/net8.0", // testDirectory + (Path.getFullName "_Binaries/AltCover.Monitor.Tests/Debug+AnyCPU/net9.0", // testDirectory Path.getFullName - "_Binaries/UnitTestWithAltCoverCore_AltCover.Monitor.Tests/Debug+AnyCPU/net8.0", // output + "_Binaries/UnitTestWithAltCoverCore_AltCover.Monitor.Tests/Debug+AnyCPU/net9.0", // output reports @@ "MonitorTestWithAltCoverCore.xml", // report "AltCover.Monitor.Tests.fsproj", // project Path.getFullName "AltCover.Monitor.Tests") // workingDirectory - (Path.getFullName "_Binaries/AltCover.Visualizer.Tests/Debug+AnyCPU/net8.0", // testDirectory + (Path.getFullName "_Binaries/AltCover.Visualizer.Tests/Debug+AnyCPU/net9.0", // testDirectory Path.getFullName - "_Binaries/UnitTestWithAltCoverCore_AltCover.Visualizer.Tests/Debug+AnyCPU/net8.0", // output + "_Binaries/UnitTestWithAltCoverCore_AltCover.Visualizer.Tests/Debug+AnyCPU/net9.0", // output reports @@ "VisualizerUnitTestWithAltCoverCore.xml", // report "AltCover.Visualizer.Tests.fsproj", // project Path.getFullName "AltCover.Visualizer.Tests") // workingDirectory (Path.getFullName - "_Binaries/AltCover.ValidateGendarmeEmulation/Debug+AnyCPU/net8.0", // testDirectory + "_Binaries/AltCover.ValidateGendarmeEmulation/Debug+AnyCPU/net9.0", // testDirectory Path.getFullName - "_Binaries/UnitTestWithAltCoverCore_AltCover.ValidateGendarmeEmulation/Debug+AnyCPU/net8.0", // output + "_Binaries/UnitTestWithAltCoverCore_AltCover.ValidateGendarmeEmulation/Debug+AnyCPU/net9.0", // output reports @@ "ValidateGendarmeEmulationUnitTestWithAltCoverCore.xml", // report "AltCover.ValidateGendarmeEmulation.fsproj", // project @@ -2445,7 +2372,7 @@ module Targets = OutputDirectories = [| output |] StrongNameKey = keyfile ReportFormat = "NCover" - Defer = true + Eager = true InPlace = false Save = false } |> AltCoverFilter @@ -2465,7 +2392,7 @@ module Targets = |> DotNet.test (fun p -> { p.WithCommon(withWorkingDirectoryVM workingDirectory) with Configuration = DotNet.BuildConfiguration.Debug - Framework = Some "net8.0" + Framework = Some "net9.0" NoBuild = true } |> (testWithCLITaggedArguments "UnitTestWithAltCoverCore") |> (collectorTestOptions (project |> Path.GetFileNameWithoutExtension))) @@ -2606,7 +2533,7 @@ module Targets = TypeFilter = [ "SolutionRoot"; "Expecto" ] VisibleBranches = true StrongNameKey = keyfile - SingleVisit = true } + All = true } |> AltCoverFilter ) @@ -2617,7 +2544,7 @@ module Targets = DotNet.test (fun to' -> { to'.WithCommon(withWorkingDirectoryVM testdir) with - Framework = Some "net8.0" + Framework = Some "net9.0" NoBuild = false } .WithAltCoverOptions prep @@ -2638,7 +2565,7 @@ module Targets = if File.Exists report then report else - report.Replace(".xml", ".net8.0.xml")) + report.Replace(".xml", ".net9.0.xml")) |> List.filter (fun f -> File.Exists f && f.Contains("Visualizer") |> not) let pester = @@ -2665,7 +2592,7 @@ module Targets = if File.Exists report then report else - report.Replace(".xml", ".net8.0.xml")) + report.Replace(".xml", ".net9.0.xml")) |> List.filter (fun f -> File.Exists f && f.Contains("Visualizer"))) uncovered @"_Reports/_UnitTestWithAltCoverCoreRunner/Summary.xml" @@ -2724,14 +2651,14 @@ module Targets = Directory.ensure "./_Reports" let altcover = - Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" let simpleReport = (Path.getFullName "./_Reports") @@ ("AltCoverFSharpTests.xml") let sampleRoot = - Path.getFullName "_Binaries/FSharpTests_Sample7/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/FSharpTests_Sample7/Debug+AnyCPU/net9.0" // Test the --inplace operation Shell.cleanDir sampleRoot @@ -2834,14 +2761,14 @@ module Targets = |> File.delete let altcover = - Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" let simpleReport = (Path.getFullName "./_Reports") @@ ("AltCoverAsyncAwaitTests.xml") let sampleRoot = - Path.getFullName "_Binaries/AsyncAwaitTests_Sample24/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/AsyncAwaitTests_Sample24/Debug+AnyCPU/net9.0" // Test the --inplace operation Shell.cleanDir sampleRoot @@ -2849,7 +2776,7 @@ module Targets = "Sample24.csproj" |> DotNet.test (fun o -> { o.WithCommon(withWorkingDirectoryVM "Samples/Sample24") with - Framework = Some "net8.0" + Framework = Some "net9.0" Configuration = DotNet.BuildConfiguration.Debug } |> (testWithCLITaggedArguments "AsyncAwaitTests")) @@ -2879,7 +2806,7 @@ module Targets = Path.getFullName "./Samples/Sample24/Sample24.csproj" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample24 + defaultDotNetTestCommandLine (Some "net9.0") sample24 let collect = AltCover.CollectOptions.Primitive @@ -2924,7 +2851,7 @@ module Targets = Directory.ensure "./_Reports" let altcover = - Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" [ ("Sample27", 18); ("Sample30", 27) ] |> List.iter (fun (sample, methodcount) -> @@ -2935,7 +2862,7 @@ module Targets = let sampleRoot = Path.getFullName "./_Binaries/FSAsyncTests_" + sample - + "/Debug+AnyCPU/net8.0" + + "/Debug+AnyCPU/net9.0" // Test the --inplace operation Shell.cleanDir sampleRoot @@ -2943,7 +2870,7 @@ module Targets = sample + ".fsproj" |> DotNet.test (fun o -> { o.WithCommon(withWorkingDirectoryVM ("Samples/" + sample)) with - Framework = Some "net8.0" + Framework = Some "net9.0" Configuration = DotNet.BuildConfiguration.Debug } |> (testWithCLITaggedArguments "FSAsyncTests")) @@ -2982,7 +2909,7 @@ module Targets = + ".fsproj" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sampled + defaultDotNetTestCommandLine (Some "net9.0") sampled let collect = AltCover.CollectOptions.Primitive @@ -3032,17 +2959,17 @@ module Targets = Directory.ensure "./_Reports" let altcover = - Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" let simpleReport = (Path.getFullName "./_Reports") @@ ("AltCoverFSharpTypesDotNetRunner.xml") let sampleRoot = - Path.getFullName "_Binaries/Sample2/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample2/Debug+AnyCPU/net9.0" let instrumented = - Path.getFullName "_Binaries/FSharpTypesDotNetRunner_Sample2/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/FSharpTypesDotNetRunner_Sample2/Debug+AnyCPU/net9.0" // Instrument the code let prep = @@ -3059,6 +2986,7 @@ module Targets = TypeFilter = [ "System\\."; "Microsoft\\." ] InPlace = false ReportFormat = "NCover" + All = true Save = false } ) |> AltCoverCommand.Prepare @@ -3077,7 +3005,7 @@ module Targets = Path.getFullName "./Samples/Sample2/Sample2.fsproj" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample2 + defaultDotNetTestCommandLine (Some "net9.0") sample2 let collect = AltCover.CollectOptions.Primitive @@ -3108,7 +3036,7 @@ module Targets = |> Seq.iter File.Delete let altcover = - Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" let simpleReport = (Path.getFullName "./_Reports") @@ -3124,7 +3052,7 @@ module Targets = let sampleRoot = Path.getFullName - "_Binaries/FSharpTypesDotNetCollecter_Sample2/Debug+AnyCPU/net8.0" + "_Binaries/FSharpTypesDotNetCollecter_Sample2/Debug+AnyCPU/net9.0" printfn "Build and test normally" Shell.cleanDir sampleRoot @@ -3132,7 +3060,7 @@ module Targets = "Sample2.fsproj" |> DotNet.test (fun o -> { o.WithCommon(withWorkingDirectoryVM "Samples/Sample2") with - Framework = Some "net8.0" + Framework = Some "net9.0" Configuration = DotNet.BuildConfiguration.Debug } |> (testWithCLITaggedArguments "FSharpTypesDotNetCollecter")) @@ -3147,6 +3075,7 @@ module Targets = InPlace = true ReportFormat = "NCover" ZipFile = true + All = true Save = true } ) |> AltCoverCommand.Prepare @@ -3176,7 +3105,7 @@ module Targets = "Sample2.fsproj" |> DotNet.test (fun o -> { o.WithCommon(withWorkingDirectoryVM "Samples/Sample2") with - Framework = Some "net8.0" + Framework = Some "net9.0" Configuration = DotNet.BuildConfiguration.Debug NoBuild = true } |> (testWithCLITaggedArguments "FSharpTypesDotNetCollecter")) @@ -3334,7 +3263,7 @@ module Targets = let i = Path.getFullName "./_Mono/Sample1" let altcover = - Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + Path.getFullName "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" let prep = AltCover.PrepareOptions.Primitive( @@ -3372,7 +3301,7 @@ module Targets = Path.getFullName "./_Binaries/Sample1/__Instrumented.CSharpDotNetWithDotNet" let i = - Path.getFullName "./_Binaries/Sample1/Debug+AnyCPU/net8.0" + Path.getFullName "./_Binaries/Sample1/Debug+AnyCPU/net9.0" let prep = AltCover.PrepareOptions.Primitive( @@ -3388,7 +3317,7 @@ module Targets = |> AltCoverCommand.Prepare { AltCoverCommand.Options.Create prep with - ToolPath = "_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0/AltCover.dll" + ToolPath = "_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.dll" ToolType = dotnetAltcover WorkingDirectory = "." } |> AltCoverCommand.run @@ -3415,7 +3344,7 @@ module Targets = Path.getFullName "_Binaries/AltCover/Release+AnyCPU/net472" let sampleRoot = - Path.getFullName "_Binaries/Sample1/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample1/Debug+AnyCPU/net9.0" let instrumented = Path.getFullName "_Binaries/Sample1/__Instrumented.CSharpDotNetWithFramework" @@ -3714,10 +3643,10 @@ module Targets = @@ ("RecordResumeTestDotNet.xml") let binRoot = - Path.getFullName "_Binaries/AltCover/Release+AnyCPU/netcoreapp2.0" + Path.getFullName "_Binaries/AltCover/Release+AnyCPU/net8.0" let sampleRoot = - Path.getFullName "_Binaries/Sample8/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample8/Debug+AnyCPU/net9.0" let instrumented = "__RecordResumeTestDotNet" @@ -3965,7 +3894,7 @@ module Targets = let text = File .ReadAllText(a) - .Replace("tools/netcoreapp2.0", "tools/netcoreapp2.1/any") + .Replace("tools/netcoreapp2.0", "tools/net8.0/any") let name = (Path.getFullName "./_Intermediate/global") @@ -4003,13 +3932,8 @@ module Targets = |> Seq.map (fun x -> (x, Some(where + Path.GetFileName x), None)) |> Seq.toList - let cakeFiles where = - (!! "./_Binaries/AltCover.Cake/Release+AnyCPU/netstandard2.0/AltCover.C*.*") - |> Seq.map (fun x -> (x, Some(where + Path.GetFileName x), None)) - |> Seq.toList - let cake2Files where = - (!! "./_Binaries/AltCover.Cake/Release+AnyCPU/netcoreapp3.1/AltCover.C*.*") + (!! "./_Binaries/AltCover.Cake/Release+AnyCPU/net8.0/AltCover.C*.*") |> Seq.map (fun x -> (x, Some(where + Path.GetFileName x), None)) |> Seq.toList @@ -4078,6 +4002,10 @@ module Targets = let netstdFiles where = (!! "./_Publish/**/*.*") + |> Seq.filter (fun x -> (Path.GetFileName x).Equals("AltCover.exe") |> not) + |> Seq.filter (fun x -> + (Path.GetFileName x).Equals("FSharp.Core.dll") + |> not) |> Seq.map (fun x -> (x, Some( @@ -4090,10 +4018,14 @@ module Targets = None)) |> Seq.toList + let netstd2Fsharp where = + [ ("../AltCover.PowerShell/Release+AnyCPU/netstandard2.0/FSharp.Core.dll", + Some(where + "/FSharp.Core.dll"), + None) ] + let globalFiles = - (!! "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.1/AltCover.*") - |> Seq.map (fun x -> - (x, Some("tools/netcoreapp2.1/any/" + Path.GetFileName x), None)) + (!! "./_Binaries/AltCover/Release+AnyCPU/net8.0/AltCover.*") + |> Seq.map (fun x -> (x, Some("tools/net8.0/any/" + Path.GetFileName x), None)) |> Seq.toList let publishV = @@ -4117,13 +4049,12 @@ module Targets = [ (!! "./AltCover.Visualizer/DotnetToolSettings.xml") ] |> Seq.concat |> Seq.map (fun x -> // Avalonia - (x, Some("tools/net5.0/any/" + Path.GetFileName x), None)) + (x, Some("tools/net8.0/any/" + Path.GetFileName x), None)) |> Seq.toList let auxFiles = - (!! "./_Binaries/AltCover/Release+AnyCPU/netcoreapp2.1/*.xml") - |> Seq.map (fun x -> - (x, Some("tools/netcoreapp2.1/any/" + Path.GetFileName x), None)) + (!! "./_Binaries/AltCover/Release+AnyCPU/net8.0/*.xml") + |> Seq.map (fun x -> (x, Some("tools/net8.0/any/" + Path.GetFileName x), None)) |> Seq.toList printfn "Executing on %A" Environment.OSVersion @@ -4132,10 +4063,10 @@ module Targets = [ applicationFiles resourceFiles "tools/net472/" libFiles "tools/net472/" - netcoreFiles "tools/netcoreapp2.0/" - poshFiles "tools/netcoreapp2.0/" - poshHelpFiles "tools/netcoreapp2.0/" - dataFiles "tools/netcoreapp2.0/" + netcoreFiles "tools/net8.0" + poshFiles "tools/net8.0/" + poshHelpFiles "tools/net8.0/" + dataFiles "tools/net8.0/" monitorFiles "lib/netstandard2.0/" otherFiles housekeeping ], @@ -4149,6 +4080,7 @@ module Targets = resourceFiles "lib/net472/" libFiles "lib/net472/" netstdFiles "lib/netstandard2.0" + netstd2Fsharp "lib/netstandard2.0" dataFiles "lib/netstandard2.0/" monitorFiles "lib/netstandard2.0/" fakeFiles "lib/netstandard2.0/" @@ -4161,8 +4093,7 @@ module Targets = "./_Generated/altcover.api.nuspec", "altcover.api") (List.concat - [ cakeFiles "lib/netstandard2.0/" - cake2Files "lib/netcoreapp3.1/" + [ cake2Files "lib/net8.0/" cake0files housekeeping ], [ ("AltCover.Api", Version) ], @@ -4172,13 +4103,11 @@ module Targets = (List.concat [ globalFiles - netcoreFiles "tools/netcoreapp2.1/any" - poshFiles "tools/netcoreapp2.1/any/" - poshHelpFiles "tools/netcoreapp2.1/any/" - dataFiles "tools/netcoreapp2.1/any/" - // monitorFiles "lib/netstandard2.0/" - // [ (monitor, Some "lib/net20", None) ] - monitorFiles "tools/netcoreapp2.1/any/" + netcoreFiles "tools/net8.0/any" + poshFiles "tools/net8.0/any/" + poshHelpFiles "tools/net8.0/any/" + dataFiles "tools/net8.0/any/" + monitorFiles "tools/net8.0/any/" [ (Path.getFullName "Build/README.global.md", Some "", None) (Path.getFullName "./_Binaries/README.global.html", Some "", None) ] auxFiles @@ -4190,7 +4119,7 @@ module Targets = "altcover.global") (List.concat - [ vizFiles "tools/net5.0/any" // Avalonia + [ vizFiles "tools/net8.0/any" // Avalonia [ (Path.getFullName "Build/README.visualizer.md", Some "", None) (Path.getFullName "./_Binaries/README.visualizer.html", Some "", None) ] auxVFiles @@ -4325,7 +4254,7 @@ module Targets = Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DistributedLoggers = None Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DisableInternalBinLog = true - Framework = Some "netcoreapp2.0" }) + Framework = Some "net8.0" }) netcoresource DotNet.publish @@ -4337,7 +4266,7 @@ module Targets = Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DistributedLoggers = None Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DisableInternalBinLog = true - Framework = Some "net5.0" }) + Framework = Some "net8.0" }) (Path.getFullName "./AltCover.Avalonia/AltCover.Avalonia.fsproj") // dotnet tooling mods @@ -4465,23 +4394,30 @@ module Targets = + (toolPackages.Item p) + "/lib/netstandard2.0/" + let pvpCake (p: string) = + nugetCache + + "/" + + p.ToLowerInvariant() + + "/" + + (toolPackages.Item p) + + "/lib/net8.0/" + let unpacked = "./_Packaging.api/Unpack/lib/netstandard2.0/" let uncake = - "./_Binaries/AltCover.Cake/Release+AnyCPU/netstandard2.0/" + "./_Binaries/AltCover.Cake/Release+AnyCPU/net8.0/" Shell.copyFile (unpacked + "AltCover.Cake.dll") (uncake + "AltCover.Cake.dll") Shell.copyFile (unpacked + "AltCover.Cake.xml") (uncake + "AltCover.Cake.xml") Shell.copyFile (unpacked + "Cake.Core.dll") - ((packageVersionPart "Cake.Core") + "Cake.Core.dll") + ((pvpCake "Cake.Core") + "Cake.Core.dll") Shell.copyFile (unpacked + "Cake.Common.dll") - ((packageVersionPart "Cake.Common") - + "Cake.Common.dll") + ((pvpCake "Cake.Common") + "Cake.Common.dll") Shell.copyFile (unpacked + "System.Management.Automation.dll") @@ -4489,7 +4425,6 @@ module Targets = + "System.Management.Automation.dll") [ "AltCover.Base" - "AltCover.Cake" "AltCover.DotNet" "AltCover.Engine" // beware static linkage -- maybe copy from debug? "AltCover.Monitor" @@ -4512,6 +4447,26 @@ module Targets = + ".dll ./_Documentation/" + n + " --visibility public --skip-unbrowsable --clean") + ("documenting " + n)) + + [ "AltCover.Cake" ] + |> List.iter (fun n -> + //Shell.copyFile + // (unpacked + n + ".xml") + // ("./_Binaries/" + // + n + // + "/Release+AnyCPU/netstandard2.0/" + // + n + // + ".xml") + + Actions.RunDotnet + (dotnetOptions >> dotnetOptionsWithRollForwards) + "xmldocmd" + ("./_Binaries/" + n + "/Release+AnyCPU/netstandard2.1/" + + n + + ".dll ./_Documentation/" + + n + + " --visibility public --skip-unbrowsable --clean") ("documenting " + n))) let WindowsPowerShell = @@ -4544,7 +4499,7 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let unpackapi = Path.getFullName "_Packaging.api/Unpack/lib/netstandard2.0" @@ -4578,12 +4533,10 @@ module Targets = "AltCover.Cake" "AltCover.Base" "Recorder" - "Mono" "DataCollector" "FSharp" ] InPlace = false ReportFormat = "OpenCover" - LocalSource = true Save = true VisibleBranches = true } ) @@ -4771,7 +4724,7 @@ module Targets = @@ ("ReleaseDotNetWithFramework.xml") let sampleRoot = - Path.getFullName "./_Binaries/Sample1/Debug+AnyCPU/net8.0" + Path.getFullName "./_Binaries/Sample1/Debug+AnyCPU/net9.0" let instrumented = sampleRoot @@ -4812,7 +4765,7 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let x = Path.getFullName "./_Reports/ReleaseMonoWithDotNet.xml" @@ -4851,7 +4804,7 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let x = Path.getFullName "./_Reports/ReleaseDotNetWithDotNet.xml" @@ -4860,7 +4813,7 @@ module Targets = Path.getFullName "./_Binaries/Sample1/__Instrumented.ReleaseDotNetWithDotNet" let i = - Path.getFullName "./_Binaries/Sample1/Debug+AnyCPU/net8.0" + Path.getFullName "./_Binaries/Sample1/Debug+AnyCPU/net9.0" let prep = AltCover.PrepareOptions.Primitive( @@ -4895,17 +4848,17 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let x = Path.getFullName "./_Reports/AltCoverReleaseFSharpTypesDotNetRunner.xml" let o = Path.getFullName - "./_Binaries/ReleaseFSharpTypesDotNetRunner_Sample2/Debug+AnyCPU/net8.0" + "./_Binaries/ReleaseFSharpTypesDotNetRunner_Sample2/Debug+AnyCPU/net9.0" let i = - Path.getFullName "_Binaries/Sample2/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample2/Debug+AnyCPU/net9.0" Shell.cleanDir o @@ -4916,6 +4869,7 @@ module Targets = Report = x OutputDirectories = [ o ] InputDirectories = [ i ] + All = true AssemblyFilter = [ "Adapter" "nunit" @@ -4942,10 +4896,10 @@ module Targets = Path.getFullName "./Samples/Sample2/Sample2.fsproj" let runner = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0/AltCover.dll" + Path.getFullName "_Packaging/Unpack/tools/net8.0/AltCover.dll" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample2 + defaultDotNetTestCommandLine (Some "net9.0") sample2 // Run let collect = @@ -4971,7 +4925,7 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let s = Path.getFullName "." @@ -4980,10 +4934,10 @@ module Targets = let o = Path.getFullName - "./_Binaries/ReleaseFSharpTypesX86DotNetRunner_Sample2/Debug+x86/net8.0" + "./_Binaries/ReleaseFSharpTypesX86DotNetRunner_Sample2/Debug+x86/net9.0" let i = - Path.getFullName "_Binaries/Sample2/Debug+x86/net8.0" + Path.getFullName "_Binaries/Sample2/Debug+x86/net9.0" Shell.cleanDir o @@ -5047,7 +5001,7 @@ module Targets = // Run let (dotnetexe, args) = - defaultDotNetTestCommandLine86 (Some "net8.0") sample2 + defaultDotNetTestCommandLine86 (Some "net9.0") sample2 let collect = AltCover.CollectOptions.Primitive @@ -5077,17 +5031,17 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let x = Path.getFullName "./_Reports/ReleaseXUnitFSharpTypesDotNetRunner.xml" let o = Path.getFullName - "./_Binaries/ReleaseXUnitFSharpTypesDotNetRunner_Sample4/Debug+AnyCPU/net8.0" + "./_Binaries/ReleaseXUnitFSharpTypesDotNetRunner_Sample4/Debug+AnyCPU/net9.0" let i = - Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net9.0" Shell.cleanDir o @@ -5102,6 +5056,7 @@ module Targets = InPlace = false LocalSource = true ReportFormat = "NCover" + All = true Save = false } ) |> AltCoverCommand.Prepare @@ -5120,10 +5075,10 @@ module Targets = Path.getFullName "./Samples/Sample4/Sample4.fsproj" let runner = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0/AltCover.dll" + Path.getFullName "_Packaging/Unpack/tools/net8.0/AltCover.dll" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample4 + defaultDotNetTestCommandLine (Some "net9.0") sample4 // Run let collect = @@ -5154,16 +5109,16 @@ module Targets = Directory.ensure reportDir let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let x = Path.getFullName "./_Reports/OpenCoverForPester/OpenCoverForPester.xml" let o = - Path.getFullName "./_Binaries/OpenCoverForPester_Sample18/Debug+AnyCPU/net8.0" + Path.getFullName "./_Binaries/OpenCoverForPester_Sample18/Debug+AnyCPU/net9.0" let i = - Path.getFullName "_Binaries/Sample18/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample18/Debug+AnyCPU/net9.0" Shell.cleanDir o @@ -5197,10 +5152,10 @@ module Targets = Path.getFullName "./Samples/Sample18/Sample18.fsproj" let runner = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0/AltCover.dll" + Path.getFullName "_Packaging/Unpack/tools/net8.0/AltCover.dll" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample + defaultDotNetTestCommandLine (Some "net9.0") sample // Run let collect = @@ -5248,7 +5203,7 @@ module Targets = Shell.copyFile target covxml let binary = - "_Binaries/CoverletForPester_Sample18/Debug+AnyCPU/net8.0/Sample18.dll" + "_Binaries/CoverletForPester_Sample18/Debug+AnyCPU/net9.0/Sample18.dll" let binaryTarget = reportDir @@ "Sample18.dll" @@ -5256,7 +5211,7 @@ module Targets = Shell.copyFile binaryTarget binary let binary2 = - "_Binaries/CoverletForPester_Sample18/Debug+AnyCPU/net8.0/Sample18.pdb" + "_Binaries/CoverletForPester_Sample18/Debug+AnyCPU/net9.0/Sample18.pdb" let binary2Target = reportDir @@ "Sample18.pdb" @@ -5268,7 +5223,7 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let x = Path.getFullName "./_Reports/ShowStatic.xml" @@ -5284,10 +5239,10 @@ module Targets = let o = Path.getFullName - "./_Binaries/ReleaseXUnitFSharpTypesShowVisualized_Sample4/Debug+AnyCPU/net8.0" + "./_Binaries/ReleaseXUnitFSharpTypesShowVisualized_Sample4/Debug+AnyCPU/net9.0" let i = - Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net9.0" Shell.cleanDir o @@ -5303,6 +5258,7 @@ module Targets = ReportFormat = "NCover" LocalSource = true Save = false + All = true ShowStatic = "+" } ) |> AltCoverCommand.Prepare @@ -5361,6 +5317,7 @@ module Targets = LocalSource = true ReportFormat = "NCover" Save = false + All = true ShowStatic = "++" } ) |> AltCoverCommand.Prepare @@ -5410,6 +5367,7 @@ module Targets = LocalSource = true ReportFormat = "NCover" Save = false + All = true ShowGenerated = true } ) |> AltCoverCommand.Prepare @@ -5464,6 +5422,7 @@ module Targets = LocalSource = true ReportFormat = "NCover" Save = false + All = true ShowGenerated = true } ) |> AltCoverCommand.Prepare @@ -5480,10 +5439,10 @@ module Targets = Path.getFullName "./Samples/Sample4/Sample4.fsproj" let runner = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0/AltCover.dll" + Path.getFullName "_Packaging/Unpack/tools/net8.0/AltCover.dll" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample4 + defaultDotNetTestCommandLine (Some "net9.0") sample4 // Run let collect = @@ -5540,17 +5499,17 @@ module Targets = Directory.ensure "./_Reports" let unpack = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0" + Path.getFullName "_Packaging/Unpack/tools/net8.0" let x = Path.getFullName "./_Reports/ReleaseXUnitFSharpTypesDotNetFullRunner.xml" let o = Path.getFullName - "./_Binaries/ReleaseXUnitFSharpTypesDotNetFullRunner_Sample4/Debug+AnyCPU/net8.0" + "./_Binaries/ReleaseXUnitFSharpTypesDotNetFullRunner_Sample4/Debug+AnyCPU/net9.0" let i = - Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net8.0" + Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net9.0" Shell.cleanDir o let before = Actions.ticksNow () @@ -5564,6 +5523,7 @@ module Targets = CallContext = [ "0"; "[Fact]" ] AssemblyFilter = [ "xunit" ] LocalSource = true + All = true InPlace = false Save = false } ) @@ -5583,10 +5543,10 @@ module Targets = Path.getFullName "./Samples/Sample4/Sample4.fsproj" let runner = - Path.getFullName "_Packaging/Unpack/tools/netcoreapp2.0/AltCover.dll" + Path.getFullName "_Packaging/Unpack/tools/net8.0/AltCover.dll" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample4 + defaultDotNetTestCommandLine (Some "net9.0") sample4 // Run let collect = @@ -5618,15 +5578,10 @@ module Targets = Path.getFullName "./_Reports/JsonReporting.json" let o = - Path.getFullName "./_Binaries/JsonReporting_Sample4/Debug+AnyCPU/net8.0" + Path.getFullName "./_Binaries/JsonReporting_Sample4/Debug+AnyCPU/net9.0" let i = - Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net8.0" - - // Test data gathering only - //let x = Path.getFullName "./AltCover.Tests/Sample5.native.json" - //let o = Path.getFullName "./_Binaries/JsonReporting_Sample5/Debug+AnyCPU/netstandard2.0" - //let i = Path.getFullName "_Binaries/Sample5/Debug+AnyCPU/netstandard2.0" + Path.getFullName "_Binaries/Sample4/Debug+AnyCPU/net9.0" Shell.cleanDir o let before = Actions.ticksNow () @@ -5642,6 +5597,7 @@ module Targets = CallContext = [ "0"; "[Fact]" ] AssemblyFilter = [ "xunit" ] LocalSource = true + All = true InPlace = false Save = false } ) @@ -5687,11 +5643,6 @@ module Targets = printfn "Content OK" - // printfn "Extract and verify the first results" - // Shell.cleanDir "./_Reports/JsonReporting2" - // System.IO.Compression.ZipFile.ExtractToDirectory(x + ".zip", "./_Reports/JsonReporting1") - // checkSample4Content "./_Reports/JsonReporting1/JsonReporting.json" - checkSample4Content x printfn "Execute the instrumented tests" @@ -5703,7 +5654,7 @@ module Targets = Path.getFullName "_Packaging/Unpack/tools/net472/AltCover.exe" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") sample4 + defaultDotNetTestCommandLine (Some "net9.0") sample4 // Run let collect = @@ -5737,8 +5688,6 @@ module Targets = let expected = "0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 2 1 1 1" - //"0 1 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 2 0 1 0 1 1" - //"0 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 2 0 1 0 1 1" Assert.That( String.Join(" ", recorded), @@ -5806,17 +5755,11 @@ module Targets = Assert.That( String.Join(" ", trackedVisits), "1 1 1 1 1 1 1 1 2 2 2 2 2" |> Is.EqualTo, - //"1 1 1 1 1 1 1 2 2 2 2 2" |> Is.EqualTo, sprintf "Bad tracked visit list %A" trackedVisits ) printfn "TrackRefs OK" - // printfn "Extract and verify the final results" - // Shell.cleanDir "./_Reports/JsonReporting1" - // System.IO.Compression.ZipFile.ExtractToDirectory(x + ".zip", "./_Reports/JsonReporting2") - // checkSample4Visits before "./_Reports/JsonReporting2/JsonReporting.json" - checkSample4Visits before x) let MSBuildTest = @@ -5879,7 +5822,7 @@ module Targets = "Fake2738Workround", "True" ] }) "./Samples/Sample4/Sample4LongForm.fsproj") - let Cake2Test = + let cake5plusTest = (fun () -> let before = Actions.ticksNow () @@ -5914,7 +5857,8 @@ module Targets = fsproj.Descendants(XName.Get("TargetFrameworks")) |> Seq.head - targets.SetValue "net8.0" + targets.SetValue "net9.0" + targets.Name <- (XName.Get("TargetFramework")) let pack = fsproj.Descendants(XName.Get("PackageReference")) @@ -5965,7 +5909,7 @@ module Targets = .Replace("{1}", Version) ) - [ (" --version 2.0.0", "build.cake") + [ (" --version 5.0.0", "build.cake") (String.Empty, "build.cake") ] |> List.iter (fun (cakeversion, script) -> try @@ -6007,7 +5951,7 @@ module Targets = + script + "." + cv - + ".net8.0.xml" + + ".xml" ) Actions.CheckSample4 before x @@ -6084,7 +6028,8 @@ module Targets = fsproj.Descendants(XName.Get("TargetFrameworks")) |> Seq.head - let netTarget = "net8.0" + let netTarget = "net9.0" + targets.Name <- (XName.Get("TargetFramework")) targets.SetValue netTarget @@ -6169,11 +6114,7 @@ module Targets = "running fake script returned with a non-zero exit code" let x = - Path.getFullName ( - "./_ApiUse/_DotnetTest/coverage." - + netTarget - + ".xml" - ) + Path.getFullName ("./_ApiUse/_DotnetTest/coverage.xml") Actions.CheckSample4 before x finally @@ -6239,7 +6180,8 @@ module Targets = |> Seq.concat |> Seq.head - targets.SetValue "net8.0" + targets.SetValue "net9.0" + targets.Name <- (XName.Get("TargetFramework")) targets.AddAfterSelf(XElement(XName.Get "DocumentationFile")) fsproj.Descendants(XName.Get("HintPath")) @@ -6281,6 +6223,7 @@ module Targets = let p1 = { p0 with + All = true CallContext = [ "[Fact]"; "0" ] AssemblyFilter = [| "xunit" @@ -6315,7 +6258,7 @@ module Targets = "_DotnetTest.fsproj" assertCopied ( - "_Binaries/_DotnetTest/Debug+AnyCPU/net8.0/__Instrumented__DotnetTest" + "_Binaries/_DotnetTest/Debug+AnyCPU/net9.0/__Instrumented__DotnetTest" ) DotNet.test @@ -6332,11 +6275,11 @@ module Targets = "_DotnetTestJson.fsproj" // TODO validate output as per JsonReporting assertCopied ( - "_Binaries/_DotnetTestJson/Debug+AnyCPU/net8.0/__Instrumented__DotnetTestJson" + "_Binaries/_DotnetTestJson/Debug+AnyCPU/net9.0/__Instrumented__DotnetTestJson" ) let x = - Path.getFullName "./_DotnetTest/coverage.net8.0.xml" + Path.getFullName "./_DotnetTest/coverage.xml" Actions.CheckSample4 before x @@ -6354,7 +6297,7 @@ module Targets = "_DotnetTestInPlace.fsproj" let x = - Path.getFullName "./_DotnetTestInPlace/coverage.net8.0.xml" + Path.getFullName "./_DotnetTestInPlace/coverage.xml" Actions.CheckSample4 before x @@ -6376,6 +6319,7 @@ module Targets = "Microsoft" "testhost" |] StrongNameKey = "./_Reports/nonesuch.junk" + All = true Report = xx0 } |> AltCover.PrepareOptions.Primitive @@ -6388,6 +6332,7 @@ module Targets = "Microsoft" "testhost" |] StrongNameKey = "./_Reports/nonesuch.junk" + All = true Report = xx0a } |> AltCover.PrepareOptions.Primitive @@ -6409,10 +6354,10 @@ module Targets = Assert.That(xx0 |> File.Exists |> not, xx0 + " should not be present") Assert.That( - "./_DotnetTestFailInstrumentation/bin/Debug/net8.0/dotnettest.dll.txt" + "./_DotnetTestFailInstrumentation/bin/Debug/net9.0/dotnettest.dll.txt" |> File.Exists |> not, - "./_DotnetTestFailInstrumentation/bin/Debug/net8.0/dotnettest.dll.txt should not be present" + "./_DotnetTestFailInstrumentation/bin/Debug/net9.0/dotnettest.dll.txt should not be present" ) try @@ -6435,10 +6380,10 @@ module Targets = Assert.That(xx0a |> File.Exists |> not, xx0a + " should not be present") Assert.That( - "./_DotnetTestFailInstrumentationInPlace/bin/Debug/net8.0/dotnettest.dll.txt" + "./_DotnetTestFailInstrumentationInPlace/bin/Debug/net9.0/dotnettest.dll.txt" |> File.Exists |> not, - "./_DotnetTestFailInstrumentationInPlace/bin/Debug/net8.0/dotnettest.dll.txt should not be present" + "./_DotnetTestFailInstrumentationInPlace/bin/Debug/net9.0/dotnettest.dll.txt should not be present" ) printfn "optest failing test ------------------------------------------------" @@ -6452,6 +6397,7 @@ module Targets = let pf1 = { p0 with AssemblyExcludeFilter = [| "NUnit" |] + All = true AssemblyFilter = [| "FSharp" "Monitor" @@ -6461,6 +6407,7 @@ module Targets = let pf1a = { p0a with + All = true AssemblyFilter = [| "NUnit" "FSharp" @@ -6485,9 +6432,9 @@ module Targets = printfn "Caught expected exception" Assert.That( - "./_Binaries/_DotnetTestFail/Debug+AnyCPU/net8.0/_DotnetTestFail.dll.txt" + "./_Binaries/_DotnetTestFail/Debug+AnyCPU/net9.0/_DotnetTestFail.dll.txt" |> File.Exists, - "./_Binaries/_DotnetTestFail/Debug+AnyCPU/net8.0/_DotnetTestFail.dll.txt should exist" + "./_Binaries/_DotnetTestFail/Debug+AnyCPU/net9.0/_DotnetTestFail.dll.txt should exist" ) do @@ -6516,7 +6463,6 @@ module Targets = Is.EqualTo "1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;0", xx ) - //"1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;0" try DotNet.test @@ -6535,7 +6481,7 @@ module Targets = let filepath = Path.GetFullPath - "./_Binaries/_DotnetTestFailInPlace/Debug+AnyCPU/net8.0/_DotnetTestFailInPlace.dll.txt" + "./_Binaries/_DotnetTestFailInPlace/Debug+AnyCPU/net9.0/_DotnetTestFailInPlace.dll.txt" Assert.That(filepath |> File.Exists, filepath + " should exist") @@ -6565,7 +6511,6 @@ module Targets = Is.EqualTo "1;1;1;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;0", xxa ) - //"1;1;1;1;1;1;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;0" printfn "optest failing test fast ------------------------------------------------" @@ -6578,6 +6523,7 @@ module Targets = let pf1 = { p0 with + All = true AssemblyFilter = [| "NUnit" "FSharp" @@ -6588,6 +6534,7 @@ module Targets = let pf1a = { p0 with + All = true AssemblyFilter = [| "NUnit" "FSharp" @@ -6613,9 +6560,9 @@ module Targets = printfn "Caught expected exception" Assert.That( - "./_Binaries/_DotnetTestFailFast/Debug+AnyCPU/net8.0/_DotnetTestFailFast.dll.txt" + "./_Binaries/_DotnetTestFailFast/Debug+AnyCPU/net9.0/_DotnetTestFailFast.dll.txt" |> File.Exists, - "./_Binaries/_DotnetTestFailFast/Debug+AnyCPU/net8.0/_DotnetTestFailFast.dll.txt should exist" + "./_Binaries/_DotnetTestFailFast/Debug+AnyCPU/net9.0/_DotnetTestFailFast.dll.txt should exist" ) do @@ -6661,9 +6608,9 @@ module Targets = printfn "Caught expected exception" Assert.That( - "./_Binaries/_DotnetTestFailFastInPlace/Debug+AnyCPU/net8.0/_DotnetTestFailFastInPlace.dll.txt" + "./_Binaries/_DotnetTestFailFastInPlace/Debug+AnyCPU/net9.0/_DotnetTestFailFastInPlace.dll.txt" |> File.Exists, - "./_Binaries/_DotnetTestFailFastInPlace/Debug+AnyCPU/net8.0/_DotnetTestFailFastInPlace.dll.txt should exist" + "./_Binaries/_DotnetTestFailFastInPlace/Debug+AnyCPU/net9.0/_DotnetTestFailFastInPlace.dll.txt should exist" ) do @@ -6698,6 +6645,7 @@ module Targets = let p2 = { p0 with LineCover = true + All = true AssemblyFilter = [| "xunit" "FSharp" @@ -6804,6 +6752,7 @@ module Targets = let p3 = { p0 with BranchCover = true + All = true AssemblyFilter = [| "xunit" "FSharp" @@ -6925,6 +6874,7 @@ module Targets = let p29 = { p0 with + All = true AssemblyFilter = [ "NUnit"; "Microsoft"; "testhost" ] } let pp29 = @@ -6964,6 +6914,7 @@ module Targets = let p4 = { p0 with + All = true AssemblyFilter = [ "NUnit" "Monitor" @@ -6993,23 +6944,6 @@ module Targets = Is.EqualTo 2 ) - // printfn "Regression test issue 94 ------------------------------------------------" - // let proj = XDocument.Load "./Samples/Sample22/Sample22.xml" - // let pack = proj.Descendants(XName.Get("PackageReference")) |> Seq.head - // let inject = - // XElement - // (XName.Get "PackageReference", XAttribute(XName.Get "Include", "altcover"), - // XAttribute(XName.Get "Version", Version)) - // pack.AddBeforeSelf inject - // proj.Save "./Samples/Sample22/Sample22.fsproj" - - // let p4 = { p0 with AssemblyFilter = [ "NUnit" ] } - // let pp4 = AltCover.PrepareOptions.Primitive p4 - // DotNet.test (fun to' -> - // { ((to'.WithCommon(withWorkingDirectoryVM "Samples/Sample22")) .WithAltCoverOptions - // pp4 cc0 ForceTrue) with Configuration = DotNet.BuildConfiguration.Release } - // |> testWithCLIArguments) "" - finally let folder = (nugetCache @@ "altcover") @@ Version @@ -7107,27 +7041,6 @@ module Targets = |> testWithCLIArguments) "" - //let shared = - // if Environment.isWindows then - // [ "%ProgramFiles%/dotnet/shared/Microsoft.AspNetCore.App/2.1.5/Microsoft.AspNetCore.Cryptography.KeyDerivation.dll" ] - // else - // [ "/usr/share/dotnet/shared/Microsoft.AspNetCore.App/2.1.5/Microsoft.AspNetCore.Cryptography.KeyDerivation.dll" ] - //Path.getFullName "./RegressionTesting/issue20/xunit-tests/bin" |> Shell.cleanDir - //// would like to assert "no warnings" - //let p1 = { p0 with Dependencies = shared } - //DotNet.test - // (fun to' -> - // { to'.WithCommon(fun c -> - // { c with WorkingDirectory = - // Path.getFullName"./RegressionTesting/issue20/xunit-tests" - // Verbosity = SomeDotNet.Verbosity.Minimal }) .WithAltCoverOptions p1 c0 ForceTrue with Configuration = - // DotNet.BuildConfiguration.Debug - // NoBuild = - // false - // MSBuildParams = - // cliArguments }) - // "" - printfn "**************** And now with silence..." let p1 = @@ -7259,7 +7172,7 @@ module Targets = csproj.Descendants(XName.Get("TargetFramework")) |> Seq.head - target.SetValue "net8.0" + target.SetValue "net9.0" let pack = csproj.Descendants(XName.Get("PackageReference")) @@ -7383,6 +7296,7 @@ module Targets = { Primitive.PrepareOptions.Create() with LocalSource = true VisibleBranches = false + All = true TypeFilter = [ "UnitTest" ] Report = "./original.$(ProjectName).xml" } @@ -7442,17 +7356,13 @@ module Targets = "5" ], "first") @> - // [ "1"; "4"; "4"; "0"; "3"; "1"; "2"; "1"; "1"; "1"; "5"; "5" ] @> - // Assert.That - // (found, - // Is.EquivalentTo [ "1"; "4"; "4"; "0"; "3"; "1"; "2"; "1"; "1"; "1"; "5"; "5" ], - // sprintf "original: %A" found) let p1 = { Primitive.PrepareOptions.Create() with LocalSource = true VisibleBranches = true TypeFilter = [ "UnitTest" ] + All = true Report = "./combined.$(ProjectName).xml" } let pp1 = @@ -7509,9 +7419,69 @@ module Targets = "5" ], "second") @> - // Assert.That - // (found, Is.EquivalentTo [ "1"; "4"; "1"; "1"; "1"; "1"; "5"; "5" ], - // sprintf "combined: %A" found) + + let p1 = + { Primitive.PrepareOptions.Create() with + LocalSource = true + VisibleBranches = true + TypeFilter = [ "UnitTest" ] + All = false + Report = "./single.$(ProjectName).xml" } + + let pp1 = + AltCover.PrepareOptions.Primitive p1 + + let c0 = Primitive.CollectOptions.Create() + + let cc0 = + AltCover.CollectOptions.Primitive c0 + + DotNet.test + (fun p -> + ((p + |> debugNoBuildIn "./Samples/Sample16/Test/_Issue72") + .WithAltCoverOptions + pp1 + cc0 + ForceTrue) + .WithAltCoverImportModule() + .WithAltCoverGetVersion() + |> testWithCLIArguments) + "" + + do + use coverageFile = // fsharplint:disable-next-line RedundantNewKeyword + new FileStream( + "./Samples/Sample16/Test/_Issue72/single.Test.xml", + FileMode.Open, + FileAccess.Read, + FileShare.None, + 4096, + FileOptions.SequentialScan + ) + + use reader = XmlReader.Create(coverageFile) + + let coverageDocument = + XDocument.Load(reader) + + let found = + coverageDocument.Descendants(XName.Get("BranchPoint")) + |> Seq.map _.Attribute(XName.Get("vc")).Value + |> Seq.toList + + test + <@ + (found, "single") = ([ "1" + "1" + "1" + "1" + "1" + "1" + "1" + "1" ], + "single") + @> // Issue 98 optest printfn @@ -7522,6 +7492,7 @@ module Targets = let psln = AltCover.PrepareOptions.Primitive { p0 with + All = true Report = "$(SolutionDir)/_Reports/solution.$(ProjectName).xml" } DotNet.test @@ -7573,8 +7544,9 @@ module Targets = fsproj.Descendants(XName.Get("TargetFrameworks")) |> Seq.head - targets.SetValue "net8.0" + targets.SetValue "net9.0" targets.AddAfterSelf(XElement(XName.Get "DocumentationFile")) + targets.Name <- (XName.Get("TargetFramework")) fsproj.Descendants(XName.Get("HintPath")) |> Seq.iter (fun hint -> @@ -7621,7 +7593,7 @@ module Targets = Path.getFullName "./_Reports/DotnetGlobalIntegration.xml" let o = - Path.getFullName "./_Binaries/_DotnetGlobalTest/Debug+AnyCPU/net8.0" + Path.getFullName "./_Binaries/_DotnetGlobalTest/Debug+AnyCPU/net9.0" let r = Path.Combine(o, Path.GetFileName x) @@ -7646,6 +7618,7 @@ module Targets = LocalSource = true InPlace = true Save = false + All = true Portable = true } ) |> AltCoverCommand.Prepare @@ -7659,7 +7632,7 @@ module Targets = printfn "Execute the instrumented tests" let (dotnetexe, args) = - defaultDotNetTestCommandLine (Some "net8.0") String.Empty + defaultDotNetTestCommandLine (Some "net9.0") String.Empty let collect = AltCover.CollectOptions.Primitive @@ -7848,7 +7821,7 @@ module Targets = "testhost" "FSharp" "AltCover" |] - SingleVisit = true } + All = true } let pp0 = AltCover.PrepareOptions.Primitive p0 @@ -8208,7 +8181,7 @@ module Targets = _Target "JsonReporting" JsonReporting _Target "MSBuildTest" MSBuildTest - _Target "Cake2Test" Cake2Test + _Target "cake5plusTest" cake5plusTest _Target "ApiUse" ApiUse _Target "DotnetTestIntegration" DotnetTestIntegration _Target "Issue20" Issue20 @@ -8482,7 +8455,7 @@ module Targets = "Unpack" ==> "ApiUse" ==> "Deployment" |> ignore - "Unpack" ==> "Cake2Test" ==> "Deployment" + "Unpack" ==> "cake5plusTest" ==> "Deployment" |> ignore "Unpack" diff --git a/Demo/Echo/Echo/Echo.csproj b/Demo/Echo/Echo/Echo.csproj index a269962b5..92e46ddac 100644 --- a/Demo/Echo/Echo/Echo.csproj +++ b/Demo/Echo/Echo/Echo.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/Demo/Echo/Test/Test.csproj b/Demo/Echo/Test/Test.csproj index 28af30b64..38dad9b3c 100644 --- a/Demo/Echo/Test/Test.csproj +++ b/Demo/Echo/Test/Test.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 false diff --git a/Demo/MultiTest/Test1/Test1.fsproj b/Demo/MultiTest/Test1/Test1.fsproj index acb6ec006..aa421060f 100644 --- a/Demo/MultiTest/Test1/Test1.fsproj +++ b/Demo/MultiTest/Test1/Test1.fsproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 false diff --git a/Demo/MultiTest/Test2/Test2.fsproj b/Demo/MultiTest/Test2/Test2.fsproj index ec8c9525e..b90e63e26 100644 --- a/Demo/MultiTest/Test2/Test2.fsproj +++ b/Demo/MultiTest/Test2/Test2.fsproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 false diff --git a/Directory.Build.props b/Directory.Build.props index fd228be73..ba06705f0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,12 +6,11 @@ true false - true - + all diff --git a/Directory.Packages.props b/Directory.Packages.props index 8a105343d..6f63c07da 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,91 +4,90 @@ - - - - - - - + + + + + + + - - - - - + + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + - - - + + + - + - + + - - + + - - - + + + - + - - + + - + - - - - - - - + + + + + + + \ No newline at end of file diff --git a/Fragments.txt b/Fragments.txt index 88edf84ab..6a356bdeb 100644 --- a/Fragments.txt +++ b/Fragments.txt @@ -4,4 +4,13 @@ C:\Users\email\Documents\Github\altcover\_Binaries\AltCover\Release+AnyCPU\net47 Run and collect in one -C:\Users\email\Documents\Github\altcover\_Binaries\AltCover\Release+AnyCPU\net472\AltCover.exe Runner -r "C:\Users\email\Documents\Github\altcover\_Binaries\AltCover.Tests\Debug+AnyCPU\net472\./__UnitTestWithAltCoverRunner" -x "C:\Users\email\Documents\Github\altcover\packages\nunit.consolerunner\3.17.0\tools\nunit3-console.exe" -o "C:\Users\email\Documents\Github\altcover\_Reports\UnitTestWithAltCoverRunner.xml" -- --noheader --work=. --result=./_Reports/UnitTestWithAltCoverRunnerReport.xml "C:\Users\email\Documents\Github\altcover\_Binaries\AltCover.Tests\Debug+AnyCPU\net472\__UnitTestWithAltCoverRunner\AltCover.Tests.dll" \ No newline at end of file +C:\Users\email\Documents\Github\altcover\_Binaries\AltCover\Release+AnyCPU\net472\AltCover.exe Runner -r "C:\Users\email\Documents\Github\altcover\_Binaries\AltCover.Tests\Debug+AnyCPU\net472\./__UnitTestWithAltCoverRunner" -x "C:\Users\email\Documents\Github\altcover\packages\nunit.consolerunner\3.17.0\tools\nunit3-console.exe" -o "C:\Users\email\Documents\Github\altcover\_Reports\UnitTestWithAltCoverRunner.xml" -- --noheader --work=. --result=./_Reports/UnitTestWithAltCoverRunnerReport.xml "C:\Users\email\Documents\Github\altcover\_Binaries\AltCover.Tests\Debug+AnyCPU\net472\__UnitTestWithAltCoverRunner\AltCover.Tests.dll" + +Covering instrument.fs line 574 + AltCover.Tests.dll!Tests.AltCoverTests2.UpdateStrongReferencesShouldTrackReferencesEvenFakes() Line 2828 + + + triggers for + + r {nunit.framework, Version=3.14.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb} Mono.Cecil.AssemblyNameReference + + from {Sample2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4ebffcaabf10ce6a} diff --git a/MCS/MCS.fsproj b/MCS/MCS.fsproj index 515b04451..71fd8d851 100644 --- a/MCS/MCS.fsproj +++ b/MCS/MCS.fsproj @@ -23,19 +23,7 @@ - - - ..\ThirdParty\cecil\Mono.Cecil.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Rocks.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Mdb.dll - - - ..\ThirdParty\cecil\Mono.Cecil.Pdb.dll - + diff --git a/RegressionTesting/SoakTest1/SoakTest1.fsproj b/RegressionTesting/SoakTest1/SoakTest1.fsproj index 547054db8..356ab2b79 100644 --- a/RegressionTesting/SoakTest1/SoakTest1.fsproj +++ b/RegressionTesting/SoakTest1/SoakTest1.fsproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/RegressionTesting/issue20/xunit-tests/xunit-tests.xml b/RegressionTesting/issue20/xunit-tests/xunit-tests.xml index e77e31f58..315913f83 100644 --- a/RegressionTesting/issue20/xunit-tests/xunit-tests.xml +++ b/RegressionTesting/issue20/xunit-tests/xunit-tests.xml @@ -1,7 +1,7 @@ - net8.0 + net9.0 xunit_tests Major false diff --git a/RegressionTesting/issue37/issue37.xml b/RegressionTesting/issue37/issue37.xml index 19ffedb2d..28cf889ec 100644 --- a/RegressionTesting/issue37/issue37.xml +++ b/RegressionTesting/issue37/issue37.xml @@ -1,7 +1,7 @@ - net6.0 + net8.0 Major false @@ -11,5 +11,4 @@ - \ No newline at end of file diff --git a/ReleaseNotes - Previously.md b/ReleaseNotes - Previously.md index 37fa2accf..2416b3637 100644 --- a/ReleaseNotes - Previously.md +++ b/ReleaseNotes - Previously.md @@ -1,5 +1,38 @@ # Previously +# 8.8.173 (Habu series release 32) +* [PERFORMANCE] Issue #227 - removing the slow-down observed the new (at 8.8.165) file name processing for Cobertura +* [PERFORMANCE] removing a surprising hot-spot in branch coverage instrumentation that was taking 60% of the whole instrumentation time + +# 8.8.165 (Habu series release 31) +* [ADVISORY] the Fake.build related assemblies (in the `altcover.api` and `altcover.fake` packages), and the Avalonia 0.10-based visualizer, rely on components with known vulnerabilities. The Fake.build project appears nigh-moribund so has not released an update, whereas Avalonia 11 completely rewrites all the earlier APIs and has not documented anything to assist in the rewrite of the application. +* [BUGFIX] Issue #197 - correctly split file paths in the Cobertura output +* [NET9 preparation] Recode the recorder into C# as compiler/build target changes in F#9 make maintaining net2.0 compatibility in F# too much bother. + +# 8.8.74 (Habu series release 30) +* [BUGFIX] Issue #222 - distinguish methods differing only in number of generic parameters (JSON and cobertura in particular, but with small changes for all all output formats) +* [BUGFIX] Issue #223 - handle degenerate source paths for Cobertura output + +# 8.8.53 (Habu series release 29) +* [BUGFIX] Fix summary data for `--outputFile` option +* [BUGFIX] Fix interaction of `--zipFile` prepare option and `--outputFile` collect option +* [BUGFIX] Issue #220 - improve dependency resolution to the GAC + +# 8.8.21 (Habu series release 28) +* [BREAKING; BUGFIX] Issue #206 : Update to net6+ for `dotnet test` integration and respect the `$(IsTestProject)` setting from the `Microsoft.NET.Test.Sdk` package. +* Simplify the use of the AltCover MSBuild tasks via the associated package-level `.targets` file by not even including the `VSTest` integration unless both `'$(AltCover)' == 'true' AND '$(IsTestProject)' == 'true'`. +* Mitigate instances of `System.IO.IOException: The process cannot access the file '[coverage report]' because it is being used by another process.` +* Explicitly add GAC locations to the paths inspected for dependency resolution + +# 8.8.10 (Habu series release 27) +* [BUGFIX] Add `Json` member to the report format enumerations for the typesafe API and for the `InvokeAltCover` cmdlet. +* [BUGFIX] Issue #214 : patch Mono.Cecil to use FIPS compliant algorithm +* [Enhancement] Discussion #206, maybe also Issue #203 : Option `--portable` and equivalent APIs to place the coverage report file and related coverage data in the same folder as the recorder assembly, wherever that might be, allowing the whole instrumented folder structure to be moved into another file structure (e.g. different machine, different OS). + +# 8.7.3 (Habu series release 26) +* [Enhancement] [Discussion 202](https://github.com/SteveGilham/altcover/discussions/202) : More careful tidying of temporary `.runsettings` files, fixing long-standing errors of both commission and omission. +* [Enhancement] [Discussion 199](https://github.com/SteveGilham/altcover/discussions/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! diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 8c4c226ad..398512407 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -3,42 +3,14 @@ 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 -# (Habu series release 33) +# (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 `AppDomain`s 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. -# 8.8.173 (Habu series release 32) -* [PERFORMANCE] Issue #227 - removing the slow-down observed the new (at 8.8.165) file name processing for Cobertura -* [PERFORMANCE] removing a surprising hot-spot in branch coverage instrumentation that was taking 60% of the whole instrumentation time - -# 8.8.165 (Habu series release 31) -* [ADVISORY] the Fake.build related assemblies (in the `altcover.api` and `altcover.fake` packages), and the Avalonia 0.10-based visualizer, rely on components with known vulnerabilities. The Fake.build project appears nigh-moribund so has not released an update, whereas Avalonia 11 completely rewrites all the earlier APIs and has not documented anything to assist in the rewrite of the application. -* [BUGFIX] Issue #197 - correctly split file paths in the Cobertura output -* [NET9 preparation] Recode the recorder into C# as compiler/build target changes in F#9 make maintaining net2.0 compatibility in F# too much bother. - -# 8.8.74 (Habu series release 30) -* [BUGFIX] Issue #222 - distinguish methods differing only in number of generic parameters (JSON and cobertura in particular, but with small changes for all all output formats) -* [BUGFIX] Issue #223 - handle degenerate source paths for Cobertura output - -# 8.8.53 (Habu series release 29) -* [BUGFIX] Fix summary data for `--outputFile` option -* [BUGFIX] Fix interaction of `--zipFile` prepare option and `--outputFile` collect option -* [BUGFIX] Issue #220 - improve dependency resolution to the GAC - -# 8.8.21 (Habu series release 28) -* [BREAKING; BUGFIX] Issue #206 : Update to net6+ for `dotnet test` integration and respect the `$(IsTestProject)` setting from the `Microsoft.NET.Test.Sdk` package. -* Simplify the use of the AltCover MSBuild tasks via the associated package-level `.targets` file by not even including the `VSTest` integration unless both `'$(AltCover)' == 'true' AND '$(IsTestProject)' == 'true'`. -* Mitigate instances of `System.IO.IOException: The process cannot access the file '[coverage report]' because it is being used by another process.` -* Explicitly add GAC locations to the paths inspected for dependency resolution - -# 8.8.10 (Habu series release 27) -* [BUGFIX] Add `Json` member to the report format enumerations for the typesafe API and for the `InvokeAltCover` cmdlet. -* [BUGFIX] Issue #214 : patch Mono.Cecil to use FIPS compliant algorithm -* [Enhancement] Discussion #206, maybe also Issue #203 : Option `--portable` and equivalent APIs to place the coverage report file and related coverage data in the same folder as the recorder assembly, wherever that might be, allowing the whole instrumented folder structure to be moved into another file structure (e.g. different machine, different OS). - -# 8.7.3 (Habu series release 26) -* [Enhancement] [Discussion 202](https://github.com/SteveGilham/altcover/discussions/202) : More careful tidying of temporary `.runsettings` files, fixing long-standing errors of both commission and omission. -* [Enhancement] [Discussion 199](https://github.com/SteveGilham/altcover/discussions/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. - -⁋For previous releases (8.6.125 and earlier) go here -- [https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md](https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md) \ No newline at end of file +⁋For previous releases (8.8.173 and earlier) go here -- [https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md](https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md) \ No newline at end of file diff --git a/Samples/Sample1/Sample1.csproj b/Samples/Sample1/Sample1.csproj index 5ce37ea51..a545deca1 100644 --- a/Samples/Sample1/Sample1.csproj +++ b/Samples/Sample1/Sample1.csproj @@ -2,7 +2,7 @@ Exe - net8.0;net20 + net9.0;net20 Sample1 false diff --git a/Samples/Sample10/Sample10.csproj b/Samples/Sample10/Sample10.csproj index 88a32b0c4..0c1c681d5 100644 --- a/Samples/Sample10/Sample10.csproj +++ b/Samples/Sample10/Sample10.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 false diff --git a/Samples/Sample12/Sample12.csproj b/Samples/Sample12/Sample12.csproj index c284f2576..df253b0a0 100644 --- a/Samples/Sample12/Sample12.csproj +++ b/Samples/Sample12/Sample12.csproj @@ -2,7 +2,7 @@ Exe - net8.0;net472 + net9.0;net472 Sample12 diff --git a/Samples/Sample13/Sample13.fsproj b/Samples/Sample13/Sample13.fsproj index 4ab131aa0..6cddd92a3 100644 --- a/Samples/Sample13/Sample13.fsproj +++ b/Samples/Sample13/Sample13.fsproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 false diff --git a/Samples/Sample14/Sample14/Sample14.csproj b/Samples/Sample14/Sample14/Sample14.csproj index 27aa2dc7e..fbbb05347 100644 --- a/Samples/Sample14/Sample14/Sample14.csproj +++ b/Samples/Sample14/Sample14/Sample14.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/Samples/Sample15/Sample15/Sample15.fsproj b/Samples/Sample15/Sample15/Sample15.fsproj index b92dbd392..4876f7c84 100644 --- a/Samples/Sample15/Sample15/Sample15.fsproj +++ b/Samples/Sample15/Sample15/Sample15.fsproj @@ -5,7 +5,7 @@ true Sample15 - + full false @@ -13,7 +13,7 @@ 3 bin\$(Configuration)\$(AssemblyName).XML - + pdbonly true @@ -21,19 +21,19 @@ 3 bin\$(Configuration)\$(AssemblyName).XML - + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - + - + - + contentfiles - + diff --git a/Samples/Sample16/Test/Test/Test.csproj b/Samples/Sample16/Test/Test/Test.csproj index 7866b0400..043986347 100644 --- a/Samples/Sample16/Test/Test/Test.csproj +++ b/Samples/Sample16/Test/Test/Test.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Major false diff --git a/Samples/Sample17/Sample17.fsproj b/Samples/Sample17/Sample17.fsproj index 5f5c1ec09..d841eb3cd 100644 --- a/Samples/Sample17/Sample17.fsproj +++ b/Samples/Sample17/Sample17.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 Sample17 diff --git a/Samples/Sample18/Sample18.fsproj b/Samples/Sample18/Sample18.fsproj index 9c6249cdc..f6a43723f 100644 --- a/Samples/Sample18/Sample18.fsproj +++ b/Samples/Sample18/Sample18.fsproj @@ -1,6 +1,6 @@  - net8.0;net472 + net9.0;net472 false Sample18 false diff --git a/Samples/Sample2/Sample2.fsproj b/Samples/Sample2/Sample2.fsproj index 194db6f9d..228651af2 100644 --- a/Samples/Sample2/Sample2.fsproj +++ b/Samples/Sample2/Sample2.fsproj @@ -1,7 +1,7 @@  - net8.0;net472 + net9.0;net472 Sample2 $(AssetTargetFallback);netcoreapp1.0; false diff --git a/Samples/Sample21/Sample21.csproj b/Samples/Sample21/Sample21.csproj index b37d6c9d7..8e94b914b 100644 --- a/Samples/Sample21/Sample21.csproj +++ b/Samples/Sample21/Sample21.csproj @@ -1,8 +1,8 @@ - + - net8.0;net472 + net9.0;net472 false diff --git a/Samples/Sample23/Sample23.csproj b/Samples/Sample23/Sample23.csproj index 9571c4904..964b4e9ac 100644 --- a/Samples/Sample23/Sample23.csproj +++ b/Samples/Sample23/Sample23.csproj @@ -1,7 +1,7 @@ - net472;net8.0 + net472;net9.0 false diff --git a/Samples/Sample24/Sample24.csproj b/Samples/Sample24/Sample24.csproj index 1fe5cc7d7..ed11343d6 100644 --- a/Samples/Sample24/Sample24.csproj +++ b/Samples/Sample24/Sample24.csproj @@ -1,7 +1,7 @@ - net472;net8.0 + net472;net9.0 false diff --git a/Samples/Sample26/Sample26.fsproj b/Samples/Sample26/Sample26.fsproj index 30a543b4d..deee40114 100644 --- a/Samples/Sample26/Sample26.fsproj +++ b/Samples/Sample26/Sample26.fsproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Sample26 false AnyCPU diff --git a/Samples/Sample27/Sample27.fsproj b/Samples/Sample27/Sample27.fsproj index cbb8b3229..4bb299078 100644 --- a/Samples/Sample27/Sample27.fsproj +++ b/Samples/Sample27/Sample27.fsproj @@ -1,7 +1,7 @@  - net472;net8.0 + net472;net9.0 false false diff --git a/Samples/Sample3/Class1.cs b/Samples/Sample3/Class1.cs index 6547b79a4..ccc300d92 100644 --- a/Samples/Sample3/Class1.cs +++ b/Samples/Sample3/Class1.cs @@ -51,7 +51,7 @@ public List ToList(T item) public int CoverageFormat { get; set; } public int Sample { get; set; } public Int64 Timer { get; set; } - public bool Defer { get; set; } + public bool Eager { get; set; } public static string[] Modules { get; set; } } diff --git a/Samples/Sample30/Sample30.fsproj b/Samples/Sample30/Sample30.fsproj index cbb8b3229..4bb299078 100644 --- a/Samples/Sample30/Sample30.fsproj +++ b/Samples/Sample30/Sample30.fsproj @@ -1,7 +1,7 @@  - net472;net8.0 + net472;net9.0 false false diff --git a/Samples/Sample32/Sample32.csproj b/Samples/Sample32/Sample32.csproj index 79f9caca1..40158812a 100644 --- a/Samples/Sample32/Sample32.csproj +++ b/Samples/Sample32/Sample32.csproj @@ -2,7 +2,7 @@ Exe - net472;net8.0 + net472;net9.0 diff --git a/Samples/Sample4/Sample4.fsproj b/Samples/Sample4/Sample4.fsproj index 456fcda6f..6332081dd 100644 --- a/Samples/Sample4/Sample4.fsproj +++ b/Samples/Sample4/Sample4.fsproj @@ -2,7 +2,7 @@ - net8.0;net472 + net9.0;net472 false Sample4 false @@ -49,6 +49,7 @@ contentfiles + diff --git a/Samples/Sample4/Sample4LongForm.fsproj b/Samples/Sample4/Sample4LongForm.fsproj index b108b2726..29306d64e 100644 --- a/Samples/Sample4/Sample4LongForm.fsproj +++ b/Samples/Sample4/Sample4LongForm.fsproj @@ -40,7 +40,10 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -60,8 +63,8 @@ - - + + diff --git a/Samples/Sample6/Sample6.fsproj b/Samples/Sample6/Sample6.fsproj index 851f17efc..f94da2ce3 100644 --- a/Samples/Sample6/Sample6.fsproj +++ b/Samples/Sample6/Sample6.fsproj @@ -1,11 +1,11 @@  - net8.0;net472 + net9.0;net472 Sample6 - + 52;44 diff --git a/Samples/Sample7/Sample7.fsproj b/Samples/Sample7/Sample7.fsproj index f3564be99..239a831c6 100644 --- a/Samples/Sample7/Sample7.fsproj +++ b/Samples/Sample7/Sample7.fsproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Sample7 false diff --git a/Samples/Sample8/Sample8.csproj b/Samples/Sample8/Sample8.csproj index 93336d721..dba6bc311 100644 --- a/Samples/Sample8/Sample8.csproj +++ b/Samples/Sample8/Sample8.csproj @@ -2,7 +2,7 @@ Exe - net8.0;net20 + net9.0;net20 Sample8 $(ProjectDir)../../AltCover/AltCover.ico embedded diff --git a/ThirdParty/BlackFox.CommandLine.dll b/ThirdParty/BlackFox.CommandLine.dll index d4a9855a4..3ca3b13be 100644 Binary files a/ThirdParty/BlackFox.CommandLine.dll and b/ThirdParty/BlackFox.CommandLine.dll differ diff --git a/ThirdParty/cecil.snk b/ThirdParty/cecil.snk deleted file mode 100644 index c0380d194..000000000 Binary files a/ThirdParty/cecil.snk and /dev/null differ diff --git a/ThirdParty/cecil/Mono.Cecil.Mdb.dll b/ThirdParty/cecil/Mono.Cecil.Mdb.dll deleted file mode 100644 index d2bde99b5..000000000 Binary files a/ThirdParty/cecil/Mono.Cecil.Mdb.dll and /dev/null differ diff --git a/ThirdParty/cecil/Mono.Cecil.Mdb.pdb b/ThirdParty/cecil/Mono.Cecil.Mdb.pdb deleted file mode 100644 index 402cc402e..000000000 Binary files a/ThirdParty/cecil/Mono.Cecil.Mdb.pdb and /dev/null differ diff --git a/ThirdParty/cecil/Mono.Cecil.Pdb.dll b/ThirdParty/cecil/Mono.Cecil.Pdb.dll deleted file mode 100644 index 86d3e3a8a..000000000 Binary files a/ThirdParty/cecil/Mono.Cecil.Pdb.dll and /dev/null differ diff --git a/ThirdParty/cecil/Mono.Cecil.Pdb.pdb b/ThirdParty/cecil/Mono.Cecil.Pdb.pdb deleted file mode 100644 index c13394b67..000000000 Binary files a/ThirdParty/cecil/Mono.Cecil.Pdb.pdb and /dev/null differ diff --git a/ThirdParty/cecil/Mono.Cecil.Rocks.dll b/ThirdParty/cecil/Mono.Cecil.Rocks.dll deleted file mode 100644 index a958ff9a9..000000000 Binary files a/ThirdParty/cecil/Mono.Cecil.Rocks.dll and /dev/null differ diff --git a/ThirdParty/cecil/Mono.Cecil.Rocks.pdb b/ThirdParty/cecil/Mono.Cecil.Rocks.pdb deleted file mode 100644 index 146d3fb73..000000000 Binary files a/ThirdParty/cecil/Mono.Cecil.Rocks.pdb and /dev/null differ diff --git a/ThirdParty/cecil/Mono.Cecil.dll b/ThirdParty/cecil/Mono.Cecil.dll deleted file mode 100644 index afac212f1..000000000 Binary files a/ThirdParty/cecil/Mono.Cecil.dll and /dev/null differ diff --git a/docs/AltCover.Base/AltCover.Base-apidoc.md b/docs/AltCover.Base/AltCover.Base-apidoc.md new file mode 100644 index 000000000..6c2a53272 --- /dev/null +++ b/docs/AltCover.Base/AltCover.Base-apidoc.md @@ -0,0 +1,3 @@ +# AltCover.Base assembly + + diff --git a/docs/AltCover.Cake/AltCover.Cake/CollectOptions-apidoc.md b/docs/AltCover.Cake/AltCover.Cake/CollectOptions-apidoc.md index 6af22c4ba..a87bee70d 100644 --- a/docs/AltCover.Cake/AltCover.Cake/CollectOptions-apidoc.md +++ b/docs/AltCover.Cake/AltCover.Cake/CollectOptions-apidoc.md @@ -17,6 +17,7 @@ public class CollectOptions | [ExposeReturnCode](CollectOptions/ExposeReturnCode-apidoc) { get; } | Gets whether to expose a program return code (overridden by the MSBuild integration) | | virtual [LcovReport](CollectOptions/LcovReport-apidoc) { get; } | Corresponds to command line option `-l, --lcovReport=VALUE` | | virtual [OutputFile](CollectOptions/OutputFile-apidoc) { get; } | Corresponds to command line option `-o, --outputFile=VALUE` | +| [Packages](CollectOptions/Packages-apidoc) { get; } | Corresponds to command line option `-p, --package=VALUE` | | [RecorderDirectory](CollectOptions/RecorderDirectory-apidoc) { get; } | Gets the recorder directory (overridden by the MSBuild integration) | | virtual [SummaryFormat](CollectOptions/SummaryFormat-apidoc) { get; } | Corresponds to command line option `--teamcity[=VALUE]` | | virtual [Threshold](CollectOptions/Threshold-apidoc) { get; } | Corresponds to command line option `-t, --threshold=VALUE` | diff --git a/docs/AltCover.Cake/AltCover.Cake/CollectOptions/Packages-apidoc.md b/docs/AltCover.Cake/AltCover.Cake/CollectOptions/Packages-apidoc.md new file mode 100644 index 000000000..9dce5e750 --- /dev/null +++ b/docs/AltCover.Cake/AltCover.Cake/CollectOptions/Packages-apidoc.md @@ -0,0 +1,14 @@ +# CollectOptions.Packages property + +Corresponds to command line option `-p, --package=VALUE` + +```csharp +public IEnumerable Packages { get; } +``` + +## See Also + +* class [CollectOptions](../CollectOptions-apidoc) +* namespace [AltCover.Cake](../../AltCover.Cake-apidoc) + + diff --git a/docs/AltCover.DotNet/AltCover/Options.Collect-apidoc.md b/docs/AltCover.DotNet/AltCover/Options.Collect-apidoc.md index 73f94acca..359f55379 100644 --- a/docs/AltCover.DotNet/AltCover/Options.Collect-apidoc.md +++ b/docs/AltCover.DotNet/AltCover/Options.Collect-apidoc.md @@ -15,6 +15,7 @@ public class Collect | [ExposeReturnCode](Options.Collect/ExposeReturnCode-apidoc) { get; set; } | | | [LcovReport](Options.Collect/LcovReport-apidoc) { get; set; } | | | [OutputFile](Options.Collect/OutputFile-apidoc) { get; set; } | | +| [Packages](Options.Collect/Packages-apidoc) { get; set; } | | | [RecorderDirectory](Options.Collect/RecorderDirectory-apidoc) { get; set; } | | | [SummaryFormat](Options.Collect/SummaryFormat-apidoc) { get; set; } | | | [Threshold](Options.Collect/Threshold-apidoc) { get; set; } | | diff --git a/docs/AltCover.DotNet/AltCover/Options.Collect/Packages-apidoc.md b/docs/AltCover.DotNet/AltCover/Options.Collect/Packages-apidoc.md new file mode 100644 index 000000000..46e04223f --- /dev/null +++ b/docs/AltCover.DotNet/AltCover/Options.Collect/Packages-apidoc.md @@ -0,0 +1,12 @@ +# Options.Collect.Packages property + +```csharp +public IEnumerable Packages { get; set; } +``` + +## See Also + +* class [Collect](../Options.Collect-apidoc) +* namespace [AltCover](../../AltCover.DotNet-apidoc) + + diff --git a/docs/AltCover.Engine/Abstract-fsapidoc.md b/docs/AltCover.Engine/Abstract-fsapidoc.md index 5829a372f..a67e6a0df 100644 --- a/docs/AltCover.Engine/Abstract-fsapidoc.md +++ b/docs/AltCover.Engine/Abstract-fsapidoc.md @@ -34,6 +34,7 @@ The members correspond to the like-named command line options for `AltCover Runn abstract member LcovReport : String with get abstract member Threshold : String with get abstract member Cobertura : String with get + abstract member Packages : IEnumerable with get abstract member OutputFile : String with get abstract member CommandLine : IEnumerable with get abstract member ExposeReturnCode : bool with get diff --git a/docs/AltCover.Engine/AltCover-fsapidoc.md b/docs/AltCover.Engine/AltCover-fsapidoc.md index e20c5931f..a6f79b603 100644 --- a/docs/AltCover.Engine/AltCover-fsapidoc.md +++ b/docs/AltCover.Engine/AltCover-fsapidoc.md @@ -55,6 +55,7 @@ The members correspond to the like-named command line options for `AltCover Runn member LcovReport : System.String member Threshold : System.String member Cobertura : System.String + member Packages : seq member OutputFile : System.String member CommandLine : seq member ExposeReturnCode : bool diff --git a/docs/AltCover.Engine/AltCover/Abstract.ICollectOptions-apidoc.md b/docs/AltCover.Engine/AltCover/Abstract.ICollectOptions-apidoc.md index 3dbdc5816..a9754d703 100644 --- a/docs/AltCover.Engine/AltCover/Abstract.ICollectOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Abstract.ICollectOptions-apidoc.md @@ -30,6 +30,7 @@ public interface ICollectOptions | [ExposeReturnCode](Abstract.ICollectOptions/ExposeReturnCode-apidoc) { get; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [LcovReport](Abstract.ICollectOptions/LcovReport-apidoc) { get; } | Corresponds to command line option `-l, --lcovReport=VALUE` | | [OutputFile](Abstract.ICollectOptions/OutputFile-apidoc) { get; } | Corresponds to command line option `-o, --outputFile=VALUE` | +| [Packages](Abstract.ICollectOptions/Packages-apidoc) { get; } | Corresponds to command line option `-p, --package=VALUE` | | [RecorderDirectory](Abstract.ICollectOptions/RecorderDirectory-apidoc) { get; } | Corresponds to command line option `-r, --recorderDirectory=VALUE` | | [SummaryFormat](Abstract.ICollectOptions/SummaryFormat-apidoc) { get; } | Corresponds to command line option `--teamcity[=VALUE]` | | [Threshold](Abstract.ICollectOptions/Threshold-apidoc) { get; } | Corresponds to command line option `-t, --threshold=VALUE` | diff --git a/docs/AltCover.Engine/AltCover/Abstract.ICollectOptions/Packages-apidoc.md b/docs/AltCover.Engine/AltCover/Abstract.ICollectOptions/Packages-apidoc.md new file mode 100644 index 000000000..310a6bfbe --- /dev/null +++ b/docs/AltCover.Engine/AltCover/Abstract.ICollectOptions/Packages-apidoc.md @@ -0,0 +1,14 @@ +# Abstract.ICollectOptions.Packages property + +Corresponds to command line option `-p, --package=VALUE` + +```csharp +public IEnumerable Packages { get; } +``` + +## See Also + +* interface [ICollectOptions](../Abstract.ICollectOptions-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/AltCover.CollectOptions-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.CollectOptions-apidoc.md index 2992d006a..29cbca340 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.CollectOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.CollectOptions-apidoc.md @@ -19,6 +19,7 @@ public abstract class CollectOptions : IEquatable, IStructuralEq | [ExposeReturnCode](AltCover.CollectOptions/ExposeReturnCode-apidoc) { get; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [LcovReport](AltCover.CollectOptions/LcovReport-apidoc) { get; } | Corresponds to command line option `-l, --lcovReport=VALUE` | | [OutputFile](AltCover.CollectOptions/OutputFile-apidoc) { get; } | Corresponds to command line option `-o, --outputFile=VALUE` | +| [Packages](AltCover.CollectOptions/Packages-apidoc) { get; } | Corresponds to command line option `-p, --package=VALUE` | | [RecorderDirectory](AltCover.CollectOptions/RecorderDirectory-apidoc) { get; } | Corresponds to command line option `-r, --recorderDirectory=VALUE` | | [SummaryFormat](AltCover.CollectOptions/SummaryFormat-apidoc) { get; } | Corresponds to command line option `--teamcity[=VALUE]` | | [Threshold](AltCover.CollectOptions/Threshold-apidoc) { get; } | Corresponds to command line option `-t, --threshold=VALUE` | diff --git a/docs/AltCover.Engine/AltCover/AltCover.CollectOptions/Packages-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.CollectOptions/Packages-apidoc.md new file mode 100644 index 000000000..7246124cf --- /dev/null +++ b/docs/AltCover.Engine/AltCover/AltCover.CollectOptions/Packages-apidoc.md @@ -0,0 +1,14 @@ +# AltCover.CollectOptions.Packages property + +Corresponds to command line option `-p, --package=VALUE` + +```csharp +public IEnumerable Packages { get; } +``` + +## See Also + +* class [CollectOptions](../AltCover.CollectOptions-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/Collect-apidoc.md b/docs/AltCover.Engine/AltCover/Collect-apidoc.md index 254d8278f..a12eae0b3 100644 --- a/docs/AltCover.Engine/AltCover/Collect-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Collect-apidoc.md @@ -17,6 +17,7 @@ public class Collect : Task | [ExposeReturnCode](Collect/ExposeReturnCode-apidoc) { get; set; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [LcovReport](Collect/LcovReport-apidoc) { get; set; } | Corresponds to command line option `-l, --lcovReport=VALUE` | | [OutputFile](Collect/OutputFile-apidoc) { get; set; } | Corresponds to command line option `-o, --outputFile=VALUE` | +| [Packages](Collect/Packages-apidoc) { get; set; } | Corresponds to command line option `-p, --package=VALUE` | | [RecorderDirectory](Collect/RecorderDirectory-apidoc) { get; set; } | Corresponds to command line option `-r, --recorderDirectory=VALUE`; a required parameter | | [Summary](Collect/Summary-apidoc) { get; } | Task output calue, the summary of coverage. | | [SummaryFormat](Collect/SummaryFormat-apidoc) { get; set; } | Corresponds to command line option `--teamcity[=VALUE]` | diff --git a/docs/AltCover.Engine/AltCover/Collect/Packages-apidoc.md b/docs/AltCover.Engine/AltCover/Collect/Packages-apidoc.md new file mode 100644 index 000000000..7ecdedf0f --- /dev/null +++ b/docs/AltCover.Engine/AltCover/Collect/Packages-apidoc.md @@ -0,0 +1,14 @@ +# Collect.Packages property + +Corresponds to command line option `-p, --package=VALUE` + +```csharp +public string[] Packages { get; set; } +``` + +## See Also + +* class [Collect](../Collect-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/Primitive.CollectOptions-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.CollectOptions-apidoc.md index 987f84974..aa0225605 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.CollectOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.CollectOptions-apidoc.md @@ -18,6 +18,7 @@ public sealed class CollectOptions : IEquatable, IStructuralEqua | [ExposeReturnCode](Primitive.CollectOptions/ExposeReturnCode-apidoc) { get; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [LcovReport](Primitive.CollectOptions/LcovReport-apidoc) { get; } | Corresponds to command line option `-l, --lcovReport=VALUE` | | [OutputFile](Primitive.CollectOptions/OutputFile-apidoc) { get; } | Corresponds to command line option `-o, --outputFile=VALUE` | +| [Packages](Primitive.CollectOptions/Packages-apidoc) { get; } | Corresponds to command line option `-p, --package=VALUE` | | [RecorderDirectory](Primitive.CollectOptions/RecorderDirectory-apidoc) { get; } | Corresponds to command line option `-r, --recorderDirectory=VALUE` | | [SummaryFormat](Primitive.CollectOptions/SummaryFormat-apidoc) { get; } | Corresponds to command line option `--teamcity[=VALUE]` | | [Threshold](Primitive.CollectOptions/Threshold-apidoc) { get; } | Corresponds to command line option `-t, --threshold=VALUE` | diff --git a/docs/AltCover.Engine/AltCover/Primitive.CollectOptions/CollectOptions-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.CollectOptions/CollectOptions-apidoc.md index 807222c1a..3d76d2e5c 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.CollectOptions/CollectOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.CollectOptions/CollectOptions-apidoc.md @@ -2,9 +2,9 @@ ```csharp public CollectOptions(string recorderDirectory, string workingDirectory, string executable, - string lcovReport, string threshold, string cobertura, string outputFile, - IEnumerable commandLine, bool exposeReturnCode, string summaryFormat, - TraceLevel verbosity) + string lcovReport, string threshold, string cobertura, IEnumerable packages, + string outputFile, IEnumerable commandLine, bool exposeReturnCode, + string summaryFormat, TraceLevel verbosity) ``` ## See Also diff --git a/docs/AltCover.Engine/AltCover/Primitive.CollectOptions/Packages-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.CollectOptions/Packages-apidoc.md new file mode 100644 index 000000000..f54a33a4d --- /dev/null +++ b/docs/AltCover.Engine/AltCover/Primitive.CollectOptions/Packages-apidoc.md @@ -0,0 +1,14 @@ +# Primitive.CollectOptions.Packages property + +Corresponds to command line option `-p, --package=VALUE` + +```csharp +public IEnumerable Packages { get; } +``` + +## See Also + +* class [CollectOptions](../Primitive.CollectOptions-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe-apidoc.md index 7dd9526d5..4db625905 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe-apidoc.md @@ -22,6 +22,8 @@ public static class TypeSafe | abstract class [FilterItem](TypeSafe.FilterItem-apidoc) | Corresponds to a filter entry | | abstract class [Filters](TypeSafe.Filters-apidoc) | Corresponds to a collection of filter entries | | abstract class [Flag](TypeSafe.Flag-apidoc) | Corresponds to a yes/no choice | +| class [Package](TypeSafe.Package-apidoc) | Corresponds to a cobertura package source root | +| abstract class [Packages](TypeSafe.Packages-apidoc) | Corresponds to a collection of cobertura package source roots | | class [PrepareOptions](TypeSafe.PrepareOptions-apidoc) | Command line options for `AltCover` | | class [ReportFormat](TypeSafe.ReportFormat-apidoc) | Corresponds to the desired format of the XML report | | class [StaticFormat](TypeSafe.StaticFormat-apidoc) | Corresponds to a an option for treating trivial methods | diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions-apidoc.md index ce5f32d2b..b1ddd12b4 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions-apidoc.md @@ -18,6 +18,7 @@ public sealed class CollectOptions : IEquatable, IStructuralEqua | [ExposeReturnCode](TypeSafe.CollectOptions/ExposeReturnCode-apidoc) { get; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [LcovReport](TypeSafe.CollectOptions/LcovReport-apidoc) { get; } | Corresponds to command line option `-l, --lcovReport=VALUE` | | [OutputFile](TypeSafe.CollectOptions/OutputFile-apidoc) { get; } | Corresponds to command line option `-o, --outputFile=VALUE` | +| [Packages](TypeSafe.CollectOptions/Packages-apidoc) { get; } | Corresponds to command line option `-p, --package=VALUE` | | [RecorderDirectory](TypeSafe.CollectOptions/RecorderDirectory-apidoc) { get; } | Corresponds to command line option `-r, --recorderDirectory=VALUE` | | [SummaryFormat](TypeSafe.CollectOptions/SummaryFormat-apidoc) { get; } | Corresponds to command line option `--teamcity[=VALUE]` | | [Threshold](TypeSafe.CollectOptions/Threshold-apidoc) { get; } | Corresponds to command line option `-t, --threshold=VALUE` | diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions/CollectOptions-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions/CollectOptions-apidoc.md index 769c0db2b..2172f6cbb 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions/CollectOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions/CollectOptions-apidoc.md @@ -3,7 +3,7 @@ ```csharp public CollectOptions(DirectoryPath recorderDirectory, DirectoryPath workingDirectory, FilePath executable, FilePath lcovReport, Threshold threshold, FilePath cobertura, - FilePath outputFile, CommandLine commandLine, Flag exposeReturnCode, + Packages packages, FilePath outputFile, CommandLine commandLine, Flag exposeReturnCode, SummaryFormat summaryFormat, TraceLevel verbosity) ``` @@ -12,6 +12,7 @@ public CollectOptions(DirectoryPath recorderDirectory, DirectoryPath workingDire * class [DirectoryPath](../TypeSafe.DirectoryPath-apidoc) * class [FilePath](../TypeSafe.FilePath-apidoc) * class [Threshold](../TypeSafe.Threshold-apidoc) +* class [Packages](../TypeSafe.Packages-apidoc) * class [CommandLine](../TypeSafe.CommandLine-apidoc) * class [Flag](../TypeSafe.Flag-apidoc) * class [SummaryFormat](../TypeSafe.SummaryFormat-apidoc) diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions/Packages-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions/Packages-apidoc.md new file mode 100644 index 000000000..bcba389af --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.CollectOptions/Packages-apidoc.md @@ -0,0 +1,15 @@ +# TypeSafe.CollectOptions.Packages property + +Corresponds to command line option `-p, --package=VALUE` + +```csharp +public Packages Packages { get; } +``` + +## See Also + +* class [Packages](../TypeSafe.Packages-apidoc) +* class [CollectOptions](../TypeSafe.CollectOptions-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Package-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Package-apidoc.md new file mode 100644 index 000000000..ae1d4a2a4 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Package-apidoc.md @@ -0,0 +1,20 @@ +# TypeSafe.Package class + +Corresponds to a value after `-- ` on the command line + +```csharp +public sealed class Package : IEquatable, IStructuralEquatable +``` + +## Public Members + +| name | description | +| --- | --- | +| static [NewPackage](TypeSafe.Package/NewPackage-apidoc)(…) | | +| [AsString](TypeSafe.Package/AsString-apidoc)() | Returns the string to be used as a package root | +## See Also + +* class [TypeSafe](./TypeSafe-apidoc) +* namespace [AltCover](../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Package/AsString-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Package/AsString-apidoc.md new file mode 100644 index 000000000..c6caead84 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Package/AsString-apidoc.md @@ -0,0 +1,18 @@ +# TypeSafe.Package.AsString method + +Returns the string to be used as a package root + +```csharp +public string AsString() +``` + +## Return Value + +the string to be used as a package root + +## See Also + +* class [Package](../TypeSafe.Package-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Package/NewPackage-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Package/NewPackage-apidoc.md new file mode 100644 index 000000000..5f78e85cd --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Package/NewPackage-apidoc.md @@ -0,0 +1,12 @@ +# TypeSafe.Package.NewPackage method + +```csharp +public static Package NewPackage(string item) +``` + +## See Also + +* class [Package](../TypeSafe.Package-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages-apidoc.md new file mode 100644 index 000000000..6a7e0c110 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages-apidoc.md @@ -0,0 +1,24 @@ +# TypeSafe.Packages class + +Corresponds to the values after `-- ` on the command line + +```csharp +public abstract class Packages : IEquatable, IStructuralEquatable +``` + +## Public Members + +| name | description | +| --- | --- | +| static [get_NoPackage](TypeSafe.Packages/get_NoPackage-apidoc)() | | +| static [NewPackages](TypeSafe.Packages/NewPackages-apidoc)(…) | | +| [AsStrings](TypeSafe.Packages/AsStrings-apidoc)() | Returns the strings to be used to be used as package roots | +| class [Packages](TypeSafe.Packages.Packages-apidoc) | Strongly typed string collection | +| static class [Tags](TypeSafe.Packages.Tags-apidoc) | | + +## See Also + +* class [TypeSafe](./TypeSafe-apidoc) +* namespace [AltCover](../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Packages-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Packages-apidoc.md new file mode 100644 index 000000000..fd8a85e25 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Packages-apidoc.md @@ -0,0 +1,14 @@ +# TypeSafe.Packages.Packages class + +Strongly typed string collection + +```csharp +public class Packages : Packages +``` + +## See Also + +* class [Packages](./TypeSafe.Packages-apidoc) +* namespace [AltCover](../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags-apidoc.md new file mode 100644 index 000000000..e51fd8a9d --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags-apidoc.md @@ -0,0 +1,19 @@ +# TypeSafe.Packages.Tags class + +```csharp +public static class Tags +``` + +## Public Members + +| name | description | +| --- | --- | +| const [NoPackage](TypeSafe.Packages.Tags/NoPackage-apidoc) | | +| const [Packages](TypeSafe.Packages.Tags/Packages-apidoc) | | + +## See Also + +* class [Packages](./TypeSafe.Packages-apidoc) +* namespace [AltCover](../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags/NoPackage-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags/NoPackage-apidoc.md new file mode 100644 index 000000000..e9d5cb123 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags/NoPackage-apidoc.md @@ -0,0 +1,12 @@ +# TypeSafe.Packages.Tags.NoPackage field + +```csharp +public const int NoPackage; +``` + +## See Also + +* class [Tags](../TypeSafe.Packages.Tags-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags/Packages-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags/Packages-apidoc.md new file mode 100644 index 000000000..990bd2daa --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages.Tags/Packages-apidoc.md @@ -0,0 +1,12 @@ +# TypeSafe.Packages.Tags.Packages field + +```csharp +public const int Packages; +``` + +## See Also + +* class [Tags](../TypeSafe.Packages.Tags-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages/AsStrings-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages/AsStrings-apidoc.md new file mode 100644 index 000000000..091e85990 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages/AsStrings-apidoc.md @@ -0,0 +1,18 @@ +# TypeSafe.Packages.AsStrings method + +Returns the strings to be used to be used as package roots + +```csharp +public IEnumerable AsStrings() +``` + +## Return Value + +the strings to be used to be used as package roots + +## See Also + +* class [Packages](../TypeSafe.Packages-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages/NewPackages-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages/NewPackages-apidoc.md new file mode 100644 index 000000000..428821561 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages/NewPackages-apidoc.md @@ -0,0 +1,13 @@ +# TypeSafe.Packages.NewPackages method + +```csharp +public static Packages NewPackages(IEnumerable item) +``` + +## See Also + +* class [Package](../TypeSafe.Package-apidoc) +* class [Packages](../TypeSafe.Packages-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.Packages/get_NoPackage-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.Packages/get_NoPackage-apidoc.md new file mode 100644 index 000000000..ae1375032 --- /dev/null +++ b/docs/AltCover.Engine/AltCover/TypeSafe.Packages/get_NoPackage-apidoc.md @@ -0,0 +1,12 @@ +# TypeSafe.Packages.get_NoPackage method + +```csharp +public static Packages get_NoPackage() +``` + +## See Also + +* class [Packages](../TypeSafe.Packages-apidoc) +* namespace [AltCover](../../AltCover.Engine-apidoc) + + diff --git a/docs/AltCover.Engine/Primitive-fsapidoc.md b/docs/AltCover.Engine/Primitive-fsapidoc.md index e51a65c74..d3d651d3e 100644 --- a/docs/AltCover.Engine/Primitive-fsapidoc.md +++ b/docs/AltCover.Engine/Primitive-fsapidoc.md @@ -36,6 +36,7 @@ The members correspond to the like-named command line options for `AltCover Runn LcovReport: System.String Threshold: System.String Cobertura: System.String + Packages : seq OutputFile: System.String CommandLine: seq ExposeReturnCode: bool diff --git a/docs/AltCover.Engine/Tasks-fsapidoc.md b/docs/AltCover.Engine/Tasks-fsapidoc.md index eb7a07880..3d3f35839 100644 --- a/docs/AltCover.Engine/Tasks-fsapidoc.md +++ b/docs/AltCover.Engine/Tasks-fsapidoc.md @@ -75,6 +75,7 @@ type Collect = member LcovReport : string with get, set member Threshold : string with get, set member Cobertura : string with get, set + member Packages : string array with get, set member OutputFile : string with get, set member CommandLine : string array with get, set member ExposeReturnCode : bool with get, set diff --git a/docs/AltCover.Engine/TypeSafe-fsapidoc.md b/docs/AltCover.Engine/TypeSafe-fsapidoc.md index 94027c493..4e56884a5 100644 --- a/docs/AltCover.Engine/TypeSafe-fsapidoc.md +++ b/docs/AltCover.Engine/TypeSafe-fsapidoc.md @@ -54,6 +54,22 @@ This holds the strongly-typed equivalent of the command line options member AsStrings : unit -> seq end ``` +### Cobertura package roots +``` + [] + type Package = + | Package of System.String + with + member AsString : unit -> System.String + end + [] + type Packages = + | Packages of seq + | NoPackage + with + member AsStrings : unit -> seq + end +``` ### Coverage thresholds ``` [] @@ -193,6 +209,7 @@ The members correspond to the like-named command line options for `AltCover Runn LcovReport: FilePath Threshold: Threshold Cobertura: FilePath + Packages : Packages OutputFile: FilePath CommandLine: CommandLine ExposeReturnCode: Flag diff --git a/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md b/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md index 2f4dbaac5..153f0cf76 100644 --- a/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md +++ b/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md @@ -34,6 +34,7 @@ The members correspond to the like-named command line options for `AltCover Runn abstract member LcovReport : String with get abstract member Threshold : String with get abstract member Cobertura : String with get + abstract member Packages : IEnumerable with get abstract member OutputFile : String with get abstract member CommandLine : IEnumerable with get abstract member ExposeReturnCode : bool with get diff --git a/docs/AltCover.Fake.DotNet.Testing.AltCover/AltCover-fsapidoc.md b/docs/AltCover.Fake.DotNet.Testing.AltCover/AltCover-fsapidoc.md index 9a1cfa14d..fc9fa3250 100644 --- a/docs/AltCover.Fake.DotNet.Testing.AltCover/AltCover-fsapidoc.md +++ b/docs/AltCover.Fake.DotNet.Testing.AltCover/AltCover-fsapidoc.md @@ -68,6 +68,7 @@ The members correspond to the like-named command line options for `AltCover Runn member LcovReport : System.String member Threshold : System.String member Cobertura : System.String + member Packages : seq member OutputFile : System.String member CommandLine : seq member ExposeReturnCode : bool diff --git a/docs/AltCover.Fake.DotNet.Testing.AltCover/Primitive-fsapidoc.md b/docs/AltCover.Fake.DotNet.Testing.AltCover/Primitive-fsapidoc.md index ec143d25e..ed9f1ceaf 100644 --- a/docs/AltCover.Fake.DotNet.Testing.AltCover/Primitive-fsapidoc.md +++ b/docs/AltCover.Fake.DotNet.Testing.AltCover/Primitive-fsapidoc.md @@ -36,6 +36,7 @@ The members correspond to the like-named command line options for `AltCover Runn LcovReport: System.String Threshold: System.String Cobertura: System.String + Packages : seq OutputFile: System.String CommandLine: seq ExposeReturnCode: bool diff --git a/docs/AltCover.Fake.DotNet.Testing.AltCover/TypeSafe-fsapidoc.md b/docs/AltCover.Fake.DotNet.Testing.AltCover/TypeSafe-fsapidoc.md index 68f59fa7f..c0d73a077 100644 --- a/docs/AltCover.Fake.DotNet.Testing.AltCover/TypeSafe-fsapidoc.md +++ b/docs/AltCover.Fake.DotNet.Testing.AltCover/TypeSafe-fsapidoc.md @@ -54,6 +54,22 @@ This holds the strongly-typed equivalent of the command line options member AsStrings : unit -> seq end ``` +### Cobertura package roots +``` + [] + type Package = + | Package of System.String + with + member AsString : unit -> System.String + end + [] + type Packages = + | Packages of seq + | NoPackage + with + member AsStrings : unit -> seq + end +``` ### Coverage thresholds ``` [] @@ -193,6 +209,7 @@ The members correspond to the like-named command line options for `AltCover Runn LcovReport: FilePath Threshold: Threshold Cobertura: FilePath + Packages : Packages OutputFile: FilePath CommandLine: CommandLine ExposeReturnCode: Flag diff --git a/docs/AltCover.PowerShell/AltCover.Commands/ConvertToCoberturaCommand-apidoc.md b/docs/AltCover.PowerShell/AltCover.Commands/ConvertToCoberturaCommand-apidoc.md index 90089bfa6..0ed8dfe7f 100644 --- a/docs/AltCover.PowerShell/AltCover.Commands/ConvertToCoberturaCommand-apidoc.md +++ b/docs/AltCover.PowerShell/AltCover.Commands/ConvertToCoberturaCommand-apidoc.md @@ -21,6 +21,7 @@ public class ConvertToCoberturaCommand : PSCmdlet | [ConvertToCoberturaCommand](ConvertToCoberturaCommand/ConvertToCoberturaCommand-apidoc)() | The default constructor. | | [InputFile](ConvertToCoberturaCommand/InputFile-apidoc) { get; set; } | Input as file path | | [OutputFile](ConvertToCoberturaCommand/OutputFile-apidoc) { get; set; } | Output as file path | +| [Package](ConvertToCoberturaCommand/Package-apidoc) { get; set; } | Package source roots | | [XDocument](ConvertToCoberturaCommand/XDocument-apidoc) { get; set; } | Input as `XDocument` value | | override [ProcessRecord](ConvertToCoberturaCommand/ProcessRecord-apidoc)() | Create transformed document | diff --git a/docs/AltCover.PowerShell/AltCover.Commands/ConvertToCoberturaCommand/Package-apidoc.md b/docs/AltCover.PowerShell/AltCover.Commands/ConvertToCoberturaCommand/Package-apidoc.md new file mode 100644 index 000000000..6b3645682 --- /dev/null +++ b/docs/AltCover.PowerShell/AltCover.Commands/ConvertToCoberturaCommand/Package-apidoc.md @@ -0,0 +1,14 @@ +# ConvertToCoberturaCommand.Package property + +Package source roots + +```csharp +public string[] Package { get; set; } +``` + +## See Also + +* class [ConvertToCoberturaCommand](../ConvertToCoberturaCommand-apidoc) +* namespace [AltCover.Commands](../../AltCover.PowerShell-apidoc) + + diff --git a/docs/AltCover.PowerShell/AltCover.Commands/InvokeAltCoverCommand-apidoc.md b/docs/AltCover.PowerShell/AltCover.Commands/InvokeAltCoverCommand-apidoc.md index fdc0714e0..1e1fc1a85 100644 --- a/docs/AltCover.PowerShell/AltCover.Commands/InvokeAltCoverCommand-apidoc.md +++ b/docs/AltCover.PowerShell/AltCover.Commands/InvokeAltCoverCommand-apidoc.md @@ -49,6 +49,7 @@ public class InvokeAltCoverCommand : PSCmdlet | [MethodTopLevel](InvokeAltCoverCommand/MethodTopLevel-apidoc) { get; set; } | Names to mark a function as "top level" | | [OutputDirectory](InvokeAltCoverCommand/OutputDirectory-apidoc) { get; set; } | Folder or folders to receive the instrumented assemblies and their companions (default: sub-folder `__Instrumented` of the current directory; or `__Saved` if `-Inplace` is set). | | [OutputFile](InvokeAltCoverCommand/OutputFile-apidoc) { get; set; } | Write the recorded coverage to this file rather than overwriting the original report file. | +| [Package](InvokeAltCoverCommand/Package-apidoc) { get; set; } | Package roots for cobertura reports | | [PathFilter](InvokeAltCoverCommand/PathFilter-apidoc) { get; set; } | Source file paths to exclude from instrumentation | | [Portable](InvokeAltCoverCommand/Portable-apidoc) { get; set; } | Portable operation - coverage report, control file and recorded data co-located with the recorder assembly | | [RecorderDirectory](InvokeAltCoverCommand/RecorderDirectory-apidoc) { get; set; } | The folder containing the instrumented code to monitor (including the `AltCover.Recorder.g.dll` generated by previous a use of the .net core `AltCover`). | diff --git a/docs/AltCover.PowerShell/AltCover.Commands/InvokeAltCoverCommand/Package-apidoc.md b/docs/AltCover.PowerShell/AltCover.Commands/InvokeAltCoverCommand/Package-apidoc.md new file mode 100644 index 000000000..fd564e98a --- /dev/null +++ b/docs/AltCover.PowerShell/AltCover.Commands/InvokeAltCoverCommand/Package-apidoc.md @@ -0,0 +1,14 @@ +# InvokeAltCoverCommand.Package property + +Package roots for cobertura reports + +```csharp +public string[] Package { get; set; } +``` + +## See Also + +* class [InvokeAltCoverCommand](../InvokeAltCoverCommand-apidoc) +* namespace [AltCover.Commands](../../AltCover.PowerShell-apidoc) + + diff --git a/docs/AltCover.Toolkit/AltCover/CoverageFormats/ConvertToCobertura-apidoc.md b/docs/AltCover.Toolkit/AltCover/CoverageFormats/ConvertToCobertura-apidoc.md index 6dbaefef4..1e22887d4 100644 --- a/docs/AltCover.Toolkit/AltCover/CoverageFormats/ConvertToCobertura-apidoc.md +++ b/docs/AltCover.Toolkit/AltCover/CoverageFormats/ConvertToCobertura-apidoc.md @@ -7,12 +7,13 @@ Takes either OpenCover or classic NCover format input as an `XDocument`, as an a Writes the Cobertura report to the object pipeline as an `XDocument`, and optionally to a file. ```csharp -public static XDocument ConvertToCobertura(XDocument document) +public static XDocument ConvertToCobertura(XDocument document, IEnumerable packages) ``` | parameter | description | | --- | --- | | document | The report to convert. | +| packages | Possibly empty list of package root folders. | ## Return Value diff --git a/docs/AltCover.Toolkit/CoverageFormats-fsapidoc.md b/docs/AltCover.Toolkit/CoverageFormats-fsapidoc.md index ebaed643c..55929b4c2 100644 --- a/docs/AltCover.Toolkit/CoverageFormats-fsapidoc.md +++ b/docs/AltCover.Toolkit/CoverageFormats-fsapidoc.md @@ -13,7 +13,7 @@ namespace AltCover document:System.Xml.Linq.XDocument -> stream:System.IO.Stream -> unit val ConvertToCobertura : - document:System.Xml.Linq.XDocument -> System.Xml.Linq.XDocument + document:System.Xml.Linq.XDocument -> packages : string seq -> System.Xml.Linq.XDocument val ConvertToJson : document:System.Xml.Linq.XDocument -> string diff --git a/docs/PowerShell-integration.md b/docs/PowerShell-integration.md index c0cebce57..ff24e5f79 100644 --- a/docs/PowerShell-integration.md +++ b/docs/PowerShell-integration.md @@ -567,9 +567,9 @@ Creates a Cobertura format report from other report formats. SYNTAX ``` -ConvertTo-Cobertura [-XDocument] [[-OutputFile] ] [] +ConvertTo-Cobertura [-XDocument] [[-OutputFile] ] [[-Package] ] [] -ConvertTo-Cobertura [-InputFile] [[-OutputFile] ] [] +ConvertTo-Cobertura [-InputFile] [[-OutputFile] ] [[-Package] ] [] ``` @@ -615,6 +615,17 @@ Accept pipeline input? false Accept wildcard characters? false ``` +#### `-Package ` +Output as file path + +``` +Required? false +Position? 2 +Default value +Accept pipeline input? false +Accept wildcard characters? false +``` + #### `` This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, @@ -1114,9 +1125,9 @@ SYNTAX ``` Invoke-AltCover [-Runner] -RecorderDirectory [-Cobertura ] [-CommandLine ] [-DropReturnCode ] [-Executable ] [-LcovReport -] [-OutputFile ] [-SummaryFormat {Default | N | O | C | R | B | RPlus | BPlus}] -[-Threshold ] [-Verbosity {Off | Error | Warning | Info | Verbose}] [-WorkingDirectory -] [] +] [-OutputFile ] [-Package ] [-SummaryFormat {Default | N | O | C | R | B +| RPlus | BPlus}] [-Threshold ] [-Verbosity {Off | Error | Warning | Info | Verbose}] +[-WorkingDirectory ] [] Invoke-AltCover [-AssemblyExcludeFilter ] [-AssemblyFilter ] [-AttributeFilter ] [-AttributeTopLevel ] [-BranchCover ] [-CallContext @@ -1239,6 +1250,17 @@ Accept pipeline input? false Accept wildcard characters? false ``` +#### `-Package ` +Package roots for cobertura reports + +``` +Required? false +Position? named +Default value +Accept pipeline input? false +Accept wildcard characters? false +``` + #### `-OutputFile ` Write the recorded coverage to this file rather than overwriting the original report file. diff --git a/docs/Usage.md b/docs/Usage.md index a8f182b7d..b5750cb3e 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -10,7 +10,7 @@ The full command line is ``` AltCover [/i[nputDirectory]=VALUE] [/o[utputDirectory]=VALUE] [/y|symbolDirectory=VALUE] [/d[ependency]=VALUE] [/k[ey]=VALUE] [/sn|strongNameKey=VALUE] [/r[eport]=VALUE] [/f[ileFilter]=VALUE] [/p[athFilter]=VALUE] [/s|assemblyFilter=VALUE] [/e|assemblyExcludeFilter=VALUE] [/t[ypeFilter]=VALUE] [/m[ethodFilter]=VALUE] [/a[ttributeFilter]=VALUE] [/attributetoplevel=VALUE] [/typetoplevel=VALUE] [/methodtoplevel=VALUE] [--l[ocalSource]] [/c[allContext]=VALUE] [/reportFormat=VALUE] [--inplace] [--save] [--zipfile] [--methodpoint] [--single] [--linecover] [--branchcover] [--dropReturnCode] [--sourcelink] [--defer] [--v[isibleBranches]] [/showstatic[=VALUE]] [--showGenerated] [--trivia] [--portable] [-q] [--verbose] [--?|help|h] [-- ] [...] or -AltCover Runner [/r[ecorderDirectory]=VALUE] [/w[orkingDirectory]=VALUE] [/x|executable=VALUE] [--collect] [/l[covReport]=VALUE] [/t[hreshold]=VALUE] [/c[obertura]=VALUE] [/o[utputFile]=VALUE] [--dropReturnCode] [/summary|teamcity[=VALUE]] [-q] [--verbose] [--?|help|h] [-- ] [...] +AltCover Runner [/r[ecorderDirectory]=VALUE] [/w[orkingDirectory]=VALUE] [/x|executable=VALUE] [--collect] [/l[covReport]=VALUE] [/t[hreshold]=VALUE] [/c[obertura]=VALUE] [/p[ackage]=VALUE] [/o[utputFile]=VALUE] [--dropReturnCode] [/summary|teamcity[=VALUE]] [-q] [--verbose] [--?|help|h] [-- ] [...] or AltCover ImportModule or @@ -181,6 +181,8 @@ or such methods. -c, --cobertura=VALUE Optional: File for Cobertura format version of the collected data + -p, --package=VALUE Optional, multiple: package root path for + Cobertura reports -o, --outputFile=VALUE Optional: write the recorded coverage to this file rather than overwriting the original report file. --dropReturnCode Optional: Do not report any non-zero return code diff --git a/docs/`dotnet-test`-integration.md b/docs/`dotnet-test`-integration.md index a0718636f..844d93f31 100644 --- a/docs/`dotnet-test`-integration.md +++ b/docs/`dotnet-test`-integration.md @@ -54,6 +54,7 @@ And if you want more control over what happens to the files, then is is still po * `/p:AltCoverCobertura=`"path to cobertura format result" * `/p:AltCoverThreshold=`"coverage threshold required" * `/p:AltCoverSummaryFormat=[BROCN+]` one or more of TeamCity Block format/TeamCity bRanch format/Classic OpenCover/CRAP score or none at all; `+` means the same as `OC` which is also the default +* `/p:AltCoverPackages=`"pipe `'|'` separated list of source root paths" * `/p:AltCoverVerbosity=`"Levels of output -- Verbose, Info (default), Warning, Error, or Off" * `/p:AltCoverShowSummary=true|[ConsoleColor]` to echo the coverage summary to stdout (in the colour of choice, modulo what else your build process might be doing) if the string is a valid ConsoleColor name) N.B. if this option is present, with any non-empty value then the summary will be echoed * `/p:AltCoverForce=true|false` to force delete any left-over `__Instrumented*` (or `__Saved*`, if `InPlace` is set) folders from previous runs diff --git a/global.json b/global.json index d66f18b16..f15a95928 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.400", + "version": "9.0.100", "rollForward": "latestMinor" } } \ No newline at end of file diff --git a/nupkg/build/AltCover.proj b/nupkg/build/AltCover.proj index 9572421db..9dc02c1c2 100644 --- a/nupkg/build/AltCover.proj +++ b/nupkg/build/AltCover.proj @@ -75,7 +75,7 @@ CallContext="$(AltCoverCallContext.Split('|'))" ZipFile="$(AltCoverZipFile)" MethodPoint="$(AltCoverMethodPoint)" - SingleVisit="$(AltCoverSingle)" + All="$(AltCoverAll)" LineCover="$(AltCoverLineCover)" BranchCover="$(AltCoverBranchCover)" SourceLink="$(AltCoverSourceLink)" diff --git a/nupkg/build/AltCover.targets b/nupkg/build/AltCover.targets index 3ad15aa5a..7942a0080 100644 --- a/nupkg/build/AltCover.targets +++ b/nupkg/build/AltCover.targets @@ -1,7 +1,7 @@ - $(MSBuildThisFileDirectory)../tools/netcoreapp2.0/AltCover.Engine.dll + $(MSBuildThisFileDirectory)../tools/net8.0/AltCover.Engine.dll $(MSBuildThisFileDirectory)../lib/netstandard2.0/AltCover.Engine.dll $(AltCoverNetStdEngine) $(AltCoverNetCoreEngine) diff --git a/version.json b/version.json index 80a08a5a4..b9b24418b 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "8.9", + "version": "9.0", "release": { "branchName": "release/v{version}", "versionIncrement": "build",