diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index a5f348b8c..41e34d446 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-reportgenerator-globaltool": { - "version": "5.2.0", + "version": "5.2.2", "commands": [ "reportgenerator" ] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d58915bf3..5c831acdd 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.100' + dotnet-version: '8.0.202' - 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.100' + dotnet-version: '8.0.202' - name: Tools run: dotnet tool restore - name: Setup diff --git a/AltCover.Api.Tests/FSApiTests.fs b/AltCover.Api.Tests/FSApiTests.fs index a26eef427..787ed7061 100644 --- a/AltCover.Api.Tests/FSApiTests.fs +++ b/AltCover.Api.Tests/FSApiTests.fs @@ -1183,9 +1183,9 @@ module FSApiTests = // not input and output directories (inplace now allowed) testWithFallback - <@ (prepareFragments) |> List.length = ((prepareNames |> List.length) - 2) @> + <@ (prepareFragments) |> List.length = ((prepareNames |> List.length) - 1) @> (prepareFragments |> List.length) - (Is.EqualTo((prepareNames |> List.length) - 2)) + (Is.EqualTo((prepareNames |> List.length) - 1)) let collect = doc.Descendants() @@ -1305,6 +1305,16 @@ module FSApiTests = DotNet.ToTestArguments prep coll combined = "/p:AltCover=\"true\" /p:AltCoverReportFormat=\"OpenCover\" /p:AltCoverShowStatic=\"-\" /p:AltCoverShowSummary=\"R\" /p:AltCoverForce=\"true\" /p:AltCoverFailFast=\"true\"" @> + let tprep = TypeSafe.PrepareOptions.Create() + + let prep2 = + AltCover.PrepareOptions.TypeSafe tprep + + test + <@ + DotNet.ToTestArguments prep2 coll combined = "/p:AltCover=\"true\" /p:AltCoverReportFormat=\"OpenCover\" /p:AltCoverShowStatic=\"-\" /p:AltCoverShowSummary=\"R\" /p:AltCoverForce=\"true\" /p:AltCoverFailFast=\"true\"" + @> + let pprep2 = Options.Prepare() test <@ (pprep2.WhatIf()).Command = [ "--save" ] @> diff --git a/AltCover.Cake/Options.cs b/AltCover.Cake/Options.cs index 0a522c899..a484c816e 100644 --- a/AltCover.Cake/Options.cs +++ b/AltCover.Cake/Options.cs @@ -7,354 +7,359 @@ namespace AltCover.Cake { + /// + /// Overall test run options; override defaults as required + /// + public class TestOptions : FSDotNet.ICLIOptions + { /// - /// Overall test run options; override defaults as required + /// Gets whether to force delete previous runs /// - public class TestOptions : FSDotNet.ICLIOptions - { - /// - /// Gets whether to force delete previous runs - /// - public virtual bool ForceDelete => false; - - /// - /// Gets whether to fail without computing coverage on test failure - /// - public virtual bool FailFast => false; - - /// - /// Gets the type of summary to show - /// - public virtual string ShowSummary => String.Empty; - } + public virtual bool ForceDelete => false; /// - /// Preparation stage options; override defaults as required + /// Gets whether to fail without computing coverage on test failure + /// + public virtual bool FailFast => false; + + /// + /// Gets the type of summary to show + /// + public virtual string ShowSummary => String.Empty; + } + + /// + /// Preparation stage options; override defaults as required + /// + public class PrepareOptions : Abstract.IPrepareOptions + { + /// + /// Gets the input directories (overridden by the MSBuild integration) /// - public class PrepareOptions : Abstract.IPrepareOptions - { - /// - /// Gets the input directories (overridden by the MSBuild integration) - /// #pragma warning disable IDE0079 // Remove unnecessary suppression - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public IEnumerable InputDirectories => throw new NotImplementedException("InputDirectories not used"); - - /// - /// Gets the output directories (overridden by the MSBuild integration) - /// - - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public IEnumerable OutputDirectories => throw new NotImplementedException("OutputDirectories not used"); - - /// - /// Corresponds to command line option `-y, --symbolDirectory=VALUE` - /// - public virtual IEnumerable SymbolDirectories => Array.Empty(); - - /// - /// Corresponds to command line option `-d, --dependency=VALUE` - /// - public virtual IEnumerable Dependencies => Array.Empty(); - - /// - /// Corresponds to command line option `-k, --key=VALUE` - /// - public virtual IEnumerable Keys => Array.Empty(); - - /// - /// Corresponds to command line option `--sn, --strongNameKey=VALUE` - /// - public virtual string StrongNameKey => String.Empty; - - /// - /// Gets or sets the value that corresponds to command line option `-r, --report=VALUE` - /// - public virtual string Report => String.Empty; - - /// - /// Corresponds to command line option `-f, --fileFilter=VALUE` - /// - public virtual IEnumerable FileFilter => Array.Empty(); - - /// - /// Corresponds to command line option `-s, --assemblyFilter=VALUE` - /// - public virtual IEnumerable AssemblyFilter => Array.Empty(); - - /// - /// Corresponds to command line option `-e, --assemblyExcludeFilter=VALUE` - /// - public virtual IEnumerable AssemblyExcludeFilter => Array.Empty(); - - /// - /// Corresponds to command line option `-t, --typeFilter=VALUE` - /// - public virtual IEnumerable TypeFilter => Array.Empty(); - - /// - /// Corresponds to command line option `-m, --methodFilter=VALUE` - /// - public virtual IEnumerable MethodFilter => Array.Empty(); - - /// - /// Corresponds to command line option `-a, --attributeFilter=VALUE` - /// - public virtual IEnumerable AttributeFilter => Array.Empty(); - - /// - /// Corresponds to command line option `-p, --pathFilter=VALUE` - /// - public virtual IEnumerable PathFilter => Array.Empty(); - - /// - /// Corresponds to command line option `--attributetoplevel=VALUE` - /// - public virtual IEnumerable AttributeTopLevel => Array.Empty(); - - /// - /// Corresponds to command line option `--typetoplevel=VALUE` - /// - public virtual IEnumerable TypeTopLevel => Array.Empty(); - - /// - /// Corresponds to command line option `--methodtoplevel=VALUE` - /// - public virtual IEnumerable MethodTopLevel => Array.Empty(); - - /// - /// Corresponds to command line option `-c, --callContext=VALUE` - /// - public virtual IEnumerable CallContext => Array.Empty(); - - /// - /// Corresponds to command line option `--reportFormat=VALUE` - /// - public virtual string ReportFormat => String.Empty; - - /// - /// Corresponds to command line option `--inplace` - /// - public virtual bool InPlace => false; - - /// - /// Corresponds to command line option `--save` - /// - public virtual bool Save => false; - - /// - /// Corresponds to command line option `--zipfile` - /// - public virtual bool ZipFile => false; - - /// - /// Corresponds to command line option `--methodpoint` - /// - public virtual bool MethodPoint => false; - - /// - /// Corresponds to command line option `--single` - /// - public virtual bool SingleVisit => false; - - /// - /// Corresponds to command line option `--linecover` - /// - public virtual bool LineCover => false; - - /// - /// Corresponds to command line option `--branchcover` - /// - public virtual bool BranchCover => false; - - /// - /// Gets the command line (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public IEnumerable CommandLine => throw new NotImplementedException("CommandLine not used"); - - /// - /// Gets whether to expose a program return code (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public bool ExposeReturnCode => throw new NotImplementedException("ExposeReturnCode not used"); - - /// - /// Corresponds to command line option `--sourcelink` - /// - public virtual bool SourceLink => true; - - /// - /// Gets whether to defer coverage reporting (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - public bool Defer => throw new NotImplementedException("Defer not used"); - - /// - /// Corresponds to command line option `-l, --localSource` - /// - public virtual bool LocalSource => true; - - /// - /// Corresponds to command line option `-v, --visibleBranches` - /// - public virtual bool VisibleBranches => false; - - /// - /// Corresponds to command line option `--showstatic[=VALUE]` - /// - public virtual string ShowStatic => String.Empty; - - /// - /// Corresponds to command line option `--showGenerated` - /// - public virtual bool ShowGenerated => false; - - /// - /// Corresponds to command line option `-q` - /// - public virtual System.Diagnostics.TraceLevel Verbosity => System.Diagnostics.TraceLevel.Info; - - /// - /// Corresponds to command line option ` --trivia` - /// - public virtual bool Trivia => false; - } + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public IEnumerable InputDirectories => throw new NotImplementedException("InputDirectories not used"); + + /// + /// Gets the output directories (overridden by the MSBuild integration) + /// + + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public IEnumerable OutputDirectories => throw new NotImplementedException("OutputDirectories not used"); + + /// + /// Corresponds to command line option `-y, --symbolDirectory=VALUE` + /// + public virtual IEnumerable SymbolDirectories => Array.Empty(); + + /// + /// Corresponds to command line option `-d, --dependency=VALUE` + /// + public virtual IEnumerable Dependencies => Array.Empty(); + + /// + /// Corresponds to command line option `-k, --key=VALUE` + /// + public virtual IEnumerable Keys => Array.Empty(); + + /// + /// Corresponds to command line option `--sn, --strongNameKey=VALUE` + /// + public virtual string StrongNameKey => String.Empty; + + /// + /// Gets or sets the value that corresponds to command line option `-r, --report=VALUE` + /// + public virtual string Report => String.Empty; + + /// + /// Corresponds to command line option `-f, --fileFilter=VALUE` + /// + public virtual IEnumerable FileFilter => Array.Empty(); + + /// + /// Corresponds to command line option `-s, --assemblyFilter=VALUE` + /// + public virtual IEnumerable AssemblyFilter => Array.Empty(); + + /// + /// Corresponds to command line option `-e, --assemblyExcludeFilter=VALUE` + /// + public virtual IEnumerable AssemblyExcludeFilter => Array.Empty(); + + /// + /// Corresponds to command line option `-t, --typeFilter=VALUE` + /// + public virtual IEnumerable TypeFilter => Array.Empty(); + + /// + /// Corresponds to command line option `-m, --methodFilter=VALUE` + /// + public virtual IEnumerable MethodFilter => Array.Empty(); + + /// + /// Corresponds to command line option `-a, --attributeFilter=VALUE` + /// + public virtual IEnumerable AttributeFilter => Array.Empty(); + + /// + /// Corresponds to command line option `-p, --pathFilter=VALUE` + /// + public virtual IEnumerable PathFilter => Array.Empty(); + + /// + /// Corresponds to command line option `--attributetoplevel=VALUE` + /// + public virtual IEnumerable AttributeTopLevel => Array.Empty(); + + /// + /// Corresponds to command line option `--typetoplevel=VALUE` + /// + public virtual IEnumerable TypeTopLevel => Array.Empty(); + + /// + /// Corresponds to command line option `--methodtoplevel=VALUE` + /// + public virtual IEnumerable MethodTopLevel => Array.Empty(); + + /// + /// Corresponds to command line option `-c, --callContext=VALUE` + /// + public virtual IEnumerable CallContext => Array.Empty(); + + /// + /// Corresponds to command line option `--reportFormat=VALUE` + /// + public virtual string ReportFormat => String.Empty; + + /// + /// Corresponds to command line option `--inplace` + /// + public virtual bool InPlace => false; + + /// + /// Corresponds to command line option `--save` + /// + public virtual bool Save => false; + + /// + /// Corresponds to command line option `--zipfile` + /// + public virtual bool ZipFile => false; + + /// + /// Corresponds to command line option `--methodpoint` + /// + public virtual bool MethodPoint => false; + + /// + /// Corresponds to command line option `--single` + /// + public virtual bool SingleVisit => false; + + /// + /// Corresponds to command line option `--linecover` + /// + public virtual bool LineCover => false; + + /// + /// Corresponds to command line option `--branchcover` + /// + public virtual bool BranchCover => false; + + /// + /// Gets the command line (overridden by the MSBuild integration) + /// + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public IEnumerable CommandLine => throw new NotImplementedException("CommandLine not used"); + + /// + /// Gets whether to expose a program return code (overridden by the MSBuild integration) + /// + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public bool ExposeReturnCode => throw new NotImplementedException("ExposeReturnCode not used"); + + /// + /// Corresponds to command line option `--sourcelink` + /// + public virtual bool SourceLink => true; + + /// + /// Gets whether to defer coverage reporting (overridden by the MSBuild integration) + /// + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + public bool Defer => throw new NotImplementedException("Defer not used"); + + /// + /// Corresponds to command line option `-l, --localSource` + /// + public virtual bool LocalSource => true; + + /// + /// Corresponds to command line option `-v, --visibleBranches` + /// + public virtual bool VisibleBranches => false; + + /// + /// Corresponds to command line option `--showstatic[=VALUE]` + /// + public virtual string ShowStatic => String.Empty; + + /// + /// Corresponds to command line option `--showGenerated` + /// + public virtual bool ShowGenerated => false; + + /// + /// Corresponds to command line option `-q` + /// + public virtual System.Diagnostics.TraceLevel Verbosity => System.Diagnostics.TraceLevel.Info; + + /// + /// Corresponds to command line option `--trivia` + /// + public virtual bool Trivia => false; + + /// + /// Corresponds to dotnet test option `/p:AltCoverOutputRoot` + /// + public virtual string OutputRoot => String.Empty; + } + + /// + /// Collection stage options; override defaults as required + /// + public class CollectOptions : Abstract.ICollectOptions + { + /// + /// Gets the recorder directory (overridden by the MSBuild integration) + /// + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public string RecorderDirectory => throw new NotImplementedException("RecorderDirectory not used"); + + /// + /// Gets the working directory (overridden by the MSBuild integration) + /// + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public string WorkingDirectory => throw new NotImplementedException("WorkingDirectory not used"); + + /// + /// Gets the programe to run (overridden by the MSBuild integration) + /// + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + public string Executable => throw new NotImplementedException("Executable not used"); + + /// + /// Corresponds to command line option `-l, --lcovReport=VALUE` + /// + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", + Justification = "Lcov is a name")] + public virtual string LcovReport => String.Empty; + + /// + /// Corresponds to command line option `-t, --threshold=VALUE` + /// + public virtual string Threshold => String.Empty; + + /// + /// Corresponds to command line option `-c, --cobertura=VALUE` + /// + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", + Justification = "Lcov is a name")] + public virtual string Cobertura => String.Empty; + + /// + /// Corresponds to command line option `-o, --outputFile=VALUE` + /// + public virtual string OutputFile => String.Empty; + + /// + /// Gets the command line (overridden by the MSBuild integration) + /// + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public IEnumerable CommandLine => throw new NotImplementedException("CommandLine not used"); /// - /// Collection stage options; override defaults as required + /// Gets whether to expose a program return code (overridden by the MSBuild integration) /// - public class CollectOptions : Abstract.ICollectOptions - { - /// - /// Gets the recorder directory (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public string RecorderDirectory => throw new NotImplementedException("RecorderDirectory not used"); - - /// - /// Gets the working directory (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public string WorkingDirectory => throw new NotImplementedException("WorkingDirectory not used"); - - /// - /// Gets the programe to run (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - public string Executable => throw new NotImplementedException("Executable not used"); - - /// - /// Corresponds to command line option `-l, --lcovReport=VALUE` - /// - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", - Justification = "Lcov is a name")] - public virtual string LcovReport => String.Empty; - - /// - /// Corresponds to command line option `-t, --threshold=VALUE` - /// - public virtual string Threshold => String.Empty; - - /// - /// Corresponds to command line option `-c, --cobertura=VALUE` - /// - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", - Justification = "Lcov is a name")] - public virtual string Cobertura => String.Empty; - - /// - /// Corresponds to command line option `-o, --outputFile=VALUE` - /// - public virtual string OutputFile => String.Empty; - - /// - /// Gets the command line (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public IEnumerable CommandLine => throw new NotImplementedException("CommandLine not used"); - - /// - /// Gets whether to expose a program return code (overridden by the MSBuild integration) - /// - [SuppressMessage("Gendarme.Rules.BadPractice", - "DoNotForgetNotImplementedMethodsRule", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Design", - "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", - Justification = "Means 'do not use'")] - [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", - Justification = "Property name")] - public bool ExposeReturnCode => throw new NotImplementedException("ExposeReturnCode not used"); - - /// - /// Corresponds to command line option `--teamcity[=VALUE]` - /// - public virtual string SummaryFormat => String.Empty; - - /// - /// Corresponds to command line option `-q` - /// - public virtual System.Diagnostics.TraceLevel Verbosity => System.Diagnostics.TraceLevel.Info; - } + [SuppressMessage("Gendarme.Rules.BadPractice", + "DoNotForgetNotImplementedMethodsRule", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Design", + "CA1065:DoNotRaiseExceptionsInUnexpectedLocations", + Justification = "Means 'do not use'")] + [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + Justification = "Property name")] + public bool ExposeReturnCode => throw new NotImplementedException("ExposeReturnCode not used"); + + /// + /// Corresponds to command line option `--teamcity[=VALUE]` + /// + public virtual string SummaryFormat => String.Empty; + + /// + /// Corresponds to command line option `-q` + /// + public virtual System.Diagnostics.TraceLevel Verbosity => System.Diagnostics.TraceLevel.Info; + } } \ No newline at end of file diff --git a/AltCover.DotNet/DotNet.fs b/AltCover.DotNet/DotNet.fs index 78e960ca7..f69f431f7 100644 --- a/AltCover.DotNet/DotNet.fs +++ b/AltCover.DotNet/DotNet.fs @@ -114,7 +114,8 @@ module DotNet = [ fromArg, "StrongNameKey", prepare.StrongNameKey //=`"path to default strong-name key for assemblies" fromArg, "Report", prepare.Report //=`"path to the report" default: `coverage.xml` or `coverage.json` in the project directory fromArg, "ReportFormat", prepare.ReportFormat //=`"Json", "NCover" or default "OpenCover" - fromArg, "ShowStatic", prepare.ShowStatic ] //=-|+|++` to mark simple code like auto-properties in the coverage file + fromArg, "ShowStatic", prepare.ShowStatic //=-|+|++` to mark simple code like auto-properties in the coverage file + fromArg, "OutputRoot", prepare.OutputRoot ] //=`"path of root folder for saved/instrumented output for `dotnet test`, default `$(TargetDir)`" let internal toPrepareArgArgumentList (prepare: Abstract.IPrepareOptions) = [ (arg, "ZipFile", "true", prepare.ZipFile) //="true|false"` - set "true" to store the coverage report in a `.zip` archive diff --git a/AltCover.DotNet/Options.fs b/AltCover.DotNet/Options.fs index 78ab9f61b..2e8468cb0 100644 --- a/AltCover.DotNet/Options.fs +++ b/AltCover.DotNet/Options.fs @@ -124,6 +124,7 @@ module Options = member val ShowGenerated = false with get, set member val Verbosity = System.Diagnostics.TraceLevel.Info with get, set member val Trivia = false with get, set + member val OutputRoot = String.Empty with get, set interface Abstract.IPrepareOptions with member self.InputDirectories = @@ -188,6 +189,7 @@ module Options = member self.ShowGenerated = self.ShowGenerated member self.Verbosity = self.Verbosity member self.Trivia = self.Trivia + member self.OutputRoot = self.OutputRoot #if RUNNER [] diff --git a/AltCover.Engine/Abstract.fs b/AltCover.Engine/Abstract.fs index 04346e121..c8e4dd482 100644 --- a/AltCover.Engine/Abstract.fs +++ b/AltCover.Engine/Abstract.fs @@ -262,9 +262,13 @@ module Abstract = /// abstract member Verbosity : System.Diagnostics.TraceLevel with get /// - /// Corresponds to command line option ` --trivia` + /// Corresponds to command line option `--trivia` /// abstract member Trivia : bool with get + /// + /// Corresponds to dotnet test option `/p:AltCoverOutputRoot` + /// + abstract member OutputRoot : string with get // ``` #if RUNNER // ### interface `ILoggingOptions` diff --git a/AltCover.Engine/AltCover.fs b/AltCover.Engine/AltCover.fs index d1d3362fd..1a08c1337 100644 --- a/AltCover.Engine/AltCover.fs +++ b/AltCover.Engine/AltCover.fs @@ -434,6 +434,12 @@ module AltCover = | Abstract a -> a.Trivia | TypeSafe t -> t.Trivia.AsBool() + member self.OutputRoot = + match self with + | Primitive p -> p.OutputRoot + | Abstract a -> a.OutputRoot + | TypeSafe t -> t.OutputRoot.AsString() + interface Abstract.IPrepareOptions with member self.InputDirectories = self.InputDirectories |> PrepareOptions.ToSeq @@ -512,6 +518,7 @@ module AltCover = member self.ShowGenerated = self.ShowGenerated member self.Verbosity = self.Verbosity member self.Trivia = self.Trivia + member self.OutputRoot = self.OutputRoot #if RUNNER static member private ValidateArray a f key = diff --git a/AltCover.Engine/AltCover.fsi b/AltCover.Engine/AltCover.fsi index 9d3d831b7..33f47b73f 100644 --- a/AltCover.Engine/AltCover.fsi +++ b/AltCover.Engine/AltCover.fsi @@ -312,6 +312,10 @@ namespace AltCoverFake.DotNet.Testing /// Corresponds to command line option `--trivia` /// member Trivia: bool with get + /// + /// Corresponds to dotnet test option `/p:AltCoverOutputRoot` + /// + member OutputRoot : string with get // ``` #if RUNNER // ``` diff --git a/AltCover.Engine/Primitive.fs b/AltCover.Engine/Primitive.fs index 4001fd8be..2d58d1d61 100644 --- a/AltCover.Engine/Primitive.fs +++ b/AltCover.Engine/Primitive.fs @@ -92,7 +92,8 @@ module Primitive = ShowStatic: string ShowGenerated: bool Verbosity: System.Diagnostics.TraceLevel - Trivia: bool } + Trivia: bool + OutputRoot: string } static member Create() = { InputDirectories = Seq.empty OutputDirectories = Seq.empty @@ -129,7 +130,8 @@ module Primitive = ShowStatic = "-" ShowGenerated = false Verbosity = System.Diagnostics.TraceLevel.Info - Trivia = false } + Trivia = false + OutputRoot = String.Empty } #if RUNNER [] diff --git a/AltCover.Engine/Primitive.fsi b/AltCover.Engine/Primitive.fsi index e83625dd0..83c6f4413 100644 --- a/AltCover.Engine/Primitive.fsi +++ b/AltCover.Engine/Primitive.fsi @@ -250,6 +250,10 @@ namespace AltCoverFake.DotNet.Testing /// Corresponds to command line option `--trivia` /// Trivia: bool + /// + /// Corresponds to dotnet test option `/p:AltCoverOutputRoot` + /// + OutputRoot : string } with /// diff --git a/AltCover.Engine/Tasks.fs b/AltCover.Engine/Tasks.fs index 83689d80d..feb44e19b 100644 --- a/AltCover.Engine/Tasks.fs +++ b/AltCover.Engine/Tasks.fs @@ -138,6 +138,7 @@ type Prepare() = member val ExposeReturnCode = true with get, set member val Verbosity = "Info" with get, set member val Trivia = false with get, set + member val OutputRoot = String.Empty with get, set member private self.Message text = ``base``.Log.LogMessage(MessageImportance.High, text) @@ -190,7 +191,8 @@ type Prepare() = ShowStatic = self.ShowStatic ShowGenerated = self.ShowGenerated Verbosity = TaskHelpers.parse self.Verbosity - Trivia = self.Trivia } + Trivia = self.Trivia + OutputRoot = self.OutputRoot } Command.Prepare task log = 0 @@ -332,6 +334,7 @@ type Echo() = true +[] type RunSettings() = inherit Task(null) @@ -354,6 +357,9 @@ type RunSettings() = Justification = "Unit test accessor")>] member val internal MessageIO: (string -> unit) option = None with get, set + member val internal GetTempFileName: (unit -> string) = + Path.GetTempFileName with get, set + override self.Execute() = let signal = Option.defaultValue self.Message self.MessageIO @@ -367,7 +373,7 @@ type RunSettings() = |> sprintf "Settings Before: %s" |> signal - let tempFile = Path.GetTempFileName() + let tempFile = self.GetTempFileName() try let settings = diff --git a/AltCover.Engine/TypeSafe.fs b/AltCover.Engine/TypeSafe.fs index b7c7dc443..34fc60fcd 100644 --- a/AltCover.Engine/TypeSafe.fs +++ b/AltCover.Engine/TypeSafe.fs @@ -306,7 +306,8 @@ module TypeSafe = ShowStatic: StaticFormat ShowGenerated: Flag Verbosity: System.Diagnostics.TraceLevel - Trivia: Flag } + Trivia: Flag + OutputRoot: FilePath } static member Create() = { InputDirectories = NoDirectories OutputDirectories = NoDirectories @@ -343,7 +344,8 @@ module TypeSafe = ShowStatic = StaticFormat.Default ShowGenerated = Clear Verbosity = System.Diagnostics.TraceLevel.Info - Trivia = Clear } + Trivia = Clear + OutputRoot = NoFile } #if RUNNER [ Trivia: Flag + /// + /// Corresponds to dotnet test option `/p:AltCoverOutputRoot` + /// + OutputRoot : FilePath } with /// diff --git a/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs b/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs index 72bfe99b7..7ddc1fa13 100644 --- a/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs +++ b/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs @@ -123,7 +123,8 @@ module AltCoverCommand = ShowStatic = a.ShowStatic ShowGenerated = a.ShowGenerated Verbosity = a.Verbosity - Trivia = a.Trivia } + Trivia = a.Trivia + OutputRoot = a.OutputRoot } AltCover.PrepareOptions.Primitive copy | AltCover.PrepareOptions.TypeSafe t -> @@ -326,19 +327,19 @@ module AltCoverCommand = "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = - "AltCoverFake.DotNet.Testing.AltCoverCommand+withMono@298T.#monoPath", + "AltCoverFake.DotNet.Testing.AltCoverCommand+withMono@299T.#monoPath", Justification = "Generated code")>] [] [] [] () \ No newline at end of file diff --git a/AltCover.PowerShell/Command.fs b/AltCover.PowerShell/Command.fs index 062f3d942..fd7d5d21d 100644 --- a/AltCover.PowerShell/Command.fs +++ b/AltCover.PowerShell/Command.fs @@ -710,7 +710,8 @@ type InvokeAltCoverCommand() = ShowStatic = showStatic.[self.ShowStatic |> int] ShowGenerated = self.ShowGenerated.IsPresent Verbosity = self.Verbosity - Trivia = self.Trivia.IsPresent } + Trivia = self.Trivia.IsPresent + OutputRoot = String.Empty } member private self.Log() = AltCover.LoggingOptions.Primitive diff --git a/AltCover.Tests/Tests3.fs b/AltCover.Tests/Tests3.fs index 8c38ca0e5..3306e26b7 100644 --- a/AltCover.Tests/Tests3.fs +++ b/AltCover.Tests/Tests3.fs @@ -129,15 +129,10 @@ module AltCoverTests3 = |> Seq.toList // add "commandline" - Assert.That( - primitiveNames |> List.length, - Is.EqualTo(optionCount), // drop -q/--verbose => verbosity - "expected " - + String.Join("; ", optionNames) - + Environment.NewLine - + "but got primitive " - + String.Join("; ", primitiveNames) - ) + testWithFallback + <@ (primitiveNames) |> List.length = optionCount + 1 @> // adds optionroot + (primitiveNames |> List.length) + (Is.EqualTo(optionCount + 1)) let typesafeNames = typeof @@ -146,15 +141,10 @@ module AltCoverTests3 = |> Seq.sort |> Seq.toList - Assert.That( - typesafeNames |> List.length, - Is.EqualTo(optionCount), // drop -q/--verbose => verbosity - "expected " - + String.Join("; ", optionNames) - + Environment.NewLine - + "but got typesafe " - + String.Join("; ", typesafeNames) - ) + testWithFallback + <@ (typesafeNames) |> List.length = optionCount + 1 @> // adds optionroot + (typesafeNames |> List.length) + (Is.EqualTo(optionCount + 1)) let fsapiNames = typeof.GetProperties() @@ -182,26 +172,16 @@ module AltCoverTests3 = |> List.map _.Trim('-') |> List.sort - Assert.That( - commandFragments |> List.length, - Is.EqualTo(optionCount), // drop -q/--verbose => verbosity - "expected " - + String.Join("; ", optionNames) - + Environment.NewLine - + "but got fragments " - + String.Join("; ", commandFragments) - ) + testWithFallback + <@ (commandFragments) |> List.length = optionCount @> // drop -q/--verbose => verbosity + (commandFragments |> List.length) + (Is.EqualTo(optionCount)) // Adds "Tag", "IsPrimitive", "IsTypeSafe" - Assert.That( - fsapiNames |> Seq.length, - Is.EqualTo(optionCount + fsapiCases + 1), // drop -q/--verbose => verbosity - "expected " - + String.Join("; ", primitiveNames) - + Environment.NewLine - + "but got fsapi " - + String.Join("; ", fsapiNames) - ) + testWithFallback + <@ (fsapiNames) |> List.length = optionCount + fsapiCases + 2 @> // drop -q/--verbose => verbosity + (fsapiNames |> List.length) + (Is.EqualTo(optionCount + fsapiCases + 2)) let taskNames = typeof @@ -214,15 +194,10 @@ module AltCoverTests3 = |> Seq.sort |> Seq.toList - Assert.That( - taskNames |> Seq.length, - Is.EqualTo(optionCount), // drop -q/--verbose => verbosity - "expected " - + String.Join("; ", primitiveNames) - + Environment.NewLine - + "but got tasks " - + String.Join("; ", taskNames) - ) + testWithFallback + <@ (taskNames) |> List.length = optionCount @> // drop -q/--verbose => verbosity + (taskNames |> List.length) + (Is.EqualTo(optionCount)) let targets = Assembly @@ -251,15 +226,10 @@ module AltCoverTests3 = // dotnet test loses commandline, defer, exposereturncode, save // N/A, fixed, N/A, fixed // inplace is explicitly hard-coded - Assert.That( - attributeNames |> Seq.length, - Is.EqualTo(optionCount - 4), // drop -q/--verbose => verbosity - "expected " - + String.Join("; ", primitiveNames) - + Environment.NewLine - + "but got targets " - + String.Join("; ", attributeNames) - ) + testWithFallback + <@ (attributeNames) |> List.length = optionCount - 4 @> // drop -q/--verbose => verbosity + (attributeNames |> List.length) + (Is.EqualTo(optionCount - 4)) Assert.That( options @@ -4455,10 +4425,29 @@ module AltCoverTests3 = Console.SetOut(fst saved) Console.SetError(snd saved) + let MakeRunSettings () = + let subject = RunSettings() + + let temper = + subject + .GetType() + .GetProperty("GetTempFileName", BindingFlags.Instance ||| BindingFlags.NonPublic) + + let basic = + temper.GetValue(subject) :?> (unit -> string) + + let badge = + (fun () -> + let t1 = basic () + Path.Combine(Path.GetDirectoryName t1, "altcover.test." + Path.GetFileName(t1))) + + temper.SetValue(subject, badge) + subject + [] let RunSettingsFailsIfCollectorNotFound () = Main.init () - let subject = RunSettings() + let subject = MakeRunSettings() let dc = subject @@ -4474,6 +4463,7 @@ module AltCoverTests3 = .GetProperty("MessageIO", BindingFlags.Instance ||| BindingFlags.NonPublic) write.SetValue(subject, Some(fun (s: string) -> ())) + Assert.That(subject.Execute(), Is.False) Assert.That(subject.Extended, Is.Empty) CommandLine.verbosity <- 0 @@ -4495,7 +4485,7 @@ module AltCoverTests3 = [] let RunSettingsWorksIfOK () = Main.init () - let subject = RunSettings() + let subject = MakeRunSettings() let dc = subject @@ -4517,9 +4507,18 @@ module AltCoverTests3 = Assert.That(subject.Execute(), Is.True) Assert.That(subject.Extended.EndsWith(".altcover.runsettings")) + Assert.That( + Path + .GetFileName(subject.Extended) + .StartsWith("altcover.test.") + ) + let result = subject.Extended |> File.ReadAllText + [ subject.Extended ] + |> Seq.iter (fun f -> maybeIOException (fun () -> File.Delete f)) + Assert.That( result .Replace("\r", String.Empty) @@ -4542,7 +4541,7 @@ module AltCoverTests3 = [] let RunSettingsExtendsOK () = Main.init () - let subject = RunSettings() + let subject = MakeRunSettings() let dc = subject @@ -4571,6 +4570,9 @@ module AltCoverTests3 = let result = subject.Extended |> File.ReadAllText + [ subject.Extended ] + |> Seq.iter (fun f -> maybeIOException (fun () -> File.Delete f)) + Assert.That( result .Replace("\r", String.Empty) @@ -4593,7 +4595,7 @@ module AltCoverTests3 = [] let RunSettingsThrowsIfUninitialized () = Main.init () - let subject = RunSettings() + let subject = MakeRunSettings() let dc = subject @@ -4616,7 +4618,7 @@ module AltCoverTests3 = [] let RunSettingsRecoversOK () = Main.init () - let subject = RunSettings() + let subject = MakeRunSettings() let dc = subject @@ -4641,6 +4643,9 @@ module AltCoverTests3 = let result = subject.Extended |> File.ReadAllText + [ subject.Extended ] + |> Seq.iter (fun f -> maybeIOException (fun () -> File.Delete f)) + Assert.That( result .Replace("\r", String.Empty) diff --git a/AltCover.Tests/XTests.fs b/AltCover.Tests/XTests.fs index ba797805f..9aa20b0ba 100644 --- a/AltCover.Tests/XTests.fs +++ b/AltCover.Tests/XTests.fs @@ -873,7 +873,6 @@ module AltCoverXTests = [ "AltCover.Recorder.g.dll" "FSharp.Core.dll" "Newtonsoft.Json.dll" - "NuGet.Frameworks.dll" "Sample4.deps.json" "Sample4.dll" "Sample4.runtimeconfig.json" diff --git a/AltCover.ValidateGendarmeEmulation/Tests.fs b/AltCover.ValidateGendarmeEmulation/Tests.fs index 9e1bf536b..b37472a16 100644 --- a/AltCover.ValidateGendarmeEmulation/Tests.fs +++ b/AltCover.ValidateGendarmeEmulation/Tests.fs @@ -7,7 +7,7 @@ open AltCover open Mono.Cecil module Rocks = - [] + //[] let rec GetAllTypes (t: TypeDefinition) = t :: (List.collect diff --git a/AltCover.sln b/AltCover.sln index ff877763d..de7f9bb52 100644 --- a/AltCover.sln +++ b/AltCover.sln @@ -38,12 +38,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Items", "Build Items" Build\actions.fs = Build\actions.fs Build\AddStrongName.fsx = Build\AddStrongName.fsx Build\AltCover.nuspec = Build\AltCover.nuspec - nupkg\build\netstandard2.0\AltCover.props = nupkg\build\netstandard2.0\AltCover.props - nupkg\build\netstandard2.0\AltCover.targets = nupkg\build\netstandard2.0\AltCover.targets + nupkg\build\AltCover.props = nupkg\build\AltCover.props + nupkg\build\AltCover.targets = nupkg\build\AltCover.targets Build\Apply-Xslt.ps1 = Build\Apply-Xslt.ps1 Build\build.cake = Build\build.cake Build\build.fsx = Build\build.fsx - Build\build2.cake = Build\build2.cake Build\common-rules.xml = Build\common-rules.xml Build\coverletArgs.runsettings = Build\coverletArgs.runsettings Build\coverletArgs.sample.runsettings = Build\coverletArgs.sample.runsettings @@ -70,6 +69,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Items", "Build Items" Build\SelfTest.snk = Build\SelfTest.snk Build\setup.fs = Build\setup.fs Build\targets.fs = Build\targets.fs + ToolUpdate.ps1 = ToolUpdate.ps1 version.json = version.json EndProjectSection EndProject diff --git a/Build/build.cake b/Build/build.cake index 137587307..fad34dd60 100644 --- a/Build/build.cake +++ b/Build/build.cake @@ -33,8 +33,10 @@ Task("Build") { public string CakeVersion; public override IEnumerable CallContext => new string[] {"[Fact]", "0"}; + public override IEnumerable AssemblyFilter => new string[] {"testhost"}; 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"); } Task("Test") diff --git a/Build/setup.fs b/Build/setup.fs index f40078c74..0265a6488 100644 --- a/Build/setup.fs +++ b/Build/setup.fs @@ -102,7 +102,7 @@ module Setup = Target.description s let wrap f x = - printfn ">> %A <<" x + //printfn ">> %A <<" x f () Target.create s (wrap f) diff --git a/Build/targets.fs b/Build/targets.fs index c5c98d8a4..375929ada 100644 --- a/Build/targets.fs +++ b/Build/targets.fs @@ -318,7 +318,7 @@ module Targets = let coverletcollector = ("./packages/" + (packageVersion "coverlet.collector") - + "/build/netstandard1.0/coverlet.collector.dll") + + "/build/netstandard2.0/coverlet.collector.dll") |> Path.getFullName let cliArguments = @@ -6008,6 +6008,12 @@ module Targets = ) Actions.CheckSample4 before x + + Assert.That( + File.Exists( + "./_Binaries/cake_dotnettest/OutputRoot/__Instrumented_cake_dotnettest/AltCover.Recorder.g.dll" + ) + ) finally Actions.RunDotnet (fun o' -> diff --git a/Demo/Echo/Echo/Echo.csproj b/Demo/Echo/Echo/Echo.csproj index 21dff5ca2..a269962b5 100644 --- a/Demo/Echo/Echo/Echo.csproj +++ b/Demo/Echo/Echo/Echo.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.2 + net8.0 diff --git a/Demo/Echo/Test/Test.csproj b/Demo/Echo/Test/Test.csproj index 43137d35e..28af30b64 100644 --- a/Demo/Echo/Test/Test.csproj +++ b/Demo/Echo/Test/Test.csproj @@ -1,16 +1,16 @@ - netcoreapp2.2 + net8.0 false - - - - + + + + diff --git a/Demo/MultiTest/System1/System1.fsproj b/Demo/MultiTest/System1/System1.fsproj index ad1a657e5..32f842a58 100644 --- a/Demo/MultiTest/System1/System1.fsproj +++ b/Demo/MultiTest/System1/System1.fsproj @@ -9,7 +9,7 @@ - + contentfiles diff --git a/Demo/MultiTest/System2/System2.fsproj b/Demo/MultiTest/System2/System2.fsproj index ad1a657e5..32f842a58 100644 --- a/Demo/MultiTest/System2/System2.fsproj +++ b/Demo/MultiTest/System2/System2.fsproj @@ -9,7 +9,7 @@ - + contentfiles diff --git a/Demo/MultiTest/Test1/Test1.fsproj b/Demo/MultiTest/Test1/Test1.fsproj index 88e8ee202..acb6ec006 100644 --- a/Demo/MultiTest/Test1/Test1.fsproj +++ b/Demo/MultiTest/Test1/Test1.fsproj @@ -1,7 +1,7 @@ - netcoreapp2.1 + net8.0 false @@ -11,14 +11,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers - + contentfiles diff --git a/Demo/MultiTest/Test2/Test2.fsproj b/Demo/MultiTest/Test2/Test2.fsproj index 2bd4ce558..ec8c9525e 100644 --- a/Demo/MultiTest/Test2/Test2.fsproj +++ b/Demo/MultiTest/Test2/Test2.fsproj @@ -1,7 +1,7 @@ - netcoreapp2.1 + net8.0 false @@ -11,14 +11,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers - + contentfiles diff --git a/Demo/Service/Service/Service.fsproj b/Demo/Service/Service/Service.fsproj index b95381fdd..5a6c274e0 100644 --- a/Demo/Service/Service/Service.fsproj +++ b/Demo/Service/Service/Service.fsproj @@ -28,11 +28,11 @@ - - + + contentfiles - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Directory.Packages.props b/Directory.Packages.props index 1b5c53e2f..bfdca6e33 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,13 +4,13 @@ - + - - - - + + + + @@ -18,7 +18,7 @@ - + @@ -40,35 +40,35 @@ - - + + - + - + - + - - + + - - + + - + @@ -79,15 +79,15 @@ - + - - - - - - - + + + + + + + \ No newline at end of file diff --git a/RegressionTesting/issue156/Tests/Tests.csproj b/RegressionTesting/issue156/Tests/Tests.csproj index b27b5048a..626451ff4 100644 --- a/RegressionTesting/issue156/Tests/Tests.csproj +++ b/RegressionTesting/issue156/Tests/Tests.csproj @@ -10,7 +10,10 @@ UnitTest - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 3e3e8294d..e505ccd45 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -3,7 +3,11 @@ 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 25) +# (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! # 8.6.95 (Habu series release 24) diff --git a/Samples/Sample15/Sample15/Sample15.fsproj b/Samples/Sample15/Sample15/Sample15.fsproj index 3ffc1dd38..b92dbd392 100644 --- a/Samples/Sample15/Sample15/Sample15.fsproj +++ b/Samples/Sample15/Sample15/Sample15.fsproj @@ -29,7 +29,7 @@ - + contentfiles diff --git a/Samples/Sample29/SimpleMix/SimpleMix.vcxproj b/Samples/Sample29/SimpleMix/SimpleMix.vcxproj index 4417791ec..edca7c6e1 100644 --- a/Samples/Sample29/SimpleMix/SimpleMix.vcxproj +++ b/Samples/Sample29/SimpleMix/SimpleMix.vcxproj @@ -21,7 +21,7 @@ Application false - v142 + v143 true Unicode true @@ -29,7 +29,7 @@ Application false - v142 + v143 true Unicode true diff --git a/Samples/Sample4/Sample4LongForm.fsproj b/Samples/Sample4/Sample4LongForm.fsproj index 9524c68fc..b108b2726 100644 --- a/Samples/Sample4/Sample4LongForm.fsproj +++ b/Samples/Sample4/Sample4LongForm.fsproj @@ -60,7 +60,7 @@ - + diff --git a/Samples/Sample7/Sample7.fsproj b/Samples/Sample7/Sample7.fsproj index d51caeda3..569337519 100644 --- a/Samples/Sample7/Sample7.fsproj +++ b/Samples/Sample7/Sample7.fsproj @@ -11,7 +11,7 @@ - + diff --git a/ToolUpdate.ps1 b/ToolUpdate.ps1 new file mode 100644 index 000000000..ea48435a5 --- /dev/null +++ b/ToolUpdate.ps1 @@ -0,0 +1,7 @@ +& dotnet tool update dotnet-reportgenerator-globaltool +& dotnet tool update xmldocmd +& dotnet tool update altcode.gendarme-tool +& dotnet tool update dotnet-fsharplint +& dotnet tool update coveralls.net +& dotnet tool update nbgv +& dotnet tool update -g fantomas \ No newline at end of file diff --git a/global.json b/global.json index 989a69caf..82dd9d3bd 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.202", "rollForward": "latestMinor" } } \ No newline at end of file diff --git a/nupkg/build/AltCover.targets b/nupkg/build/AltCover.targets index e399da405..11e37e0af 100644 --- a/nupkg/build/AltCover.targets +++ b/nupkg/build/AltCover.targets @@ -5,8 +5,9 @@ $(MSBuildThisFileDirectory)../lib/netstandard2.0/AltCover.Engine.dll $(AltCoverNetStdEngine) $(AltCoverNetCoreEngine) - $([System.IO.Path]::Combine($(TargetDir), '__Instrumented')) - $([System.IO.Path]::Combine($(TargetDir), '__Saved')) + $(TargetDir) + $([System.IO.Path]::Combine($(AltCoverOutputRoot), '__Instrumented')) + $([System.IO.Path]::Combine($(AltCoverOutputRoot), '__Saved')) .xml .json @@ -190,6 +191,27 @@ VSTestNoLogo="$(VSTestNoLogo)" /> + + + + + + + + + + + + + + + + + + + + @@ -212,14 +234,6 @@ - - - - - - - - - + \ No newline at end of file diff --git a/version.json b/version.json index e197db46a..149ff3e08 100644 --- a/version.json +++ b/version.json @@ -1,10 +1,10 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "8.6", + "version": "8.7", "release": { - "branchName" : "release/v{version}", - "versionIncrement" : "build", - "firstUnstableTag" : "pre-release" + "branchName": "release/v{version}", + "versionIncrement": "build", + "firstUnstableTag": "pre-release" }, "publicReleaseRefSpec": [ "^refs/heads/release/.*"