diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 410471d79..a5f348b8c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-reportgenerator-globaltool": { - "version": "5.1.26", + "version": "5.2.0", "commands": [ "reportgenerator" ] @@ -15,13 +15,13 @@ ] }, "altcode.gendarme-tool": { - "version": "2023.8.26.15512", + "version": "2023.12.27.19054", "commands": [ "gendarme" ] }, "dotnet-fsharplint": { - "version": "0.21.3", + "version": "0.23.0", "commands": [ "dotnet-fsharplint" ] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8723cd81..d58915bf3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.100' - name: Tools @@ -42,11 +42,11 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} NUGET_API_TOKEN: ${{ secrets.NUGET_API_TOKEN }} run: dotnet run --project .\Build\Build.fsproj - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: nupkgs path: _Packagin*/*.nupkg - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: reports.windows @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.100' - name: Tools @@ -70,7 +70,7 @@ jobs: run: dotnet run --project ./Build/Setup.fsproj - name: Build run: dotnet run --project ./Build/Build.fsproj - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: reports.linux diff --git a/AltCover.Api.Tests/AltCover.Api.Tests.fsproj b/AltCover.Api.Tests/AltCover.Api.Tests.fsproj index 97c4675c9..eba07c59e 100644 --- a/AltCover.Api.Tests/AltCover.Api.Tests.fsproj +++ b/AltCover.Api.Tests/AltCover.Api.Tests.fsproj @@ -65,7 +65,8 @@ runtime; build; native; contentfiles; analyzers - + + contentfiles diff --git a/AltCover.Api.Tests/FSApiTests.fs b/AltCover.Api.Tests/FSApiTests.fs index 516a42d97..a26eef427 100644 --- a/AltCover.Api.Tests/FSApiTests.fs +++ b/AltCover.Api.Tests/FSApiTests.fs @@ -23,8 +23,7 @@ module FSApiTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("OpenCoverForPester.coverlet.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverForPester.coverlet.xml", StringComparison.Ordinal) use stream = Assembly @@ -44,7 +43,7 @@ module FSApiTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("OpenCoverStrict.xsd", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverStrict.xsd", StringComparison.Ordinal) use sstream = Assembly @@ -71,8 +70,7 @@ module FSApiTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -103,7 +101,7 @@ module FSApiTests = after.Descendants(XName.Get "SequencePoint") |> Seq.toList - |> List.iter (fun el -> el.Remove()) + |> List.iter _.Remove() after.Descendants(XName.Get "MethodPoint") |> Seq.iter (fun el -> setAttribute el "vc" "0") @@ -890,7 +888,7 @@ module FSApiTests = let doc = XDocument.Load(stream) doc.Descendants() - |> Seq.map (fun n -> n.Attribute(XName.Get "excluded")) + |> Seq.map _.Attribute(XName.Get "excluded") |> Seq.filter (isNull >> not) |> Seq.iter (fun a -> a.Value <- "false") @@ -944,7 +942,7 @@ module FSApiTests = let doc = XDocument.Load(stream) doc.Descendants() - |> Seq.map (fun n -> n.Attribute(XName.Get "excluded")) + |> Seq.map _.Attribute(XName.Get "excluded") |> Seq.filter (isNull >> not) |> Seq.iter (fun a -> a.Value <- "false") @@ -1150,7 +1148,7 @@ module FSApiTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("AltCover.targets", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("AltCover.targets", StringComparison.Ordinal) use stream = Assembly @@ -1161,19 +1159,19 @@ module FSApiTests = let prepare = doc.Descendants() - |> Seq.filter (fun d -> d.Name.LocalName = "AltCover.Prepare") + |> Seq.filter _.Name.LocalName.Equals("AltCover.Prepare") |> Seq.head let prepareNames = prepare.Attributes() - |> Seq.map (fun p -> p.Name.LocalName.ToLowerInvariant()) + |> Seq.map _.Name.LocalName.ToLowerInvariant() |> Seq.sort |> Seq.toList let prepareFragments = [ DotNet.I.toPrepareListArgumentList >> (List.map (fun (_, n, _) -> n)) - (fun p -> p.Verbosity) + _.Verbosity >> DotNet.I.toSharedFromValueArgumentList >> (List.map (fun (_, n, _, _) -> n)) DotNet.I.toPrepareFromArgArgumentList @@ -1191,24 +1189,21 @@ module FSApiTests = let collect = doc.Descendants() - |> Seq.filter (fun d -> d.Name.LocalName = "AltCover.Collect") + |> Seq.filter _.Name.LocalName.Equals("AltCover.Collect") |> Seq.head let collectNames = collect.Attributes() - |> Seq.map (fun p -> p.Name.LocalName.ToLowerInvariant()) + |> Seq.map _.Name.LocalName.ToLowerInvariant() |> Seq.sort |> Seq.toList let collectFragments = - [ //DotNet.I.toCollectListArgumentList >> (List.map (fun (_,n,_) -> n)) - DotNet.I.toCollectFromArgArgumentList + [ DotNet.I.toCollectFromArgArgumentList >> (List.map (fun (_, n, _) -> n)) - (fun c -> c.Verbosity) + _.Verbosity >> DotNet.I.toSharedFromValueArgumentList - >> (List.map (fun (_, n, _, _) -> n)) - //DotNet.I.toCollectArgArgumentList >> (List.map (fun (_,n,_,_) -> n)) - ] + >> (List.map (fun (_, n, _, _) -> n)) ] |> List.collect (fun f -> f coll) |> List.sort @@ -1220,7 +1215,7 @@ module FSApiTests = let optionNames = typeof.GetProperties() - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -1232,8 +1227,7 @@ module FSApiTests = let opt = DotNet.CLIOptions.Fail true let optionsFragments = - [ //DotNet.I.toCollectListArgumentList >> (List.map (fun (_,n,_) -> n)) - DotNet.I.toCLIOptionsFromArgArgumentList + [ DotNet.I.toCLIOptionsFromArgArgumentList >> (List.map (fun (_, n, _) -> n)) DotNet.I.toCLIOptionsArgArgumentList >> (List.map (fun (_, n, _, _) -> n)) ] diff --git a/AltCover.Async/AltCover.Async.fsproj b/AltCover.Async/AltCover.Async.fsproj index 68b3e298a..0d8e7e6e7 100644 --- a/AltCover.Async/AltCover.Async.fsproj +++ b/AltCover.Async/AltCover.Async.fsproj @@ -7,6 +7,7 @@ false false false + --keyfile:$(InfrastructureKey) diff --git a/AltCover.Avalonia/AltCover.Avalonia.fsproj b/AltCover.Avalonia/AltCover.Avalonia.fsproj index 2404c2d94..f879efc91 100644 --- a/AltCover.Avalonia/AltCover.Avalonia.fsproj +++ b/AltCover.Avalonia/AltCover.Avalonia.fsproj @@ -45,9 +45,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/AltCover.Avalonia/AltCover.Avalonia11.fsproj b/AltCover.Avalonia/AltCover.Avalonia11.fsproj index 4116648fd..3707e9cb2 100644 --- a/AltCover.Avalonia/AltCover.Avalonia11.fsproj +++ b/AltCover.Avalonia/AltCover.Avalonia11.fsproj @@ -45,11 +45,11 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers diff --git a/AltCover.Avalonia/MainWindow.fs b/AltCover.Avalonia/MainWindow.fs index 9c2cedeba..439b52791 100644 --- a/AltCover.Avalonia/MainWindow.fs +++ b/AltCover.Avalonia/MainWindow.fs @@ -203,6 +203,7 @@ type MainWindow() as this = [] + [] let rec linesOfString (s: string) (start: int) (lines: TextLine list) = let rn = s.IndexOf("\r\n", start) @@ -422,7 +423,7 @@ type MainWindow() as this = (n.Column - 1) + (lines |> Seq.take (n.Line - 1) - |> Seq.sumBy (fun l -> l.Length)) + |> Seq.sumBy _.Length) let ec = if n.LineOnly then @@ -894,7 +895,7 @@ type MainWindow() as this = s |> Async.AwaitTask |> Async.RunSynchronously) |> Option.ofObj - |> Option.map (fun x -> x.FirstOrDefault() |> Option.ofObj) + |> Option.map (_.FirstOrDefault() >> Option.ofObj) |> Option.iter openFile.Trigger } |> Async.Start) @@ -1015,7 +1016,7 @@ type MainWindow() as this = |> Event.add (fun index -> let mutable auxModel = { Model = List() - Row = null } + Row = nullObject } let addNode = fun @@ -1069,7 +1070,7 @@ type MainWindow() as this = this.Title <- "AltCover.Visualizer" tree.Items.OfType() - |> Seq.iter (fun x -> x.Dispose()) + |> Seq.iter _.Dispose() let t1 = #if AVALONIA11 diff --git a/AltCover.DotNet/DotNet.fs b/AltCover.DotNet/DotNet.fs index 2d0eadebd..78e960ca7 100644 --- a/AltCover.DotNet/DotNet.fs +++ b/AltCover.DotNet/DotNet.fs @@ -33,7 +33,7 @@ module DotNet = | Force b -> b | Summary _ | Fail _ -> false - | Many s -> s |> Seq.exists (fun f -> f.ForceDelete) + | Many s -> s |> Seq.exists _.ForceDelete | Abstract a -> a.ForceDelete member self.FailFast = @@ -41,13 +41,13 @@ module DotNet = | Fail b -> b | Summary _ | Force _ -> false - | Many s -> s |> Seq.exists (fun f -> f.FailFast) + | Many s -> s |> Seq.exists _.FailFast | Abstract a -> a.FailFast member self.ShowSummary = let select (s: CLIOptions seq) = s - |> Seq.map (fun f -> f.ShowSummary) + |> Seq.map _.ShowSummary |> Seq.filter (String.IsNullOrWhiteSpace >> not) |> Seq.tryHead diff --git a/AltCover.DotNet/Options.fs b/AltCover.DotNet/Options.fs index 47fec33cb..78ab9f61b 100644 --- a/AltCover.DotNet/Options.fs +++ b/AltCover.DotNet/Options.fs @@ -6,7 +6,6 @@ namespace AltCoverFake.DotNet.Testing open System open System.Diagnostics.CodeAnalysis -open System.Linq [] module Options = diff --git a/AltCover.Engine/AltCover.fsi b/AltCover.Engine/AltCover.fsi index f3fa27186..9d3d831b7 100644 --- a/AltCover.Engine/AltCover.fsi +++ b/AltCover.Engine/AltCover.fsi @@ -169,7 +169,7 @@ namespace AltCoverFake.DotNet.Testing with interface Abstract.IPrepareOptions /// - /// Corresponds to command line option ` -i, --inputDirectory=VALUE` + /// Corresponds to command line option `-i, --inputDirectory=VALUE` /// member InputDirectories : System.String list /// @@ -185,7 +185,7 @@ namespace AltCoverFake.DotNet.Testing /// member Dependencies : System.String list /// - /// Corresponds to command line option ` -k, --key=VALUE` + /// Corresponds to command line option `-k, --key=VALUE` /// member Keys : System.String list /// @@ -213,7 +213,7 @@ namespace AltCoverFake.DotNet.Testing /// member TypeFilter : System.String list /// - /// Corresponds to command line option ` -m, --methodFilter=VALUE` + /// Corresponds to command line option `-m, --methodFilter=VALUE` /// member MethodFilter : System.String list /// @@ -293,7 +293,7 @@ namespace AltCoverFake.DotNet.Testing /// member LocalSource : bool /// - /// Corresponds to command line option ` -v, --visibleBranches` + /// Corresponds to command line option `-v, --visibleBranches` /// member VisibleBranches : bool /// @@ -301,7 +301,7 @@ namespace AltCoverFake.DotNet.Testing /// member ShowStatic : string /// - /// Corresponds to command line option ` --showGenerated` + /// Corresponds to command line option `--showGenerated` /// member ShowGenerated : bool /// @@ -309,7 +309,7 @@ namespace AltCoverFake.DotNet.Testing /// member Verbosity : System.Diagnostics.TraceLevel /// - /// Corresponds to command line option ` --trivia` + /// Corresponds to command line option `--trivia` /// member Trivia: bool with get // ``` diff --git a/AltCover.Engine/Augment.fs b/AltCover.Engine/Augment.fs index caf6f1d96..e5fb8586f 100644 --- a/AltCover.Engine/Augment.fs +++ b/AltCover.Engine/Augment.fs @@ -12,6 +12,7 @@ module Augment = #else module internal Augment = #endif + let nullObject: System.Object = null #if !ValidateGendarmeEmulation [ Seq.map (fun p -> p.Trim([| '"' |])) + |> Seq.map _.Trim([| '"' |]) let files = [ "dotnet"; "dotnet.exe" ] @@ -45,7 +45,7 @@ module AssemblyConstants = |> (Option.defaultValue String.Empty) e.Split([| Path.PathSeparator |]) - |> Seq.map (fun p -> p.Trim([| '"' |])) + |> Seq.map _.Trim([| '"' |]) |> Seq.filter (String.IsNullOrWhiteSpace >> not) |> Seq.toList @@ -363,4 +363,4 @@ module internal CecilExtension = |> Seq.filter (fun i -> i.OpCode = OpCodes.Tail) |> Seq.iter (fun i -> i.OpCode <- OpCodes.Nop - i.Operand <- null) \ No newline at end of file + i.Operand <- nullObject) \ No newline at end of file diff --git a/AltCover.Engine/Cobertura.fs b/AltCover.Engine/Cobertura.fs index 02acd860d..62e6564d2 100644 --- a/AltCover.Engine/Cobertura.fs +++ b/AltCover.Engine/Cobertura.fs @@ -48,7 +48,7 @@ module internal Cobertura = |> Seq.sort |> Seq.iter (fun f -> target.Descendants("sources".X) - |> Seq.iter (fun s -> s.Add(XElement("source".X, XText(f))))) + |> Seq.iter _.Add(XElement("source".X, XText(f)))) let internal nCover (report: XDocument) (packages: XElement) = let processSeqPnts document (method: XElement) (lines: XElement) = @@ -160,7 +160,7 @@ module internal Cobertura = method.Attribute("class".X).Value method.Descendants("seqpnt".X) - |> Seq.map (fun s -> s.Attribute("document".X).Value) + |> Seq.map _.Attribute("document".X).Value |> Seq.distinct |> Seq.sort |> Seq.map (fun d -> (cname, d), method)) @@ -334,7 +334,7 @@ module internal Cobertura = method.Descendants("SequencePoint".X) |> Seq.filter (fun s -> s.Attribute("fileid".X).Value == fileid) - |> Seq.groupBy (fun b -> b.Attribute("sl".X).Value |> Int32.TryParse |> snd) + |> Seq.groupBy (fun b -> b.Attribute("sl".X).Value |> Int32.TryParse |> snd) //_ is ambiguous??? |> Seq.sortBy fst |> Seq.iter (copySeqPnt lines) @@ -430,7 +430,7 @@ module internal Cobertura = [ method.Descendants("SequencePoint".X) method.Descendants("BranchPoint".X) ] |> Seq.concat - |> Seq.map (fun s -> s.Attribute("fileid".X).Value) + |> Seq.map _.Attribute("fileid".X).Value |> Seq.distinct |> Seq.sort |> Seq.map (fun d -> (cname, d), method)) @@ -448,11 +448,11 @@ module internal Cobertura = Map.empty report.Descendants("Module".X) - |> Seq.filter (fun m -> m.Descendants("Class".X) |> Seq.isEmpty |> not) + |> Seq.filter (_.Descendants("Class".X) >> Seq.isEmpty >> not) |> Seq.iter (fun ``module`` -> let mname = ``module``.Descendants("ModuleName".X) - |> Seq.map (fun x -> x.Value) + |> Seq.map _.Value |> Seq.head let package = @@ -560,6 +560,6 @@ module internal Cobertura = rewrite |> Option.ofObj - |> Option.iter (fun d -> d.Save(path.Value |> Option.get)) + |> Option.iter _.Save(path.Value |> Option.get) (result, 0uy, String.Empty) \ No newline at end of file diff --git a/AltCover.Engine/CommandLine.fs b/AltCover.Engine/CommandLine.fs index 45506e6b6..ac31ac2df 100644 --- a/AltCover.Engine/CommandLine.fs +++ b/AltCover.Engine/CommandLine.fs @@ -23,6 +23,7 @@ module internal Process = // Work around observed unreliability of WaitForExit() // with an unbounded wait under mono on travis-ci member self.WaitForExitCustom() = + // [] let rec loop () = try if self.WaitForExit(1000) then @@ -140,7 +141,7 @@ module internal CommandLine = let internal write (writer: TextWriter) colour data = if not (String.IsNullOrEmpty(data)) then - writeColoured writer colour (fun w -> w.WriteLine(data)) + writeColoured writer colour _.WriteLine(data) let internal filter line f = if line |> String.IsNullOrEmpty |> not then @@ -202,6 +203,7 @@ module internal CommandLine = [] + [] let rec internal doRetry action log limit (rest: int) depth f = try action f @@ -494,6 +496,6 @@ module internal CommandLine = "InstantiateArgumentExceptionCorrectlyRule", Scope = "member", // MethodDefinition Target = - "AltCover.CommandLine/I/transform@286::Invoke(System.String[])", + "AltCover.CommandLine/I/transform@288::Invoke(System.String[])", Justification = "Inlined library code")>] () \ No newline at end of file diff --git a/AltCover.Engine/Filter.fs b/AltCover.Engine/Filter.fs index 2ba7e0860..340f9a92e 100644 --- a/AltCover.Engine/Filter.fs +++ b/AltCover.Engine/Filter.fs @@ -154,6 +154,7 @@ module internal Filter = 0x00uy 0x00uy ] + [] let rec internal matchAttribute (name: Regex) f (nameProvider: Object) = (match nameProvider with | :? MethodDefinition as m -> @@ -188,7 +189,7 @@ module internal Filter = else true | _ -> true) - |> Seq.exists (fun attr -> name.IsMatch attr.AttributeType.FullName) + |> Seq.exists (_.AttributeType.FullName >> name.IsMatch) |> f | _ -> false) @@ -208,15 +209,15 @@ module internal Filter = // Algebraic types have debug proxies nested in the base type which are not attributed at the type level let baseType = Option.ofObj m.DeclaringType.DeclaringType - |> Option.filter (fun t -> t.HasCustomAttributes) - |> Option.map (fun t -> t.CustomAttributes :> seq) + |> Option.filter _.HasCustomAttributes + |> Option.map (_.CustomAttributes >> Seq.cast) |> Option.filter (Seq.isEmpty >> not) |> Option.defaultValue Seq.empty let thisType = Some m.DeclaringType - |> Option.filter (fun t -> t.HasCustomAttributes) - |> Option.map (fun t -> t.CustomAttributes :> seq) + |> Option.filter _.HasCustomAttributes + |> Option.map (_.CustomAttributes >> Seq.cast) |> Option.filter (Seq.isEmpty >> not) |> Option.defaultValue Seq.empty @@ -319,14 +320,10 @@ module internal Filter = match filter.Scope with | File -> I.matchItem filter.Regex f nameProvider Path.GetFileName | Assembly -> - I.matchItem filter.Regex f nameProvider (fun assembly -> - assembly.Name.Name) + I.matchItem filter.Regex f nameProvider (_.Name.Name) | Module -> - I.matchItem filter.Regex f nameProvider (fun ``module`` -> - ``module``.Assembly.Name.Name) - | Type -> - I.matchItem filter.Regex f nameProvider (fun typeDef -> - typeDef.FullName) + I.matchItem filter.Regex f nameProvider (_.Assembly.Name.Name) + | Type -> I.matchItem filter.Regex f nameProvider (_.FullName) | Method -> I.matchItem filter.Regex @@ -337,7 +334,7 @@ module internal Filter = let decltype = methodDef.DeclaringType.BaseType |> Option.ofObj - |> Option.map (fun x -> x.Name) + |> Option.map _.Name |> Option.defaultValue String.Empty let name = methodDef.Name diff --git a/AltCover.Engine/Gendarme.fs b/AltCover.Engine/Gendarme.fs index 2be7664b1..342b399af 100644 --- a/AltCover.Engine/Gendarme.fs +++ b/AltCover.Engine/Gendarme.fs @@ -129,7 +129,7 @@ module internal Gendarme = | FlowControl.Branch -> c + (Option.ofObj i.Previous - |> Option.map (fun (previous: Instruction) -> previous.OpCode.Code) + |> Option.map _.OpCode.Code |> I.``detect ternary pattern``) | _ -> c) 1 diff --git a/AltCover.Engine/Instrument.fs b/AltCover.Engine/Instrument.fs index e7473c7d0..17685ed7b 100644 --- a/AltCover.Engine/Instrument.fs +++ b/AltCover.Engine/Instrument.fs @@ -221,7 +221,7 @@ module internal Instrument = let internal recordingMethod (recordingAssembly: AssemblyDefinition) = recordingAssembly.MainModule.GetAllTypes() |> Seq.filter (fun t -> t.FullName == "AltCover.Recorder.Instance") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.map (fun t -> (t.Name, t)) |> Seq.filter (fun (n, _) -> n == "Visit" || n == "Push" || n == "Pop") |> Seq.sortBy fst @@ -229,6 +229,56 @@ module internal Instrument = |> Seq.toList |> List.rev + let internal updateVisibleTo (assembly: AssemblyDefinition) = + let va = + assembly.CustomAttributes + |> Seq.filter (fun a -> + a.AttributeType.FullName.Equals( + "System.Runtime.CompilerServices.InternalsVisibleToAttribute", + StringComparison.Ordinal + )) + |> Seq.toList + + let tag a = + match CoverageParameters.defaultStrongNameKey with + | None -> a + | Some key -> + a + + ", PublicKey=" + + (key.PublicKey + |> Seq.toArray + |> BitConverter.ToString) + .Replace("-", String.Empty) + + let attrtype = va |> Seq.tryHead + + let injectRef (ref: string) = + let constructor = attrtype.Value.Constructor + + let blob = + System.Collections.Generic.List(System.Text.Encoding.ASCII.GetBytes(ref)) + + blob.Insert(0, 0uy) + blob.Insert(0, 1uy) + blob.AddRange [ 0uy; 0uy ] + + let inject = + CustomAttribute(constructor, blob |> Seq.toArray) + + inject.ConstructorArguments.Add( + CustomAttributeArgument(constructor.Parameters[0].ParameterType, ref) + ) + + assembly.CustomAttributes.Add inject + + va + |> List.map (_.ConstructorArguments >> Seq.head) + |> List.map (_.Value.ToString()) + |> List.map (_.Split(',') >> Seq.head >> tag) + |> List.iter injectRef + + assembly + // Applies a new key to an assembly name // param name="assemblyName">The name to update // param name="key">The possibly empty key to use @@ -350,7 +400,7 @@ module internal Instrument = |> List.iter (fun (property, value) -> let pathGetterDef = definition.MainModule.GetTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name == property) |> Seq.head @@ -370,7 +420,7 @@ module internal Instrument = |> List.iter (fun (property, value) -> let pathGetterDef = definition.MainModule.GetTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name == property) |> Seq.head @@ -568,10 +618,7 @@ module internal Instrument = let prior = match existingDependencies with | None -> Set.empty - | Some p -> - p.Value.Object - |> Seq.map (fun p -> p.Key) - |> Set.ofSeq + | Some p -> p.Value.Object |> Seq.map _.Key |> Set.ofSeq let addFirst (properties: KeyValuePair seq) @@ -818,7 +865,7 @@ module internal Instrument = ) |> sink - writeAssembly definition first + writeAssembly (updateVisibleTo definition) first targets |> Seq.tail @@ -1288,7 +1335,7 @@ module internal Instrument = let getterDef = recorder.MainModule.GetTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name == "get_modules") |> Seq.head @@ -1347,10 +1394,9 @@ module internal Instrument = state.RecorderSource |> Option.ofObj - |> Option.iter (fun a -> a.Close()) + |> Option.iter _.Close() - state.AsyncSupport - |> Option.iter (fun a -> a.Close()) + state.AsyncSupport |> Option.iter _.Close() { state with RecordingAssembly = null @@ -1415,10 +1461,9 @@ module internal Instrument = state.RecorderSource |> Option.ofObj - |> Option.iter (fun a -> a.Close()) + |> Option.iter _.Close() - state.AsyncSupport - |> Option.iter (fun a -> a.Close()) + state.AsyncSupport |> Option.iter _.Close() reraise () @@ -1430,4 +1475,12 @@ module internal Instrument = // param name="assemblies">List of assembly paths to visit // Stateful visitor function let internal instrumentGenerator (assemblies: string list) = - Visitor.encloseState I.instrumentationVisitor (InstrumentContext.Build assemblies) \ No newline at end of file + Visitor.encloseState I.instrumentationVisitor (InstrumentContext.Build assemblies) + +[] +() \ No newline at end of file diff --git a/AltCover.Engine/Json.fs b/AltCover.Engine/Json.fs index 3c96165bb..0a7ab364f 100644 --- a/AltCover.Engine/Json.fs +++ b/AltCover.Engine/Json.fs @@ -109,7 +109,7 @@ module internal Json = def) let internal maybeDispose (def: AssemblyDefinition option) = - def |> Option.iter (fun d -> d.Dispose()) + def |> Option.iter _.Dispose() // try to find the method in the assembly [ Option.bind (fun a -> - a.MainModule.GetAllTypes() - |> Seq.tryFind (fun t -> t.FullName == cname)) + |> Option.bind ( + _.MainModule.GetAllTypes() + >> Seq.tryFind (fun t -> t.FullName == cname) + ) let md = td - |> Option.bind (fun t -> - t.Methods - |> Seq.tryFind (fun m -> + |> Option.bind ( + _.Methods + >> Seq.tryFind (fun m -> m.FullName == mname || (m.Name == mname && (let dbg = m.DebugInformation @@ -143,7 +144,8 @@ module internal Json = && (let pt = dbg.SequencePoints |> Seq.head pt.StartLine = sp.Value.SL - && pt.StartColumn = sp.Value.SC))))) + && pt.StartColumn = sp.Value.SC)))) + ) let truemd = md @@ -151,12 +153,12 @@ module internal Json = let methodName = truemd - |> Option.map (fun m -> m.FullName) + |> Option.map _.FullName |> Option.defaultValue fallbackm let className = truemd - |> Option.map (fun m -> m.DeclaringType.FullName) + |> Option.map _.DeclaringType.FullName |> Option.defaultValue fallbackc (className, methodName) @@ -219,7 +221,7 @@ module internal Json = let parse n = x.Attribute(XName.Get n) |> Option.ofObj - |> Option.map (fun a -> a.Value |> Int32.TryParse |> snd) + |> Option.map (_.Value >> Int32.TryParse >> snd) |> Option.defaultValue 0 { NativeJson.SeqPnt.VC = parse "visitcount" @@ -256,11 +258,11 @@ module internal Json = else let found = s.Ancestors("module".X) - |> Seq.collect (fun m -> m.Descendants("altcover.file".X)) + |> Seq.collect _.Descendants("altcover.file".X) |> Seq.filter (fun f -> f.Attribute(XName.Get "document").Value == doc) |> Seq.tryHead - |> Option.map (fun f -> f.Attribute(XName.Get "embed").Value) + |> Option.map _.Attribute(XName.Get "embed").Value |> Option.filter (String.IsNullOrWhiteSpace >> not) |> Option.defaultValue String.Empty @@ -279,7 +281,7 @@ module internal Json = jmethods.Values |> Seq.iter (fun jm -> jm.SeqPnts - |> Seq.groupBy (fun s -> s.SL) + |> Seq.groupBy _.SL |> Seq.iter (fun (l, ss) -> jm.Lines.[l] <- lineVisits ss))) finally maybeDispose def @@ -315,7 +317,7 @@ module internal Json = let embed = x.Attribute(XName.Get "altcover.embed") |> Option.ofObj - |> Option.map (fun e -> e.Value) + |> Option.map _.Value |> Option.defaultValue String.Empty files.Add( @@ -376,7 +378,7 @@ module internal Json = let parse n = s.Attribute(XName.Get n) |> Option.ofObj - |> Option.map (fun a -> a.Value |> Int32.TryParse |> snd) + |> Option.map (_.Value >> Int32.TryParse >> snd) |> Option.defaultValue 0 let docname = @@ -399,11 +401,12 @@ module internal Json = let t2 = NativeJson.Times() t - |> Seq.map (fun x -> - x.Attribute(XName.Get "time").Value - |> Int64.TryParse - |> snd - |> NativeJson.fromTracking) + |> Seq.map ( + _.Attribute(XName.Get "time").Value + >> Int64.TryParse + >> snd + >> NativeJson.fromTracking + ) |> t2.AddRange t2 @@ -418,10 +421,11 @@ module internal Json = let t2 = NativeJson.Tracks() t - |> Seq.map (fun x -> - x.Attribute(XName.Get "uid").Value - |> Int32.TryParse - |> snd) + |> Seq.map ( + _.Attribute(XName.Get "uid").Value + >> Int32.TryParse + >> snd + ) |> t2.AddRange t2 @@ -454,7 +458,7 @@ module internal Json = let parse n = s.Attribute(XName.Get n) |> Option.ofObj - |> Option.map (fun a -> a.Value |> Int32.TryParse |> snd) + |> Option.map (_.Value >> Int32.TryParse >> snd) |> Option.defaultValue 0 let docname = @@ -501,10 +505,11 @@ module internal Json = let t2 = NativeJson.Tracks() t - |> Seq.map (fun x -> - x.Attribute(XName.Get "uid").Value - |> Int32.TryParse - |> snd) + |> Seq.map ( + _.Attribute(XName.Get "uid").Value + >> Int32.TryParse + >> snd + ) |> t2.AddRange t2 diff --git a/AltCover.Engine/LCov.fs b/AltCover.Engine/LCov.fs index 9de2c00cf..8ec447748 100644 --- a/AltCover.Engine/LCov.fs +++ b/AltCover.Engine/LCov.fs @@ -33,10 +33,11 @@ module internal LCov = let (_, s) = m s - |> Seq.map (fun x -> - x.Attribute("line".X).Value - |> Int32.TryParse - |> snd) + |> Seq.map ( + _.Attribute("line".X).Value + >> Int32.TryParse + >> snd + ) |> Seq.min let internal multiSort (by: 'a -> int) (l: (string * 'a seq) seq) = @@ -111,7 +112,7 @@ FN:4,(anonymous_0) |> Seq.exists (fun s -> s.Attribute("excluded".X).Value != "true")) |> Seq.collect (fun m -> m.Descendants("seqpnt".X) - |> Seq.groupBy (fun s -> s.Attribute("document".X).Value) + |> Seq.groupBy _.Attribute("document".X).Value |> Seq.map (fun (d, l) -> (d, (m, l)))) |> Seq.groupBy fst |> Seq.map (fun (d, dmlist) -> d, dmlist |> Seq.map snd) @@ -207,11 +208,12 @@ FN:4,(anonymous_0) let (lf, lh) = methods |> Seq.collect snd - |> Seq.filter (fun b -> - b.Attribute("line".X).Value - |> String.IsNullOrWhiteSpace - |> not) - |> Seq.groupBy (fun b -> b.Attribute("line".X).Value) + |> Seq.filter ( + _.Attribute("line".X).Value + >> String.IsNullOrWhiteSpace + >> not + ) + |> Seq.groupBy _.Attribute("line".X).Value |> Seq.sortBy (fst >> Int32.TryParse >> snd) |> Seq.fold (fun (f, (h: int)) (sl, bs) -> @@ -242,7 +244,7 @@ FN:4,(anonymous_0) report.Descendants("Module".X) |> Seq.iter (fun assembly -> assembly.Descendants("File".X) - |> Seq.sortBy (fun f -> f.Attribute("fullPath".X).Value) + |> Seq.sortBy _.Attribute("fullPath".X).Value |> Seq.iter (fun f -> //If available, a tracefile begins with the testname which // is stored in the following format: @@ -252,7 +254,7 @@ FN:4,(anonymous_0) "TN: " + (assembly.Descendants("ModuleName".X) |> Seq.tryHead - |> Option.map (fun n -> n.Value) + |> Option.map _.Value |> Option.defaultValue String.Empty) ) // For each source file referenced in the .da file, there is a section @@ -270,11 +272,12 @@ FN:4,(anonymous_0) // FN:, let methods = p.Descendants("Method".X) - |> Seq.filter (fun m -> - m.Descendants() - |> Seq.exists (fun r -> + |> Seq.filter ( + _.Descendants() + >> Seq.exists (fun r -> let f = r.Attribute("fileid".X) - f.IsNotNull && f.Value == uid)) + f.IsNotNull && f.Value == uid) + ) |> Seq.toList let FN (ms: XElement list) = // fsharplint:disable-line NonPublicValuesNames @@ -353,7 +356,7 @@ FN:4,(anonymous_0) let branch (ms: XElement list) = let (brf, brh, _) = ms - |> Seq.collect (fun m -> m.Descendants("BranchPoint".X)) + |> Seq.collect _.Descendants("BranchPoint".X) |> Seq.filter (fun s -> s.Attribute("fileid".X).Value == uid) |> Seq.filter (fun b -> b.Attribute("sl".X).Value @@ -407,14 +410,13 @@ FN:4,(anonymous_0) // checksumming algorithm. let (lf, lh) = methods - |> Seq.collect (fun m -> m.Descendants("SequencePoint".X)) + |> Seq.collect _.Descendants("SequencePoint".X) |> Seq.filter (fun s -> s.Attribute("fileid".X).Value == uid) |> Seq.filter (fun b -> b.Attribute("sl".X).Value |> String.IsNullOrWhiteSpace |> not) - |> Seq.groupBy (fun b -> - b.Attribute("sl".X).Value |> Int32.TryParse |> snd) + |> Seq.groupBy (_.Attribute("sl".X).Value >> Int32.TryParse >> snd) |> Seq.sortBy fst |> Seq.fold (fun (f, h) (line, points) -> diff --git a/AltCover.Engine/Main.fs b/AltCover.Engine/Main.fs index b01eae925..6dea38cd1 100644 --- a/AltCover.Engine/Main.fs +++ b/AltCover.Engine/Main.fs @@ -438,7 +438,7 @@ module internal Main = String.Join( String.Empty, t - |> Seq.map (fun x -> x.ToString("x2", CultureInfo.InvariantCulture)) + |> Seq.map _.ToString("x2", CultureInfo.InvariantCulture) ) == "4ebffcaabf10ce6a") // recorder.snk |> Option.defaultValue false @@ -542,9 +542,9 @@ module internal Main = // Track the symbol-bearing assemblies let assemblies = instrumentFromInfos - |> Seq.map (fun sourceInfo -> - sourceInfo.GetFiles() - |> Seq.fold + |> Seq.map ( + _.GetFiles() + >> Seq.fold (fun (accumulator: AssemblyInfo list) info -> let fullName = info.FullName @@ -598,7 +598,7 @@ module internal Main = |> Convert.ToBase64String Refs = def.MainModule.AssemblyReferences - |> Seq.map (fun r -> r.Name) + |> Seq.map _.Name |> Seq.toList } :: accumulator) |> Option.defaultValue accumulator) @@ -607,15 +607,16 @@ module internal Main = |> Output.verbose accumulator)) - []) + [] + ) |> Seq.toList |> Seq.concat - |> Seq.groupBy (fun a -> a.Hash) // assume hash is unique + |> Seq.groupBy _.Hash // assume hash is unique |> Seq.map (fun (n, agroup) -> { (agroup |> Seq.head) with Path = agroup - |> Seq.map (fun aa -> aa.Path) + |> Seq.map _.Path |> Seq.concat |> Seq.toList }) |> Seq.toList @@ -625,7 +626,7 @@ module internal Main = // The set of all names w/o location let candidates = assemblies - |> Seq.map (fun a -> a.Name) + |> Seq.map _.Name |> Seq.fold (fun (s: Set) n -> Set.add n s) Set.empty let simplified = @@ -636,6 +637,7 @@ module internal Main = a.Refs |> List.filter (fun n -> Set.contains n candidates) }) + // [] let rec bundle unassigned unresolved collection n = match unassigned with | [] -> collection @@ -644,9 +646,8 @@ module internal Main = (if n <= 1 then unassigned else - unassigned - |> List.filter (fun u -> u.Refs |> List.isEmpty)) - |> List.sortBy (fun u -> u.Name) + unassigned |> List.filter (_.Refs >> List.isEmpty)) + |> List.sortBy _.Name let waiting = stage @@ -654,7 +655,7 @@ module internal Main = let next = unassigned - |> List.filter (fun u -> u.Refs |> List.isEmpty |> not) + |> List.filter (_.Refs >> List.isEmpty >> not) |> List.map (fun a -> { a with Refs = diff --git a/AltCover.Engine/Naming.fs b/AltCover.Engine/Naming.fs index c4f3c4e1a..2b8d9f9fc 100644 --- a/AltCover.Engine/Naming.fs +++ b/AltCover.Engine/Naming.fs @@ -31,6 +31,7 @@ module internal Naming = "AvoidSpeculativeGenerality too")>] let internal typeRefName (def: TypeReference) = emptyIfIsNullOrWhiteSpace def.Name + // NOT [] let rec internal fullTypeRefName (def: TypeReference) = let deft = def.DeclaringType @@ -47,6 +48,7 @@ module internal Naming = emptyIfIsNullOrWhiteSpace def.Name // "Public" interface + // NOT [] let rec internal fullTypeName (def: TypeDefinition) = let deft = def.DeclaringType @@ -61,9 +63,9 @@ module internal Naming = String.Join( ",", def.Parameters - |> Seq.filter (fun x -> x.IsNotNull) - |> Seq.map (fun p -> p.ParameterType) - |> Seq.filter (fun x -> x.IsNotNull) + |> Seq.filter _.IsNotNull + |> Seq.map _.ParameterType + |> Seq.filter _.IsNotNull |> Seq.map I.fullTypeRefName ) @@ -74,7 +76,7 @@ module internal Naming = String.Join( ",", def.GenericParameters - |> Seq.filter (fun x -> x.IsNotNull) + |> Seq.filter _.IsNotNull |> Seq.map I.fullTypeRefName ) else diff --git a/AltCover.Engine/NativeJson.fs b/AltCover.Engine/NativeJson.fs index ae326b747..b13a3479a 100644 --- a/AltCover.Engine/NativeJson.fs +++ b/AltCover.Engine/NativeJson.fs @@ -137,12 +137,11 @@ module #if RUNNER || GUI // Deserialization --------------------------------------------------------- - let internal timesFromJsonValue (j: JsonValue) = - j.Array |> Seq.map (fun a -> a.String) |> Times + let internal timesFromJsonValue (j: JsonValue) = j.Array |> Seq.map (_.String) |> Times let internal tracksFromJsonValue (j: JsonValue) = j.Array - |> Seq.map (fun a -> a.Number |> Math.Round |> int) + |> Seq.map (_.Number >> Math.Round >> int) |> Tracks let internal zero = JsonValue(0.0) @@ -205,7 +204,7 @@ module Ordinal = (softNumberFromKey o "Ordinal") |> uint Hits = (softNumberFromKey o "Hits") // Optionals - Id = valueFromKey o "Id" 0 (fun t -> t.Number |> Math.Round |> int) + Id = valueFromKey o "Id" 0 (_.Number >> Math.Round >> int) Times = timesByKey o Tracks = tracksByKey o } @@ -230,8 +229,11 @@ module let o = j.Object let tid = - valueFromKey o "TId" (System.Nullable()) (fun t -> - t.Number |> Math.Round |> int |> Nullable) + valueFromKey + o + "TId" + (System.Nullable()) + (_.Number >> Math.Round >> int >> Nullable) { Lines = valueFromKey o "Lines" (Lines()) linesFromJsonValue Branches = valueFromKey o "Branches" (Branches()) branchesFromJsonValue @@ -901,11 +903,8 @@ module let targets = value.Branches - |> Seq.groupBy (fun b -> b.Line) - |> Seq.sumBy (fun (_, x) -> - x - |> Seq.distinctBy (fun bx -> bx.EndOffset) - |> Seq.length) + |> Seq.groupBy _.Line + |> Seq.sumBy (fun (_1, x) -> x |> Seq.distinctBy _.EndOffset |> Seq.length) m .Attribute(XName.Get "cyclomaticComplexity") @@ -1036,7 +1035,7 @@ module let internal summarize sd (m: XElement) name = let (nb, vb, ns, vs) = m.Descendants(XName.Get name) - |> Seq.collect (fun m2 -> m2.Elements(XName.Get "Summary")) + |> Seq.collect _.Elements(XName.Get "Summary") |> Seq.fold (fun (bn, bv, sn, sv) ms -> (bn + valueOf ms "numBranchPoints", @@ -1126,7 +1125,7 @@ module kvp.Value |> Seq.tryFind (fun kvp -> kvp.Key == "\u00ABAltCover.embed\u00BB") - |> Option.bind (fun kvp -> kvp.Value.Keys |> Seq.tryHead) + |> Option.bind (_.Value.Keys >> Seq.tryHead) |> Option.iter (fun embed -> item.Add(XAttribute(XName.Get "altcover.embed", embed))) @@ -1197,7 +1196,7 @@ module let topword = offset |> Option.ofObj - |> Option.map (fun x -> x.Value |> Int64.TryParse |> snd) + |> Option.map (_.Value >> Int64.TryParse >> snd) |> Option.defaultValue 0L let sl = diff --git a/AltCover.Engine/OpenCover.fs b/AltCover.Engine/OpenCover.fs index d201d8783..1ce73d28d 100644 --- a/AltCover.Engine/OpenCover.fs +++ b/AltCover.Engine/OpenCover.fs @@ -74,7 +74,7 @@ module internal OpenCover = module internal I = let internal setChain (xbranch: XElement) branch = let chain = - branch.Target.Tail |> List.map (fun i -> i.Offset) + branch.Target.Tail |> List.map _.Offset xbranch.SetAttributeValue( "offsetchain".X, @@ -84,7 +84,7 @@ module internal OpenCover = String.Join( " ", l - |> Seq.map (fun i -> i.ToString(CultureInfo.InvariantCulture)) + |> Seq.map _.ToString(CultureInfo.InvariantCulture) ) ) @@ -348,10 +348,10 @@ module internal OpenCover = let attr = element.Attribute("skippedDueTo".X) |> Option.ofObj - |> Option.map (fun a -> a.Value) + |> Option.map _.Value if e.Interesting && attr = Some "File" then - element.SetAttributeValue("skippedDueTo".X, null) + element.SetAttributeValue("skippedDueTo".X, nullObject) match (e.Interesting, e.SeqPnt, s.Excluded) with | (true, Some codeSegment, Nothing) -> @@ -440,10 +440,11 @@ module internal OpenCover = let interleave = List.concat [ sp; bp; [ tail ] ] - |> List.sortBy (fun x -> - x.Attribute("offset".X).Value - |> Int32.TryParse - |> snd) + |> List.sortBy ( + _.Attribute("offset".X).Value + >> Int32.TryParse + >> snd + ) let (np, _, _) = interleave @@ -460,7 +461,7 @@ module internal OpenCover = else if bp |> List.isEmpty |> not then let np = bp - |> List.groupBy (fun bp -> bp.Attribute("offset".X).Value) + |> List.groupBy _.Attribute("offset".X).Value |> Seq.fold (fun np0 (_, b) -> safeMultiply (Seq.length b) np0) 1 method.SetAttributeValue("nPathComplexity".X, np) @@ -533,7 +534,7 @@ module internal OpenCover = if skipped then method.Elements("Summary".X) |> Seq.toList - |> Seq.iter (fun x -> x.Remove()) + |> Seq.iter _.Remove() else method.Elements("Summary".X) |> Seq.iter (addMethodSummary s cc) @@ -651,9 +652,9 @@ module internal OpenCover = head.Parent.Descendants("SequencePoint".X) head.Parent.Descendants("BranchPoint".X) ] |> Seq.concat - |> Seq.map (fun d -> d.Attribute("fileid".X)) - |> Seq.filter (fun a -> a.IsNotNull) - |> Seq.map (fun a -> a.Value) + |> Seq.map _.Attribute("fileid".X) + |> Seq.filter _.IsNotNull + |> Seq.map _.Value |> Seq.distinct |> Seq.map Int32.TryParse |> Seq.filter fst @@ -729,6 +730,6 @@ module internal OpenCover = "PreferStringComparisonOverrideRule", Scope = "member", Target = - "AltCover.OpenCover/handleOrdinals@451-3::Invoke(System.Tuple`3,System.Xml.Linq.XElement)", + "AltCover.OpenCover/handleOrdinals@452-3::Invoke(System.Tuple`3,System.Xml.Linq.XElement)", Justification = "Compiler generated")>] () \ No newline at end of file diff --git a/AltCover.Engine/Output.fs b/AltCover.Engine/Output.fs index 8a6a4492d..8145e2541 100644 --- a/AltCover.Engine/Output.fs +++ b/AltCover.Engine/Output.fs @@ -67,6 +67,7 @@ module internal Output = use writer = new StreamWriter(stream) + //[] let rec logException padding ex = ex.ToString() |> writer.WriteLine diff --git a/AltCover.Engine/PostProcess.fs b/AltCover.Engine/PostProcess.fs index e116afd88..1fd26f534 100644 --- a/AltCover.Engine/PostProcess.fs +++ b/AltCover.Engine/PostProcess.fs @@ -151,7 +151,7 @@ module internal PostProcess = sp |> Seq.take 1 - |> Seq.collect (fun p -> p.Attributes) + |> Seq.collect _.Attributes |> Seq.iter (fun a -> m.SetAttribute a.Name a.Value)) [ Seq.map (fun m -> m.InnerText) + |> Seq.map _.InnerText |> Seq.head let vc = @@ -325,7 +325,7 @@ module internal PostProcess = let interleave = nodes - |> Seq.sortBy (fun x -> x.GetAttribute(orderAttr) |> Int32.TryParse |> snd) + |> Seq.sortBy (_.GetAttribute(orderAttr) >> Int32.TryParse >> snd) interleave |> Seq.fold diff --git a/AltCover.Engine/Primitive.fsi b/AltCover.Engine/Primitive.fsi index eb7be30c6..e83625dd0 100644 --- a/AltCover.Engine/Primitive.fsi +++ b/AltCover.Engine/Primitive.fsi @@ -107,7 +107,7 @@ namespace AltCoverFake.DotNet.Testing type PrepareOptions = { /// - /// Corresponds to command line option ` -i, --inputDirectory=VALUE` + /// Corresponds to command line option `-i, --inputDirectory=VALUE` /// InputDirectories: seq /// @@ -123,7 +123,7 @@ namespace AltCoverFake.DotNet.Testing /// Dependencies: seq /// - /// Corresponds to command line option ` -k, --key=VALUE` + /// Corresponds to command line option `-k, --key=VALUE` /// Keys: seq /// @@ -151,7 +151,7 @@ namespace AltCoverFake.DotNet.Testing /// TypeFilter: seq /// - /// Corresponds to command line option ` -m, --methodFilter=VALUE` + /// Corresponds to command line option `-m, --methodFilter=VALUE` /// MethodFilter: seq /// @@ -231,7 +231,7 @@ namespace AltCoverFake.DotNet.Testing /// LocalSource: bool /// - /// Corresponds to command line option ` -v, --visibleBranches` + /// Corresponds to command line option `-v, --visibleBranches` /// VisibleBranches: bool /// @@ -239,7 +239,7 @@ namespace AltCoverFake.DotNet.Testing /// ShowStatic: string /// - /// Corresponds to command line option ` --showGenerated` + /// Corresponds to command line option `--showGenerated` /// ShowGenerated: bool /// @@ -247,7 +247,7 @@ namespace AltCoverFake.DotNet.Testing /// Verbosity : System.Diagnostics.TraceLevel /// - /// Corresponds to command line option ` --trivia` + /// Corresponds to command line option `--trivia` /// Trivia: bool } diff --git a/AltCover.Engine/ProgramDatabase.fs b/AltCover.Engine/ProgramDatabase.fs index a2f1b8281..d9a7f1997 100644 --- a/AltCover.Engine/ProgramDatabase.fs +++ b/AltCover.Engine/ProgramDatabase.fs @@ -31,7 +31,7 @@ module internal ProgramDatabase = .GetMethod("GetEmbeddedPortablePdbEntry") let internal getEmbeddedPortablePdbEntry (assembly: AssemblyDefinition) = - getEmbed.Invoke(null, [| assembly.MainModule.GetDebugHeader() :> obj |]) + getEmbed.Invoke(nullObject, [| assembly.MainModule.GetDebugHeader() :> obj |]) :?> ImageDebugHeaderEntry let internal getSymbolsByFolder fileName folderName = @@ -68,7 +68,7 @@ module internal ProgramDatabase = |> Seq.filter (fun e -> e.Data.Length > 0x18 && e.Directory.Type = ImageDebugType.CodeView) - |> Seq.map (fun x -> x.Data) + |> Seq.map _.Data |> Seq.filter (fun x -> lead x = 1396986706) |> Seq.map extractGuid |> Seq.toList @@ -146,7 +146,7 @@ module internal ProgramDatabase = classtype.GetConstructor( binding, null, - parameters |> Array.map (fun x -> x.GetType()), + parameters |> Array.map _.GetType(), [||] ) @@ -176,7 +176,7 @@ module internal ProgramDatabase = let msfdirectory, dir = construct "Microsoft.Cci.Pdb.MsfDirectory" [| reader; head; bits |] - let datastream = + let datastream: Object = (field msfdirectory "streams" dir) :?> System.Collections.IEnumerable |> Seq.cast |> Seq.skip 1 @@ -226,9 +226,9 @@ module internal ProgramDatabase = (tokens, Some assembly.MainModule - |> Option.filter (fun x -> x.HasDebugHeader) - |> Option.map (fun x -> x.GetDebugHeader()) - |> Option.filter (fun x -> x.HasEntries) + |> Option.filter _.HasDebugHeader + |> Option.map _.GetDebugHeader() + |> Option.filter _.HasEntries |> Option.bind (fun x -> x.Entries |> Seq.filter (fun e -> @@ -312,10 +312,10 @@ module internal ProgramDatabase = // maybe move this somewhere else, now? let internal getModuleDocuments (``module``: ModuleDefinition) = ``module``.GetAllTypes() - |> Seq.collect (fun t -> t.GetMethods()) - |> Seq.collect (fun m -> m.DebugInformation.SequencePoints) - |> Seq.map (fun s -> s.Document) - |> Seq.distinctBy (fun d -> d.Url) + |> Seq.collect _.GetMethods() + |> Seq.collect _.DebugInformation.SequencePoints + |> Seq.map _.Document + |> Seq.distinctBy _.Url |> Seq.toList [ Seq.tryHead - |> Option.map (fun x -> x.AddBeforeSelf) + |> Option.map _.AddBeforeSelf |> Option.defaultValue head.Add) [| element |] diff --git a/AltCover.Engine/Runner.fs b/AltCover.Engine/Runner.fs index d673d1559..b9111a1a6 100644 --- a/AltCover.Engine/Runner.fs +++ b/AltCover.Engine/Runner.fs @@ -93,6 +93,7 @@ type internal Threshold = let chars = x.ToUpperInvariant() |> Seq.toList + // [] let rec partition data result = match data with | [] -> result @@ -260,7 +261,7 @@ module internal Runner = let classes = methods - |> Seq.groupBy (fun m -> m.Attribute("class".X).Value) + |> Seq.groupBy _.Attribute("class".X).Value |> Seq.toList let isVisited (x: XElement) = @@ -269,14 +270,16 @@ module internal Runner = let vclasses = classes - |> Seq.filter (fun (_, ms) -> + |> Seq.filter (fun (dummy, ms) -> + ignore dummy + ms - |> Seq.exists (fun m -> m.Descendants("seqpnt".X) |> Seq.exists isVisited)) + |> Seq.exists (_.Descendants("seqpnt".X) >> Seq.exists isVisited)) |> Seq.length let vmethods = methods - |> Seq.filter (fun m -> m.Descendants("seqpnt".X) |> Seq.exists isVisited) + |> Seq.filter (_.Descendants("seqpnt".X) >> Seq.exists isVisited) |> Seq.length let points = @@ -321,9 +324,9 @@ module internal Runner = let internal emitAltCrapScore go (methods: XElement seq) = let value = (methods - |> Seq.map (fun m -> m.Attribute("crapScore".X)) - |> Seq.filter (fun a -> a.IsNotNull) - |> Seq.map (fun d -> d.Value.InvariantParseDouble() |> snd) + |> Seq.map _.Attribute("crapScore".X) + |> Seq.filter _.IsNotNull + |> Seq.map (_.Value.InvariantParseDouble() >> snd) |> Seq.max) if go then @@ -342,15 +345,16 @@ module internal Runner = let classes = report.Descendants("Class".X) - |> Seq.filter (fun c -> c.Attribute("skippedDueTo".X) |> isNull) - |> Seq.filter (fun c -> c.Descendants("Method".X) |> Seq.isEmpty |> not) + |> Seq.filter (_.Attribute("skippedDueTo".X) >> isNull) + |> Seq.filter (_.Descendants("Method".X) >> Seq.isEmpty >> not) |> Seq.toList let vclasses = classes - |> Seq.filter (fun c -> - c.Descendants("Method".X) - |> Seq.exists (fun m -> m.Attribute("visited".X).Value == "true")) + |> Seq.filter ( + _.Descendants("Method".X) + >> Seq.exists (fun m -> m.Attribute("visited".X).Value == "true") + ) |> Seq.length let nc = classes.Length @@ -368,8 +372,8 @@ module internal Runner = let methods = classes - |> Seq.collect (fun c -> c.Descendants("Method".X)) - |> Seq.filter (fun c -> c.Attribute("skippedDueTo".X) |> isNull) + |> Seq.collect _.Descendants("Method".X) + |> Seq.filter (_.Attribute("skippedDueTo".X) >> isNull) |> Seq.toList let vm = @@ -511,7 +515,7 @@ module internal Runner = let crapvalue = crap |> Option.ofObj - |> Option.map (fun a -> a.Value) + |> Option.map _.Value |> Option.defaultValue "0.0" let extra = @@ -697,8 +701,7 @@ module internal Runner = | None -> [ best ] | Some t -> let found = - covered - |> List.map (fun d -> d.InvariantParseDouble()) + covered |> List.map _.InvariantParseDouble() let ceil (f: float) (value: float) = if f <= value && value > 0.0 && f > 0.0 then @@ -1011,6 +1014,7 @@ module internal Runner = use formatter = new System.IO.BinaryReader(results) + // [] let rec sink hitcount = let hit = try @@ -1032,6 +1036,7 @@ module internal Runner = let t = Dictionary>() + // [] let rec ``module`` () = let m = formatter.ReadString() @@ -1043,6 +1048,7 @@ module internal Runner = let points = formatter.ReadInt32() + // [] let rec sequencePoint pts = if pts > 0 then let p = formatter.ReadInt32() @@ -1054,6 +1060,7 @@ module internal Runner = let pv = t.[m].[p] pv.Count <- pv.Count + n + // [] let rec tracking () = let track = formatter.ReadByte() |> int @@ -1307,7 +1314,7 @@ module internal Runner = m.Branches.AddRange bps m.SeqPnts - |> Seq.groupBy (fun s -> s.SL) + |> Seq.groupBy _.SL |> Seq.iter (fun (l, ss) -> m.Lines.[l] <- Json.lineVisits ss) [] let writeNativeJsonReport (hits: Dictionary>) - _ + unusedCannotBeUnderscore (file: Stream) output = + ignore unusedCannotBeUnderscore let flushStart = DateTime.UtcNow // do work here let jsonText = @@ -1341,8 +1349,8 @@ module internal Runner = if b then kvp.Value.Values - |> Seq.collect (fun doc -> doc.Values) - |> Seq.collect (fun c -> c.Values) + |> Seq.collect _.Values + |> Seq.collect _.Values |> Seq.iter (updateNativeJsonMethod hits visits)) let encoded = diff --git a/AltCover.Engine/Tasks.fsi b/AltCover.Engine/Tasks.fsi index 22c483cf7..e0b80eb48 100644 --- a/AltCover.Engine/Tasks.fsi +++ b/AltCover.Engine/Tasks.fsi @@ -30,7 +30,7 @@ type Prepare = /// override Execute : unit -> bool /// - /// Corresponds to command line option ` -i, --inputDirectory=VALUE` + /// Corresponds to command line option `-i, --inputDirectory=VALUE` /// member InputDirectories : string array with get, set /// @@ -46,7 +46,7 @@ type Prepare = /// member Dependencies : string array with get, set /// - /// Corresponds to command line option ` -k, --key=VALUE` + /// Corresponds to command line option `-k, --key=VALUE` /// member Keys : string array with get, set /// @@ -74,7 +74,7 @@ type Prepare = /// member TypeFilter : string array with get, set /// - /// Corresponds to command line option ` -m, --methodFilter=VALUE` + /// Corresponds to command line option `-m, --methodFilter=VALUE` /// member MethodFilter : string array with get, set /// @@ -154,7 +154,7 @@ type Prepare = /// member LocalSource : bool with get, set /// - /// Corresponds to command line option ` -v, --visibleBranches` + /// Corresponds to command line option `-v, --visibleBranches` /// member VisibleBranches : bool with get, set /// @@ -162,15 +162,15 @@ type Prepare = /// member ShowStatic : string with get, set /// - /// Corresponds to command line option ` --showGenerated` + /// Corresponds to command line option `--showGenerated` /// member ShowGenerated : bool with get, set /// - /// Corresponds to command line options ` -q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) + /// Corresponds to command line options `-q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) /// member Verbosity : string with get, set /// - /// Corresponds to command line option ` --trivia` + /// Corresponds to command line option `--trivia` /// member Trivia: bool with get, set end @@ -240,7 +240,7 @@ type Collect = /// member SummaryFormat : string with get, set /// - /// Corresponds to command line options ` -q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) + /// Corresponds to command line options `-q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) /// member Verbosity : string with get, set end @@ -313,7 +313,7 @@ type Echo = [] member Text : string with get, set /// - /// Corresponds to command line option ` -q` (expects names of `System.Diagnostics.TraceLevel` values) + /// Corresponds to command line option `-q` (expects names of `System.Diagnostics.TraceLevel` values) /// member Verbosity : string with get, set end @@ -349,7 +349,7 @@ type RunSettings = /// member TestSetting : string with get, set /// - /// Corresponds to command line option ` -q` (expects names of `System.Diagnostics.TraceLevel` values) + /// Corresponds to command line option `-q` (expects names of `System.Diagnostics.TraceLevel` values) /// member Verbosity : string with get, set end diff --git a/AltCover.Engine/TypeSafe.fs b/AltCover.Engine/TypeSafe.fs index d21669d02..b7c7dc443 100644 --- a/AltCover.Engine/TypeSafe.fs +++ b/AltCover.Engine/TypeSafe.fs @@ -57,7 +57,7 @@ module TypeSafe = member self.AsStrings() = match self with | NoCommand -> Seq.empty - | CommandArguments c -> c |> Seq.map (fun a -> a.AsString()) + | CommandArguments c -> c |> Seq.map _.AsString() [] type Thresholds = @@ -114,7 +114,7 @@ module TypeSafe = member self.AsStrings() = match self with | NoPaths -> List.empty - | FilePaths c -> c |> Seq.map (fun a -> a.AsString()) |> Seq.toList + | FilePaths c -> c |> Seq.map _.AsString() |> Seq.toList [] type DirectoryPaths = @@ -123,7 +123,7 @@ module TypeSafe = member self.AsStrings() = match self with | NoDirectories -> List.empty - | DirectoryPaths c -> c |> Seq.map (fun a -> a.AsString()) |> Seq.toList + | DirectoryPaths c -> c |> Seq.map _.AsString() |> Seq.toList [] type FilterItem = @@ -152,7 +152,7 @@ module TypeSafe = member self.AsStrings() = match self with | Unfiltered -> List.empty - | Filters c -> c |> Seq.map (fun a -> a.AsString()) |> Seq.toList + | Filters c -> c |> Seq.map _.AsString() |> Seq.toList [] type ContextItem = @@ -176,7 +176,7 @@ module TypeSafe = member self.AsStrings() = match self with | NoContext -> List.empty - | Context c -> c |> Seq.map (fun a -> a.AsString()) |> Seq.toList + | Context c -> c |> Seq.map _.AsString() |> Seq.toList [] type SummaryFormat = @@ -211,7 +211,7 @@ module TypeSafe = | RPlus -> "ROC" | Many s -> let raw = - String.Join(String.Empty, s |> Seq.map (fun x -> x.AsString())) + String.Join(String.Empty, s |> Seq.map _.AsString()) |> Seq.distinct |> Seq.toArray diff --git a/AltCover.Engine/TypeSafe.fsi b/AltCover.Engine/TypeSafe.fsi index 0b85cc062..2bdb65bba 100644 --- a/AltCover.Engine/TypeSafe.fsi +++ b/AltCover.Engine/TypeSafe.fsi @@ -533,7 +533,7 @@ namespace AltCoverFake.DotNet.Testing type PrepareOptions = { /// - /// Corresponds to command line option ` -i, --inputDirectory=VALUE` + /// Corresponds to command line option `-i, --inputDirectory=VALUE` /// InputDirectories: DirectoryPaths /// @@ -549,7 +549,7 @@ namespace AltCoverFake.DotNet.Testing /// Dependencies: FilePaths /// - /// Corresponds to command line option ` -k, --key=VALUE` + /// Corresponds to command line option `-k, --key=VALUE` /// Keys: FilePaths /// @@ -577,7 +577,7 @@ namespace AltCoverFake.DotNet.Testing /// TypeFilter: Filters /// - /// Corresponds to command line option ` -m, --methodFilter=VALUE` + /// Corresponds to command line option `-m, --methodFilter=VALUE` /// MethodFilter: Filters /// @@ -657,7 +657,7 @@ namespace AltCoverFake.DotNet.Testing /// LocalSource: Flag /// - /// Corresponds to command line option ` -v, --visibleBranches` + /// Corresponds to command line option `-v, --visibleBranches` /// VisibleBranches: Flag /// @@ -665,7 +665,7 @@ namespace AltCoverFake.DotNet.Testing /// ShowStatic: StaticFormat /// - /// Corresponds to command line option ` --showGenerated` + /// Corresponds to command line option `--showGenerated` /// ShowGenerated: Flag /// @@ -673,7 +673,7 @@ namespace AltCoverFake.DotNet.Testing /// Verbosity : System.Diagnostics.TraceLevel /// - /// Corresponds to command line option ` --trivia` + /// Corresponds to command line option `--trivia` /// Trivia: Flag } diff --git a/AltCover.Engine/Visitor.fs b/AltCover.Engine/Visitor.fs index e28b563ce..d97abd474 100644 --- a/AltCover.Engine/Visitor.fs +++ b/AltCover.Engine/Visitor.fs @@ -526,7 +526,7 @@ module internal Inspector = (CoverageParameters.local.Value) && a.MainModule |> ProgramDatabase.getModuleDocuments - |> Seq.map (fun d -> d.Url) + |> Seq.map _.Url |> Seq.exists File.Exists |> not | _ -> false @@ -748,8 +748,7 @@ module internal Visitor = // actually all vestigial classes now the first line is commented out let internal stripInterfaces (t: TypeDefinition) = // t.BaseType.IsNotNull || - t.Methods - |> Seq.exists (fun m -> m.IsAbstract |> not) + t.Methods |> Seq.exists (_.IsAbstract >> not) [ Option.filter (fun _ -> CoverageParameters.sourcelink.Value) - |> Option.bind (fun x -> - x.CustomDebugInformations - |> Seq.tryFind (fun i -> i.Kind = CustomDebugInformationKind.SourceLink)) + |> Option.bind ( + _.CustomDebugInformations + >> Seq.tryFind (fun i -> i.Kind = CustomDebugInformationKind.SourceLink) + ) |> Option.map (fun i -> let c = (i :?> SourceLinkDebugInformation).Content @@ -847,7 +847,7 @@ module internal Visitor = if m.HasCustomAttributes && m.CustomAttributes - |> Seq.map (fun a -> a.AttributeType) + |> Seq.map _.AttributeType |> Seq.tryFind (fun a -> full == a.Name || full == a.FullName) |> Option.isSome then @@ -880,7 +880,7 @@ module internal Visitor = ct.DeclaringType // Hope we don't have to generalise this |> Option.ofObj |> Option.filter (fun _ -> ct.Name.StartsWith("<", StringComparison.Ordinal)) - |> Option.map (fun c -> c.Methods |> Seq.toList) + |> Option.map (_.Methods >> Seq.toList) |> Option.defaultValue [] )) |> Seq.filter (fun mx -> (mx.Name == stripped) && mx.HasBody) @@ -897,8 +897,8 @@ module internal Visitor = |> Option.map (fun c -> c.NestedTypes |> Seq.filter (fun t -> t.Name.IndexOf(tag, StringComparison.Ordinal) >= 0) - |> Seq.collect (fun t -> t.Methods) - |> Seq.filter (fun m -> m.HasBody)) + |> Seq.collect _.Methods + |> Seq.filter _.HasBody) |> Option.defaultValue ([] |> Seq.ofList) let peers = @@ -910,8 +910,8 @@ module internal Visitor = let children = ct.NestedTypes - |> Seq.filter (fun tx -> tx.Name.StartsWith("<", StringComparison.Ordinal)) - |> Seq.collect (fun tx -> tx.Methods) + |> Seq.filter _.Name.StartsWith("<", StringComparison.Ordinal) + |> Seq.collect _.Methods |> Seq.filter (fun mx -> mx.HasBody && (mx.Name.IndexOf(tag, StringComparison.Ordinal) @@ -924,7 +924,7 @@ module internal Visitor = .Concat(peers) .Concat(children) |> Seq.filter predicate - |> Seq.sortBy (fun mx -> mx.DeclaringType.FullName.Split('/').Length) // strive upwards + |> Seq.sortBy _.DeclaringType.FullName.Split('/').Length // strive upwards |> Seq.tryHead let internal sameType (target: TypeReference) (candidate: TypeReference) = @@ -979,9 +979,9 @@ module internal Visitor = t.DeclaringType.Methods.Concat( t.DeclaringType.NestedTypes |> Seq.filter (fun t2 -> (t2 :> TypeReference) <> tx) - |> Seq.collect (fun t2 -> t2.Methods) + |> Seq.collect _.Methods ) - |> Seq.filter (fun m -> m.HasBody) + |> Seq.filter _.HasBody candidates |> Seq.tryFind (fun c -> @@ -1070,7 +1070,7 @@ module internal Visitor = m.IsConstructor && m.HasParameters && (m.Parameters.Count = 1)) - |> Option.map (fun m -> m.Parameters |> Seq.head) + |> Option.map (_.Parameters >> Seq.head) with | None -> t :> TypeReference | Some other -> other.ParameterType @@ -1198,6 +1198,7 @@ module internal Visitor = let internal indexList l = l |> List.mapi (fun i x -> (i, x)) let internal getJumpChain (terminal: Instruction) (i: Instruction) = + // [] let rec accumulate (state: Instruction) l = let gendarme = l @@ -1232,7 +1233,7 @@ module internal Visitor = (f: (Instruction -> int) -> Instruction list -> Instruction) (places: Instruction list) = - places |> f (fun i -> i.Offset) + places |> f _.Offset let internal includedSequencePoint dbg (toNext: Instruction list) toJump = let places = List.concat [ toNext; toJump ] @@ -1255,6 +1256,7 @@ module internal Visitor = findEffectiveSequencePoint FakeAtReturn dbg range + [] let rec internal lastOfSequencePoint (dbg: MethodDebugInformation) (i: Instruction) = let n = i.Next @@ -1266,6 +1268,7 @@ module internal Visitor = else lastOfSequencePoint dbg n + [] let rec internal firstOfSequencePoint (dbg: MethodDebugInformation) (i: Instruction) = let p = i.Previous @@ -1304,7 +1307,9 @@ module internal Visitor = | _ -> [] let private coalesceBranchPoints dbg (bps: GoTo seq) = - let selectRepresentatives (_, bs) = + let selectRepresentatives (whatever, bs) = + ignore whatever + let last = lastOfSequencePoint dbg (bs |> Seq.head).Start @@ -1325,7 +1330,7 @@ module internal Visitor = || i.OpCode.FlowControl = FlowControl.Break || i.OpCode.FlowControl = FlowControl.Throw || i.OpCode.FlowControl = FlowControl.Branch) }) // more?? - |> Seq.groupBy (fun b -> b.Target |> Seq.tryHead) + |> Seq.groupBy (_.Target >> Seq.tryHead) |> Seq.map ( snd >> (fun bg -> @@ -1357,7 +1362,7 @@ module internal Visitor = let mutable uid = 0 bps - |> Seq.groupBy (fun b -> b.SequencePoint.Offset) + |> Seq.groupBy _.SequencePoint.Offset |> Seq.map selectRepresentatives // >> demoteSingletons) |> Seq.collect id |> Seq.map (fun bs -> @@ -1371,7 +1376,7 @@ module internal Visitor = { bx with Representative = Reporting.None })) |> Seq.collect id - |> Seq.sortBy (fun b -> b.Key) // important! instrumentation assumes we work in the order we started with + |> Seq.sortBy _.Key // important! instrumentation assumes we work in the order we started with let private extractBranchPoints dbg rawInstructions interesting vc = let makeDefault i = @@ -1481,7 +1486,7 @@ module internal Visitor = let nt = x :: (rest |> Seq.toList) - |> List.filter (fun v -> v.OpCode |> trivial.Contains |> not) + |> List.filter (_.OpCode >> trivial.Contains >> not) |> List.tryHead Option.isSome nt @@ -1600,6 +1605,7 @@ module internal Visitor = raise (InvalidOperationException(message, x)) + [] let rec internal deeper node = let visit n = // The pattern here is map x |> map y |> map x |> concat => collect (x >> y >> z) @@ -1641,6 +1647,7 @@ module internal Visitor = accumulator.Clear() let internal encloseState (visitor: 'TState -> 'T -> 'TState) (current: 'TState) = + // [] let rec stateful l = new Fix<'T>(fun (node: 'T) -> let next = visitor l node @@ -1660,30 +1667,30 @@ module internal Visitor = "AvoidMessageChainsRule", Scope = "member", Target = - "AltCover.Visitor/I/generated@1391::Invoke(Mono.Cecil.Cil.Instruction)", + "AltCover.Visitor/I/generated@1396::Invoke(Mono.Cecil.Cil.Instruction)", Justification = "No direct call available")>] [,Microsoft.FSharp.Collections.FSharpList`1)", + "AltCover.Visitor/I/start@1242::Invoke(Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Collections.FSharpList`1)", Justification = "Inlined library code")>] [,Microsoft.FSharp.Collections.FSharpList`1)", + "AltCover.Visitor/I/finish@1245::Invoke(Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Collections.FSharpList`1)", Justification = "Inlined library code")>] [] [] () \ No newline at end of file diff --git a/AltCover.Engine/WhatIfExtension.fs b/AltCover.Engine/WhatIfExtension.fs index 1f38dea1a..1e9f32c20 100644 --- a/AltCover.Engine/WhatIfExtension.fs +++ b/AltCover.Engine/WhatIfExtension.fs @@ -3,7 +3,6 @@ open System.Diagnostics.CodeAnalysis open System.Runtime.CompilerServices -[] module PrepareExtension = [] let WhatIf (prepare: Abstract.IPrepareOptions) : AltCover.ValidatedCommandLine = @@ -12,7 +11,6 @@ module PrepareExtension = (AltCover.PrepareOptions.Abstract prepare) .Validate() } -[] module CollectExtension = [] let WhatIf diff --git a/AltCover.Engine/WhatIfExtension.fsi b/AltCover.Engine/WhatIfExtension.fsi index 3677ed932..81918f5a3 100644 --- a/AltCover.Engine/WhatIfExtension.fsi +++ b/AltCover.Engine/WhatIfExtension.fsi @@ -10,7 +10,6 @@ open System.Runtime.CompilerServices /// no doc /// /// `Abstract.IPrepareOptions` extension methods /// -[] module PrepareExtension = begin /// /// Validates the supplied options @@ -23,7 +22,6 @@ end /// /// `Abstract.ICollectOptions` extension methods /// -[] module CollectExtension = begin /// /// Validates the supplied options diff --git a/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs b/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs index cc65bd3d3..72bfe99b7 100644 --- a/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs +++ b/AltCover.Fake.DotNet.Testing.AltCover/AltCoverCommand.fs @@ -169,12 +169,14 @@ module AltCoverCommand = let parameters = Fake.DotNet.DotNet.TestOptions.Create() |> options + let nullObject: Object = null + let args = - builder.Invoke(null, [| parameters |]) :?> string list + builder.Invoke(nullObject, [| parameters |]) :?> string list let cmdArgs = builder2.Invoke( - null, + nullObject, [| ("test" |> Args.fromWindowsCommandLine |> Seq.toList) @@ -324,19 +326,19 @@ module AltCoverCommand = "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = - "AltCoverFake.DotNet.Testing.AltCoverCommand+withMono@296T.#monoPath", + "AltCoverFake.DotNet.Testing.AltCoverCommand+withMono@298T.#monoPath", Justification = "Generated code")>] [] [] [ - + + diff --git a/AltCover.Monitor.Tests/MonitorTest.fs b/AltCover.Monitor.Tests/MonitorTest.fs index 3e050eb24..6997a9dd9 100644 --- a/AltCover.Monitor.Tests/MonitorTest.fs +++ b/AltCover.Monitor.Tests/MonitorTest.fs @@ -84,7 +84,7 @@ module MonitorTests = test' <@ - code > 115 + code > 112 && code < 261 && branch > 24 && branch < 38 diff --git a/AltCover.PowerShell/Accelerator.fs b/AltCover.PowerShell/Accelerator.fs index 760156bb9..b10a78210 100644 --- a/AltCover.PowerShell/Accelerator.fs +++ b/AltCover.PowerShell/Accelerator.fs @@ -108,9 +108,9 @@ type AddAcceleratorCommand() = let finalmap = self.TypeMap - |> Seq.distinctBy (fun kv -> kv.Key) - |> Seq.distinctBy (fun kv -> kv.Value) - |> Seq.sortBy (fun kv -> kv.Key) + |> Seq.distinctBy _.Key + |> Seq.distinctBy _.Value + |> Seq.sortBy _.Key |> Seq.toList let display = @@ -145,9 +145,11 @@ type AddAcceleratorCommand() = String.Empty) ) then + let nullObject: System.Object = null + finalmap |> Seq.iter (fun kv -> - adder.Invoke(null, [| kv.Key :> obj; kv.Value :> obj |]) + adder.Invoke(nullObject, [| kv.Key :> obj; kv.Value :> obj |]) |> ignore) /// @@ -183,8 +185,9 @@ type GetAcceleratorCommand() = acceleratorsType.GetProperty("Get") let result = Hashtable() + let nullObject: System.Object = null - (finder.GetValue(null, [||]) :?> Dictionary) + (finder.GetValue(nullObject, [||]) :?> Dictionary) |> Seq.iter (fun kv -> result.Add(kv.Key, kv.Value)) self.WriteObject result \ 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 8afaab159..2d1aac539 100644 --- a/AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj +++ b/AltCover.Recorder.Tests/AltCover.Recorder.Tests.fsproj @@ -8,6 +8,7 @@ NU1702 NU1702 + --keyfile:$(InfrastructureKey) @@ -49,7 +50,7 @@ - + diff --git a/AltCover.Recorder.Tests/Tracer.Tests.fs b/AltCover.Recorder.Tests/Tracer.Tests.fs index cfdea83ca..920a9c4e5 100644 --- a/AltCover.Recorder.Tests/Tracer.Tests.fs +++ b/AltCover.Recorder.Tests/Tracer.Tests.fs @@ -96,6 +96,7 @@ module AltCoverCoreTests = use formatter = // fsharplint:disable-next-line RedundantNewKeyword new System.IO.BinaryReader(stream) + // [] let rec sink () = maybeIOException (fun () -> let id = formatter.ReadString() @@ -115,6 +116,7 @@ module AltCoverCoreTests = let t = Dictionary>() + // [] let rec ``module`` () = let m = formatter.ReadString() @@ -124,6 +126,7 @@ module AltCoverCoreTests = t.Add(m, Dictionary()) let points = formatter.ReadInt32() + // [] let rec sequencePoint pts = if pts > 0 then let p = formatter.ReadInt32() @@ -131,6 +134,7 @@ module AltCoverCoreTests = let pv = Adapter.init (n, []) t.[m].Add(p, pv) + // [] let rec tracking () = let track = formatter.ReadByte() |> int diff --git a/AltCover.Recorder/AltCover.Recorder.fsproj b/AltCover.Recorder/AltCover.Recorder.fsproj index 3ce0903f5..4be986013 100644 --- a/AltCover.Recorder/AltCover.Recorder.fsproj +++ b/AltCover.Recorder/AltCover.Recorder.fsproj @@ -11,11 +11,12 @@ TRACE - $(OtherFlags) --standalone --staticlink:ICSharpCode.SharpZipLib + --keyfile:$(InfrastructureKey) --standalone --staticlink:ICSharpCode.SharpZipLib TRACE;DEBUG;CODE_ANALYSIS + --keyfile:$(InfrastructureKey) diff --git a/AltCover.Recorder/Base.fs b/AltCover.Recorder/Base.fs index b38bbf7c1..5aae9a346 100644 --- a/AltCover.Recorder/Base.fs +++ b/AltCover.Recorder/Base.fs @@ -228,9 +228,12 @@ module internal Counter = let startTimeNode = root.GetAttributeNode("startTime") + let nullObject: System.Object = null + if format = ReportFormat.NCover - && Object.ReferenceEquals(startTimeNode, null) |> not + && Object.ReferenceEquals(startTimeNode, nullObject) + |> not then let startTimeAttr = startTimeNode.Value diff --git a/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj b/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj index b5de7c2ad..f74448837 100644 --- a/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj +++ b/AltCover.Recorder2.Tests/AltCover.Recorder2.Tests.fsproj @@ -7,6 +7,7 @@ false NU1702 NU1702 + --keyfile:$(InfrastructureKey) @@ -36,7 +37,7 @@ runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/AltCover.Tests/AltCover.Tests.fsproj b/AltCover.Tests/AltCover.Tests.fsproj index f60dd606f..ce7b18b43 100644 --- a/AltCover.Tests/AltCover.Tests.fsproj +++ b/AltCover.Tests/AltCover.Tests.fsproj @@ -14,6 +14,7 @@ + Never @@ -135,7 +136,8 @@ ..\ThirdParty\Mono.Options.dll - + + contentfiles diff --git a/AltCover.Tests/Expecto.fs b/AltCover.Tests/Expecto.fs index f21f56f50..116c78fcf 100644 --- a/AltCover.Tests/Expecto.fs +++ b/AltCover.Tests/Expecto.fs @@ -576,6 +576,10 @@ module ExpectoTestManifest = "Tests2.ExcludedAfterMethodShouldNotChangeState" Tests.AltCoverTests2.IncludedAfterMethodShouldRewriteMethod, "Tests2.IncludedAfterMethodShouldRewriteMethod" + Tests.AltCoverTests2.NoStrongNameShouldUpdateVisibleTo, + "Tests2.NoStrongNameShouldUpdateVisibleTo" + Tests.AltCoverTests2.NewStrongNameShouldUpdateVisibleTo, + "Tests2.NewStrongNameShouldUpdateVisibleTo" Tests.AltCoverTests2.UpdateStrongReferencesShouldChangeSigningKeyWherePossible, "Tests2.UpdateStrongReferencesShouldChangeSigningKeyWherePossible" Tests.AltCoverTests2.UpdateStrongReferencesShouldChangeSigningKeyWherePossible2, diff --git a/AltCover.Tests/IVT.pub.snk b/AltCover.Tests/IVT.pub.snk new file mode 100644 index 000000000..3c8f2e1a0 Binary files /dev/null and b/AltCover.Tests/IVT.pub.snk differ diff --git a/AltCover.Tests/InternalsVisibleTest.snk b/AltCover.Tests/InternalsVisibleTest.snk new file mode 100644 index 000000000..76d5ed671 Binary files /dev/null and b/AltCover.Tests/InternalsVisibleTest.snk differ diff --git a/AltCover.Tests/Runner.Tests.fs b/AltCover.Tests/Runner.Tests.fs index ee13c22a8..91b6491c8 100644 --- a/AltCover.Tests/Runner.Tests.fs +++ b/AltCover.Tests/Runner.Tests.fs @@ -23,7 +23,7 @@ module AltCoverUsage = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("AltCover.Usage.txt", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("AltCover.Usage.txt", StringComparison.Ordinal) use stream = Assembly @@ -38,8 +38,7 @@ module AltCoverUsage = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("AltCover.Runner.Usage.txt", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("AltCover.Runner.Usage.txt", StringComparison.Ordinal) use stream = Assembly @@ -217,14 +216,13 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("SimpleCoverage.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("SimpleCoverage.xml", StringComparison.Ordinal) let resource2 = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) let internal init n l = let tmp = @@ -282,7 +280,7 @@ module AltCoverRunnerTests = Assert.That( after.SelectNodes("//SequencePoint") |> Seq.cast - |> Seq.map (fun x -> x.GetAttribute("vc")), + |> Seq.map _.GetAttribute("vc"), Is.EquivalentTo [ "11" "10" @@ -299,7 +297,7 @@ module AltCoverRunnerTests = Assert.That( after.SelectNodes("//BranchPoint") |> Seq.cast - |> Seq.map (fun x -> x.GetAttribute("vc")), + |> Seq.map _.GetAttribute("vc"), Is.EquivalentTo [ "2"; "2" ] ) @@ -384,7 +382,7 @@ module AltCoverRunnerTests = Assert.That( after.SelectNodes("//seqpnt") |> Seq.cast - |> Seq.map (fun x -> x.GetAttribute("visitcount")), + |> Seq.map _.GetAttribute("visitcount"), Is.EquivalentTo [ "11" "10" @@ -486,7 +484,7 @@ module AltCoverRunnerTests = Assert.That( after.SelectNodes("//seqpnt") |> Seq.cast - |> Seq.map (fun x -> x.GetAttribute("visitcount")), + |> Seq.map _.GetAttribute("visitcount"), Is.EquivalentTo [ "11" "10" @@ -514,7 +512,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("GenuineNCover158.Xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("GenuineNCover158.Xml", StringComparison.Ordinal) use stream = Assembly @@ -554,8 +552,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("GenuineNCover158.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("GenuineNCover158.json", StringComparison.Ordinal) use stream2 = Assembly @@ -604,8 +601,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample4FullTracking.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4FullTracking.xml", StringComparison.Ordinal) use stream = Assembly @@ -636,7 +632,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("OpenCover.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCover.json", StringComparison.Ordinal) use stream2 = Assembly @@ -719,7 +715,7 @@ module AltCoverRunnerTests = let program = files - |> Seq.filter (fun x -> x.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) + |> Seq.filter _.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) |> Seq.head CommandLine.toConsole () @@ -793,7 +789,7 @@ module AltCoverRunnerTests = let optionNames = options |> Seq.map (fun o -> - (o.GetNames() |> Seq.maxBy (fun n -> n.Length)) + (o.GetNames() |> Seq.maxBy _.Length) .ToLowerInvariant()) |> Seq.sort |> Seq.toList @@ -808,7 +804,7 @@ module AltCoverRunnerTests = let optionNames = options |> Seq.map (fun o -> - (o.GetNames() |> Seq.maxBy (fun n -> n.Length)) + (o.GetNames() |> Seq.maxBy _.Length) .ToLowerInvariant()) |> Seq.sort |> Seq.toList @@ -816,7 +812,7 @@ module AltCoverRunnerTests = let primitiveNames = typeof |> FSharpType.GetRecordFields - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -834,7 +830,7 @@ module AltCoverRunnerTests = let typesafeNames = typeof |> FSharpType.GetRecordFields - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -850,7 +846,7 @@ module AltCoverRunnerTests = let fsapiNames = typeof.GetProperties() - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -895,7 +891,7 @@ module AltCoverRunnerTests = ||| BindingFlags.Public ||| BindingFlags.Instance ) - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -914,7 +910,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("AltCover.targets", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("AltCover.targets", StringComparison.Ordinal) use stream = Assembly @@ -930,7 +926,7 @@ module AltCoverRunnerTests = let attributeNames = collect.Attributes() - |> Seq.map (fun p -> p.Name.LocalName.ToLowerInvariant()) + |> Seq.map _.Name.LocalName.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -949,7 +945,7 @@ module AltCoverRunnerTests = Assert.That( options |> Seq.filter (fun x -> x.Prototype <> "<>") - |> Seq.forall (fun x -> (String.IsNullOrWhiteSpace >> not) x.Description) + |> Seq.forall (_.Description >> String.IsNullOrWhiteSpace >> not) ) Assert.That( @@ -2362,8 +2358,8 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("AltCover.Recorder.net20.dll", StringComparison.Ordinal)) + |> Seq.find + _.EndsWith("AltCover.Recorder.net20.dll", StringComparison.Ordinal) use frombytes = Assembly @@ -2447,7 +2443,7 @@ module AltCoverRunnerTests = let program = files - |> Seq.filter (fun x -> x.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) + |> Seq.filter _.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) |> Seq.head CommandLine.toConsole () @@ -2546,7 +2542,7 @@ module AltCoverRunnerTests = .GetMethod("main", BindingFlags.NonPublic ||| BindingFlags.Static) let returnCode = - main.Invoke(null, [| [| "RuNN"; "-r"; unique |] |]) + main.Invoke(nullObject, [| [| "RuNN"; "-r"; unique |] |]) Assert.That(returnCode, Is.EqualTo 255) @@ -2613,8 +2609,8 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("AltCover.Recorder.net20.dll", StringComparison.Ordinal)) + |> Seq.find + _.EndsWith("AltCover.Recorder.net20.dll", StringComparison.Ordinal) use frombytes = Assembly @@ -2669,7 +2665,7 @@ module AltCoverRunnerTests = let program = files - |> Seq.filter (fun x -> x.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) + |> Seq.filter _.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) |> Seq.head CommandLine.toConsole () @@ -2830,7 +2826,7 @@ module AltCoverRunnerTests = Assert.That( after.SelectNodes("//seqpnt") |> Seq.cast - |> Seq.map (fun x -> x.GetAttribute("visitcount")), + |> Seq.map _.GetAttribute("visitcount"), Is.EquivalentTo [ "11" "10" @@ -2879,7 +2875,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample4.native.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4.native.json", StringComparison.Ordinal) use stream = Assembly @@ -2949,8 +2945,8 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample4.syntheticvisits.native.json", StringComparison.Ordinal)) + |> Seq.find + _.EndsWith("Sample4.syntheticvisits.native.json", StringComparison.Ordinal) use stream = Assembly @@ -3106,7 +3102,7 @@ module AltCoverRunnerTests = Assert.That( after.SelectNodes("//seqpnt") |> Seq.cast - |> Seq.map (fun x -> x.GetAttribute("visitcount")), + |> Seq.map _.GetAttribute("visitcount"), Is.EquivalentTo [ "11" "10" @@ -3158,7 +3154,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample4.native.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4.native.json", StringComparison.Ordinal) use stream = Assembly @@ -3237,8 +3233,8 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample4.syntheticvisits.native.json", StringComparison.Ordinal)) + |> Seq.find + _.EndsWith("Sample4.syntheticvisits.native.json", StringComparison.Ordinal) use stream = Assembly @@ -3462,7 +3458,7 @@ module AltCoverRunnerTests = Assert.That(r, Is.EqualTo 4) Assert.That(File.Exists(unique + ".acv")) - Assert.That(counts, Is.EquivalentTo []) + Assert.That(counts, Is.Empty) [] let TrackingPayloadShouldReportAsExpected () = @@ -3809,7 +3805,7 @@ module AltCoverRunnerTests = after.DocumentElement.SelectNodes("//SequencePoint") |> Seq.cast - |> Seq.iter (fun el -> el.SetAttribute("bev", "0")) + |> Seq.iter _.SetAttribute("bev", "0") let empty = Dictionary>() @@ -3831,8 +3827,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("HandRolledMonoCoverage.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("HandRolledMonoCoverage.xml", StringComparison.Ordinal) use stream = Assembly @@ -3862,12 +3857,12 @@ module AltCoverRunnerTests = after.DocumentElement.SelectNodes("//SequencePoint") |> Seq.cast - |> Seq.iter (fun el -> el.SetAttribute("bev", "0")) + |> Seq.iter _.SetAttribute("bev", "0") after.DocumentElement.SelectNodes("//MethodPoint") |> Seq.cast |> Seq.toList - |> List.iter (fun el -> el.RemoveAllAttributes()) + |> List.iter _.RemoveAllAttributes() let visits = Dictionary>() @@ -4012,7 +4007,7 @@ module AltCoverRunnerTests = after.DocumentElement.SelectNodes("//MethodPoint") |> Seq.cast - |> Seq.iter (fun el -> el.SetAttribute("vc", "0")) + |> Seq.iter _.SetAttribute("vc", "0") let before = after.OuterXml @@ -4066,8 +4061,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -4098,7 +4092,7 @@ module AltCoverRunnerTests = after.Descendants(XName.Get "SequencePoint") |> Seq.toList - |> List.iter (fun el -> el.Remove()) + |> List.iter _.Remove() after.Descendants(XName.Get "MethodPoint") |> Seq.iter (fun el -> setAttribute el "vc" "0") @@ -4208,7 +4202,6 @@ module AltCoverRunnerTests = finally resetInfo () - [] let EmptyNCoverGeneratesExpectedSummary () = let resetInfo () = Output.info <- ignore @@ -4327,7 +4320,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("SimpleCoverage.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("SimpleCoverage.xml", StringComparison.Ordinal) use stream = Assembly @@ -4512,8 +4505,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -4598,8 +4590,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -4829,7 +4820,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("SimpleCoverage.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("SimpleCoverage.json", StringComparison.Ordinal) use stream = Assembly @@ -4888,8 +4879,8 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample4.syntheticvisits.native.json", StringComparison.Ordinal)) + |> Seq.find + _.EndsWith("Sample4.syntheticvisits.native.json", StringComparison.Ordinal) use stream = Assembly @@ -4977,8 +4968,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -5017,7 +5007,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("OpenCover.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCover.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5049,8 +5039,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("OpenCoverWithPartials.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverWithPartials.xml", StringComparison.Ordinal) use stream = Assembly @@ -5090,8 +5079,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("OpenCoverWithPartials.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverWithPartials.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5123,7 +5111,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("SimpleCoverage.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("SimpleCoverage.xml", StringComparison.Ordinal) use stream = Assembly @@ -5157,7 +5145,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("NCover.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCover.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5189,8 +5177,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("NCoverWithPartials.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCoverWithPartials.xml", StringComparison.Ordinal) use stream = Assembly @@ -5225,8 +5212,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("NCoverWithPartials.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCoverWithPartials.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5258,7 +5244,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample5.ncover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.ncover.xml", StringComparison.Ordinal) use stream = Assembly @@ -5292,7 +5278,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample5.ncover.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.ncover.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5324,7 +5310,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample4.coverlet.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4.coverlet.json", StringComparison.Ordinal) use stream = Assembly @@ -5361,8 +5347,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample4.coverlet.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4.coverlet.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5394,7 +5379,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("JsonWithPartials.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("JsonWithPartials.json", StringComparison.Ordinal) use stream = Assembly @@ -5431,8 +5416,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("OpenCoverWithPartials.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverWithPartials.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5464,7 +5448,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample1WithNCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithNCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -5504,7 +5488,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("NCoverBugFix.lcov", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCoverBugFix.lcov", StringComparison.Ordinal) use stream2 = Assembly @@ -5546,7 +5530,7 @@ module AltCoverRunnerTests = |> List.map ( sprintf "" >> load - >> (fun x -> x.Descendants(XName.Get "x") |> Seq.head) + >> (_.Descendants(XName.Get "x") >> Seq.head) >> (fun m -> (m, m.Descendants(XName.Get "seqpnt"))) ) |> List.toSeq)) @@ -5647,7 +5631,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("NCover122.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCover122.xml", StringComparison.Ordinal) use stream = Assembly @@ -5694,7 +5678,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("NCover122.cobertura", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCover122.cobertura", StringComparison.Ordinal) use stream2 = Assembly @@ -5729,8 +5713,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("NCoverWithPartials.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCoverWithPartials.xml", StringComparison.Ordinal) use stream = Assembly @@ -5778,8 +5761,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("NCoverWithPartials.cob.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCoverWithPartials.cob.xml", StringComparison.Ordinal) use stream2 = Assembly @@ -5814,7 +5796,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample5.ncover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.ncover.xml", StringComparison.Ordinal) use stream = Assembly @@ -5862,8 +5844,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample5.ncover.cobertura", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.ncover.cobertura", StringComparison.Ordinal) use stream2 = Assembly @@ -5898,8 +5879,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample4FullTracking.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4FullTracking.json", StringComparison.Ordinal) use stream = Assembly @@ -5949,8 +5929,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample4FullTracking.cobertura", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4FullTracking.cobertura", StringComparison.Ordinal) use stream2 = Assembly @@ -5985,7 +5964,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("JsonWithPartials.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("JsonWithPartials.json", StringComparison.Ordinal) use stream = Assembly @@ -6035,8 +6014,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("OpenCoverWithPartials.cob.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverWithPartials.cob.xml", StringComparison.Ordinal) use stream2 = Assembly @@ -6083,7 +6061,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample5.native.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.native.json", StringComparison.Ordinal) use stream = Assembly @@ -6133,8 +6111,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample5.native.cobertura", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.native.cobertura", StringComparison.Ordinal) use stream2 = Assembly @@ -6169,7 +6146,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample5.native.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.native.json", StringComparison.Ordinal) use stream = Assembly @@ -6204,8 +6181,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample5.raw-native.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample5.raw-native.xml", StringComparison.Ordinal) use stream2 = Assembly @@ -6250,7 +6226,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("JsonWithPartials.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("JsonWithPartials.json", StringComparison.Ordinal) use stream = Assembly @@ -6286,8 +6262,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("JsonWithPartialsToRawXml.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("JsonWithPartialsToRawXml.xml", StringComparison.Ordinal) use stream2 = Assembly @@ -6321,7 +6296,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample1WithNCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithNCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -6369,8 +6344,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("NCoverBugFix.cobertura", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("NCoverBugFix.cobertura", StringComparison.Ordinal) use stream2 = Assembly @@ -6405,7 +6379,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("issue122.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("issue122.xml", StringComparison.Ordinal) use stream = Assembly @@ -6445,7 +6419,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("issue122.cobertura", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("issue122.cobertura", StringComparison.Ordinal) use stream2 = Assembly @@ -6487,8 +6461,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("OpenCoverWithPartials.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverWithPartials.xml", StringComparison.Ordinal) use stream = Assembly @@ -6529,8 +6502,7 @@ module AltCoverRunnerTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("OpenCoverWithPartials.cob.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("OpenCoverWithPartials.cob.xml", StringComparison.Ordinal) use stream2 = Assembly diff --git a/AltCover.Tests/TestCommon.fs b/AltCover.Tests/TestCommon.fs index 00ed8d588..0fd3f997f 100644 --- a/AltCover.Tests/TestCommon.fs +++ b/AltCover.Tests/TestCommon.fs @@ -174,10 +174,9 @@ Actual: False // printfn "%s" fallback // printfn "*********************************************" - Assert.That( - fallback, - Does.EndWith - """ actual = expected + let expected = +#if NET472 + """ actual = expected "yes" = "no" false Expected string length 2 but was 3. Strings differ at index 0. @@ -185,6 +184,28 @@ false But was: "yes" -----------^ """ +#else + """ actual = expected +"yes" = "no" +false""" + + "\n" + + """Assert.That(, ) + Expected string length 2 but was 3. Strings differ at index 0. + Expected: "no" + But was: "yes" + -----------^ +""" +#endif + + Assert.That( + fallback, + Does.EndWith expected + + //,"VV*********************************************" + Environment.NewLine + + //fallback.TrimEnd() + Environment.NewLine + + //"^^*********************************************" + Environment.NewLine + + //(sprintf "%A %A" fallback.Length expected.Length) + + //"^^*********************************************" + Environment.NewLine ) let m = @@ -211,12 +232,13 @@ Actual: False Assert.That( m2, - Is.EqualTo + Is.EqualTo( +#if NET472 """Multiple failures or warnings in test: 1) Expected: 4 But was: 3 - 2) + 2)@ 3 = exp1 3 = 4 @@ -227,13 +249,41 @@ false But was: "yes" -----------^ - 4) + 4)@ + +"yes" = exp2 +"yes" = "no" +false + +""" +#else + """Multiple failures or warnings in test: + 1) Assert.That(, ) + Expected: 4 + But was: 3 + + 2)@ + +3 = exp1 +3 = 4 +false + + 3) Assert.That(, ) + Expected string length 2 but was 3. Strings differ at index 0. + Expected: "no" + But was: "yes" + -----------^ + + 4)@ "yes" = exp2 "yes" = "no" false """ +#endif + .Replace("@", " ") + ) ) #if !NET472 @@ -251,18 +301,20 @@ module ExpectoTestCommon = let testMethods = def.MainModule.GetTypes() - |> Seq.collect (fun t -> t.Methods) - |> Seq.filter (fun m -> m.CustomAttributes.IsNotNull) - |> Seq.filter (fun m -> - m.CustomAttributes - |> Seq.exists (fun a -> a.AttributeType.Name = "TestAttribute")) + |> Seq.collect _.Methods + |> Seq.filter _.CustomAttributes.IsNotNull + |> Seq.filter ( + _.CustomAttributes + >> Seq.exists (fun a -> a.AttributeType.Name = "TestAttribute") + ) |> Seq.map (fun m -> m.DeclaringType.FullName + "::" + m.Name) let lookup = def.MainModule.GetAllTypes() - |> Seq.filter (fun t -> - t.Methods - |> Seq.exists (fun m -> m.Name = "Invoke")) + |> Seq.filter ( + _.Methods + >> Seq.exists (fun m -> m.Name = "Invoke") + ) |> Seq.map (fun t -> (t.FullName.Replace("/", "+"), t.Methods |> Seq.find (fun m -> m.Name = "Invoke"))) |> Map.ofSeq @@ -271,20 +323,19 @@ module ExpectoTestCommon = regular |> List.map ( fst - >> (fun f -> f.GetType().FullName.Replace("/", "+")) + >> _.GetType().FullName.Replace("/", "+") >> (fun f -> Map.find f lookup) - >> (fun f -> - f.Body.Instructions - // Where the test assembly is itself instrumented - // we have to allow for calls to AltCover.Recorder.Instance::Visit - // or the coverlet equivalent - // having been injected into the local function reference - - |> Seq.find (fun i -> - i.OpCode = OpCodes.Call - && i.Operand - .GetType() - .Name.Equals("MethodDefinition", StringComparison.Ordinal))) + >> (_.Body.Instructions + // Where the test assembly is itself instrumented + // we have to allow for calls to AltCover.Recorder.Instance::Visit + // or the coverlet equivalent + // having been injected into the local function reference + + >> Seq.find (fun i -> + i.OpCode = OpCodes.Call + && i.Operand + .GetType() + .Name.Equals("MethodDefinition", StringComparison.Ordinal))) >> (fun i -> let m = (i.Operand :?> MethodDefinition) m.DeclaringType.FullName + "::" + m.Name) diff --git a/AltCover.Tests/Tests.fs b/AltCover.Tests/Tests.fs index 4fe21c890..249f8e64d 100644 --- a/AltCover.Tests/Tests.fs +++ b/AltCover.Tests/Tests.fs @@ -100,13 +100,13 @@ module AltCoverTests = let recorderSnk = typeof.Assembly .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith(".Recorder.snk", StringComparison.Ordinal)) + |> Seq.find _.EndsWith(".Recorder.snk", StringComparison.Ordinal) let infrastructureSnk = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Infrastructure.snk", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Infrastructure.snk", StringComparison.Ordinal) let private ff (a, b, c) = { Scope = a; Regex = b; Sense = c } @@ -207,7 +207,7 @@ module AltCoverTests = let nativeName = here.GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("native.pdb", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("native.pdb", StringComparison.Ordinal) let native = here.GetManifestResourceStream(nativeName) @@ -723,8 +723,8 @@ module AltCoverTests = AssemblyResolver.ReadAssembly(Assembly.GetExecutingAssembly().Location) def.MainModule.Types - |> Seq.filter (fun t -> t.IsPublic) - |> Seq.collect (fun t -> t.Methods) + |> Seq.filter _.IsPublic + |> Seq.collect _.Methods |> Seq.iter (fun m -> Assert.That( Filter.``match`` m (ff (FilterScope.Type, Regex "23", Exclude)), @@ -738,8 +738,8 @@ module AltCoverTests = Assert.That( def.MainModule.Types - |> Seq.filter (fun t -> t.IsPublic) // exclude the many compiler generated chaff classes - |> Seq.collect (fun t -> t.Methods) + |> Seq.filter _.IsPublic // exclude the many compiler generated chaff classes + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.IsPublic && (not m.IsConstructor)) |> Seq.filter (fun m -> Filter.``match`` @@ -751,8 +751,8 @@ module AltCoverTests = Assert.That( def.MainModule.Types - |> Seq.filter (fun t -> t.IsPublic) // exclude the many compiler generated chaff classes - |> Seq.collect (fun t -> t.Methods) + |> Seq.filter _.IsPublic // exclude the many compiler generated chaff classes + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.IsPublic && (not m.IsConstructor)) |> Seq.filter (fun m -> Filter.``match`` @@ -821,7 +821,7 @@ module AltCoverTests = let pass = direct.Methods |> Seq.filter (fun x -> Filter.``match`` x filter |> not) - |> Seq.map (fun x -> x.Name) + |> Seq.map _.Name |> Seq.sort |> Seq.toList @@ -847,7 +847,7 @@ module AltCoverTests = |> Seq.filter (fun x -> x.Namespace = "Sample11" && Filter.``match`` x filter |> not) - |> Seq.map (fun x -> x.Name) + |> Seq.map _.Name |> Seq.sort |> Seq.toList @@ -864,7 +864,7 @@ module AltCoverTests = def.MainModule.Types |> Seq.filter (fun t -> t.Name = "Class1") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.IsGetter || m.IsSetter) |> Seq.iter (Filter.isCSharpAutoProperty >> Assert.That) @@ -878,7 +878,7 @@ module AltCoverTests = def.MainModule.Types |> Seq.filter (fun t -> t.Name = "Class2") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.IsGetter || m.IsSetter) |> Seq.iter (fun m -> Assert.That(Filter.isCSharpAutoProperty m, Is.False)) @@ -899,30 +899,30 @@ module AltCoverTests = let indirect = direct - |> Seq.filter (fun t -> t.HasNestedTypes) - |> Seq.collect (fun t -> t.NestedTypes) + |> Seq.filter _.HasNestedTypes + |> Seq.collect _.NestedTypes |> Seq.toList // MyUnion, MyThing let indirect2 = indirect - |> Seq.filter (fun t -> t.HasNestedTypes) - |> Seq.collect (fun t -> t.NestedTypes) + |> Seq.filter _.HasNestedTypes + |> Seq.collect _.NestedTypes |> Seq.toList // Foo, Bar, ... let indirect3 = indirect2 - |> Seq.filter (fun t -> t.HasNestedTypes) - // |> Seq.collect (fun t -> t.NestedTypes) - // |> Seq.map (fun t -> t.FullName) + |> Seq.filter _.HasNestedTypes + // |> Seq.collect _.NestedTypes + // |> Seq.map _.FullName |> Seq.toList Assert.That(indirect3 |> Seq.isEmpty, sprintf "Third order types found %A" indirect3) let pass = Seq.concat [ direct; indirect; indirect2 ] - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (not << Filter.isFSharpInternal) - |> Seq.map (fun x -> x.Name) + |> Seq.map _.Name |> Seq.sort |> Seq.toList @@ -960,7 +960,7 @@ module AltCoverTests = let pass = direct.Methods |> Seq.filter (not << Filter.isCSharpAutoProperty) - |> Seq.map (fun x -> x.Name) + |> Seq.map _.Name |> Seq.sort |> Seq.toList @@ -983,7 +983,7 @@ module AltCoverTests = let pass = direct.Methods |> Seq.filter (not << Filter.isCSharpAutoProperty) - |> Seq.map (fun x -> x.Name) + |> Seq.map _.Name |> Seq.sort |> Seq.toList @@ -1049,7 +1049,7 @@ module AltCoverTests = [ StaticFilter.AsCovered StaticFilter.Hidden StaticFilter.NoFilter ] - |> List.map (fun k -> Visitor.I.selectExemption k [] Exemption.None) + |> List.map (fun k -> Visitor.I.selectExemption k List.empty Exemption.None) test <@ @@ -1087,7 +1087,7 @@ module AltCoverTests = let items = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name = "testMakeUnion") |> Seq.toList @@ -1117,7 +1117,7 @@ module AltCoverTests = // beware conditionals like on NUnit.ConsoleRunner xml.Descendants() - |> Seq.filter (fun x -> x.Attribute("Include".X).IsNotNull) + |> Seq.filter _.Attribute("Include".X).IsNotNull |> Seq.map (fun x -> (x .Attribute(XName.Get("Include")) @@ -1271,7 +1271,7 @@ module AltCoverTests = let synch = types |> Seq.filter (fun t -> t.Name = "Async97") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name = "DoSomethingSynch") |> Seq.head @@ -1279,7 +1279,7 @@ module AltCoverTests = //|> Seq.iter (fun i -> // let sp = synch.DebugInformation.GetSequencePoint(i) // |> Option.ofObj - // |> Option.map (fun s -> s.StartLine) + // |> Option.map _.StartLine // printfn "%A %A" i sp) let method = @@ -1294,7 +1294,7 @@ module AltCoverTests = //|> Seq.iter (fun i -> // let sp = method.DebugInformation.GetSequencePoint(i) // |> Option.ofObj - // |> Option.map (fun s -> s.StartLine) + // |> Option.map _.StartLine // printfn "%A %A" i sp) Visitor.visit [] [] // cheat reset @@ -1372,7 +1372,7 @@ module AltCoverTests = let methods = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name = "MoveNext") |> Seq.toList @@ -1497,7 +1497,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("issue37.dl_", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("issue37.dl_", StringComparison.Ordinal) use stream = Assembly @@ -1508,7 +1508,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("issue37.pd_", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("issue37.pd_", StringComparison.Ordinal) use stream2 = Assembly @@ -1577,7 +1577,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("issue37.dl_", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("issue37.dl_", StringComparison.Ordinal) use stream = Assembly @@ -1588,7 +1588,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("issue37.pd_", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("issue37.pd_", StringComparison.Ordinal) use stream2 = Assembly @@ -1665,7 +1665,7 @@ module AltCoverTests = let methods = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.sortBy (fun m -> m.DeclaringType.FullName + "::" + m.Name) |> Seq.toList @@ -1866,7 +1866,7 @@ module AltCoverTests = let methods = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.toList let result = @@ -1936,7 +1936,7 @@ module AltCoverTests = let methods = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.toList let result = @@ -2014,9 +2014,9 @@ module AltCoverTests = let i = sourceAssembly.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.HasBody && m.Body.Instructions.Any()) - |> Seq.map (fun m -> m.Body.Instructions |> Seq.head) + |> Seq.map (_.Body.Instructions >> Seq.head) |> Seq.head let dummy = Cil.Document("dummy") @@ -2077,7 +2077,7 @@ module AltCoverTests = KeyStore.tokenOfKey <| provideKeyPair () let token' = - String.Join(String.Empty, token |> List.map (fun x -> x.ToString("x2"))) + String.Join(String.Empty, token |> List.map _.ToString("x2")) Assert.That(token', Is.EqualTo("c02b1a9f5b7cade8")) @@ -2245,7 +2245,7 @@ module AltCoverTests = let outputs = inputs - |> Seq.map (fun n -> n.After() |> Seq.toList) + |> Seq.map (_.After() >> Seq.toList) |> Seq.toList let expected = @@ -2281,7 +2281,7 @@ module AltCoverTests = def.MainModule.Types |> Seq.filter (fun t -> t.Name = "Class1") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.IsGetter || m.IsSetter) |> Seq.iter (fun m -> Assert.That(Visitor.I.significant m, Is.False)) @@ -2295,7 +2295,7 @@ module AltCoverTests = def.MainModule.Types |> Seq.filter (fun t -> t.Name = "Class2") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.IsGetter || m.IsSetter) |> Seq.iter (Visitor.I.significant >> Assert.That) @@ -2348,7 +2348,7 @@ module AltCoverTests = let method = (def.MainModule.Types - |> Seq.skipWhile (fun t -> t.Name.StartsWith("<")) + |> Seq.skipWhile _.Name.StartsWith("<") |> Seq.head) .Methods |> Seq.head @@ -2463,10 +2463,7 @@ module AltCoverTests = Interesting = true } -> Assert.That(uid, Is.EqualTo i, "point number")) - Assert.That( - branches |> List.map (fun b -> b.Path), - Is.EquivalentTo [ 0; 1; 0; 1; 2; 3; 0; 1 ] - ) + Assert.That(branches |> List.map _.Path, Is.EquivalentTo [ 0; 1; 0; 1; 2; 3; 0; 1 ]) finally CoverageParameters.coalesceBranches.Value <- false CoverageParameters.nameFilters.Clear() @@ -2549,7 +2546,7 @@ module AltCoverTests = let type' = (def.MainModule.Types - |> Seq.skipWhile (fun t -> t.Name.StartsWith("<")) + |> Seq.skipWhile _.Name.StartsWith("<") |> Seq.head) Visitor.visit [] [] // cheat reset @@ -2840,7 +2837,7 @@ module AltCoverTests = ) let unique = Guid.NewGuid().ToString() - let op _ = raise <| IOException(unique) + let op _ : Object = raise <| IOException(unique) let x = Assert.Throws(fun () -> @@ -2852,6 +2849,7 @@ module AltCoverTests = let TestFixPointInvoke () = let mutable called = 0 + // [] let rec stateful l = new Fix(fun node -> called <- called + 1 @@ -2867,6 +2865,7 @@ module AltCoverTests = let TestFixPointApply () = let mutable called = 0 + // [] let rec stateful l = new Fix(fun node -> called <- called + 1 @@ -2964,7 +2963,7 @@ module AltCoverTests = let tracks = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.choose (Visitor.I.track) |> Seq.toList @@ -2988,9 +2987,9 @@ module AltCoverTests = let tracks = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (Visitor.I.track >> Option.isSome) - |> Seq.map (fun m -> m.Name) + |> Seq.map _.Name |> Seq.toList Assert.That(tracks, Is.EquivalentTo [ "testMakeUnion"; "testMakeThing" ]) @@ -3022,7 +3021,7 @@ module AltCoverTests = let tracks = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.choose (Visitor.I.track) |> Seq.toList @@ -3061,7 +3060,7 @@ module AltCoverTests = let tracks = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.choose (Visitor.I.track) |> Seq.toList @@ -3245,7 +3244,7 @@ module AltCoverTests = let names = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.map Naming.I.methodName |> Seq.toList @@ -3300,7 +3299,7 @@ module AltCoverTests = let names = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.map Naming.fullMethodName |> Seq.toList @@ -3379,6 +3378,7 @@ module AltCoverTests = " + [] let rec private recursiveValidate result expected depth zero = let rcount = result |> Seq.length let ecount = expected |> Seq.length @@ -3601,7 +3601,7 @@ module AltCoverTests = let classes = methods - |> List.groupBy (fun x -> x.Attribute("class".X).Value) + |> List.groupBy _.Attribute("class".X).Value let documents = classes @@ -3610,7 +3610,7 @@ module AltCoverTests = ml |> Seq.map (fun m -> m.Descendants("seqpnt".X) - |> Seq.map (fun s -> s.Attribute("document".X).Value) + |> Seq.map _.Attribute("document".X).Value |> Seq.distinct |> Seq.toList)) @@ -3699,7 +3699,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Sample4.native.json", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample4.native.json", StringComparison.Ordinal) use stream = Assembly @@ -3985,7 +3985,7 @@ module AltCoverTests = (makeDocument document2) .Descendants(XName.Get "method") |> Seq.filter (fun mx -> mx.Attribute(XName.Get "excluded").Value = "true") - |> Seq.map (fun mx -> mx.Attribute(XName.Get "name").Value) + |> Seq.map _.Attribute(XName.Get "name").Value |> Seq.filter (fun n -> n <> "Main") |> Seq.sortBy (fun n -> BitConverter.ToInt32( @@ -4024,7 +4024,7 @@ module AltCoverTests = (makeDocument document3) .Descendants(XName.Get "method") |> Seq.filter (fun mx -> mx.Attribute(XName.Get "excluded").Value = "true") - |> Seq.map (fun mx -> mx.Attribute(XName.Get "name").Value) + |> Seq.map _.Attribute(XName.Get "name").Value |> Seq.filter (fun n -> n <> "Main") |> Seq.sortBy (fun n -> BitConverter.ToInt32( @@ -4060,7 +4060,7 @@ module AltCoverTests = (makeDocument document5) .Descendants(XName.Get "method") |> Seq.filter (fun mx -> mx.Attribute(XName.Get "excluded").Value = "true") - |> Seq.map (fun mx -> mx.Attribute(XName.Get "name").Value) + |> Seq.map _.Attribute(XName.Get "name").Value |> Seq.filter (fun n -> n <> "Main") |> Seq.sortBy (fun n -> BitConverter.ToInt32( @@ -4207,7 +4207,7 @@ module AltCoverTests = Sense = Exclude } |> CoverageParameters.topLevel.Add - let seqTrim (s: String seq) = s |> Seq.map (fun n -> n.Trim()) + let seqTrim (s: String seq) = s |> Seq.map _.Trim() let visitor9, document9 = Report.reportGenerator () @@ -4344,14 +4344,14 @@ module AltCoverTests = let url = map.Values - |> Seq.find (fun f -> f.EndsWith("*", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("*", StringComparison.Ordinal) let files = (makeDocument document) .Descendants(XName.Get "seqpnt") - |> Seq.map (fun s -> s.Attribute(XName.Get "document").Value) + |> Seq.map _.Attribute(XName.Get "document").Value |> Seq.distinct - |> Seq.filter (fun f -> f.StartsWith("https://", StringComparison.Ordinal)) + |> Seq.filter _.StartsWith("https://", StringComparison.Ordinal) |> Seq.sort |> Seq.toList @@ -4364,11 +4364,12 @@ module AltCoverTests = let untracked = (makeDocument document) .Descendants(XName.Get "seqpnt") - |> Seq.map (fun s -> s.Attribute(XName.Get "document").Value) + |> Seq.map _.Attribute(XName.Get "document").Value |> Seq.distinct - |> Seq.filter (fun f -> - f.StartsWith("https://", StringComparison.Ordinal) - |> not) + |> Seq.filter ( + _.StartsWith("https://", StringComparison.Ordinal) + >> not + ) |> Seq.map Path.GetFileName |> Seq.sort |> Seq.toList @@ -4631,7 +4632,7 @@ module AltCoverTests = let method = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.find (fun m -> m.Name = "as_bar") Visitor.visit [] [] // cheat reset @@ -4684,7 +4685,7 @@ module AltCoverTests = let method = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.find (fun m -> m.Name = "as_bar") let fin = @@ -4693,6 +4694,7 @@ module AltCoverTests = let list = Visitor.I.getJumpChain fin fin Assert.That(list, Is.EquivalentTo [ fin ]) + [] let rec private recursiveValidateOpenCover result expected' depth zero expectSkipped = let xn name = XName.Get(name) let rcount = result |> Seq.length @@ -4815,13 +4817,13 @@ module AltCoverTests = let url = map.Values - |> Seq.find (fun f -> f.EndsWith("*", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("*", StringComparison.Ordinal) let files = (makeDocument document) .Descendants(XName.Get "File") - |> Seq.map (fun s -> s.Attribute(XName.Get "fullPath").Value) - |> Seq.filter (fun f -> f.StartsWith("https://", StringComparison.Ordinal)) + |> Seq.map _.Attribute(XName.Get "fullPath").Value + |> Seq.filter _.StartsWith("https://", StringComparison.Ordinal) |> Seq.sort |> Seq.toList @@ -4834,10 +4836,11 @@ module AltCoverTests = let untracked = (makeDocument document) .Descendants(XName.Get "File") - |> Seq.map (fun s -> s.Attribute(XName.Get "fullPath").Value) - |> Seq.filter (fun f -> - f.StartsWith("https://", StringComparison.Ordinal) - |> not) + |> Seq.map _.Attribute(XName.Get "fullPath").Value + |> Seq.filter ( + _.StartsWith("https://", StringComparison.Ordinal) + >> not + ) |> Seq.map Path.GetFileName |> Seq.sort |> Seq.toList @@ -4875,8 +4878,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -5004,7 +5006,7 @@ module AltCoverTests = [ m.Descendants("SequencePoint".X) m.Descendants("Branch".X) ] |> Seq.concat - |> Seq.map (fun x -> x.Attribute("fileid".X).Value) + |> Seq.map _.Attribute("fileid".X).Value |> Seq.distinct |> Seq.toList))) @@ -5076,8 +5078,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -5098,7 +5099,7 @@ module AltCoverTests = baseline.Descendants(xn "BranchPoint") |> Seq.toList - |> Seq.iter (fun x -> x.Remove()) + |> Seq.iter _.Remove() let result = (makeDocument document).Elements() @@ -5137,8 +5138,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal) use stream = Assembly @@ -5153,7 +5153,7 @@ module AltCoverTests = baseline.Descendants(xn "SequencePoint") |> Seq.toList - |> Seq.iter (fun x -> x.Remove()) + |> Seq.iter _.Remove() let result = (makeDocument document).Elements() @@ -5170,7 +5170,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith(xml, StringComparison.Ordinal)) + |> Seq.find _.EndsWith(xml, StringComparison.Ordinal) use stream = Assembly @@ -5377,8 +5377,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1ClassExclusion.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1ClassExclusion.xml", StringComparison.Ordinal) use stream = Assembly @@ -5471,8 +5470,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1MethodExclusion.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1MethodExclusion.xml", StringComparison.Ordinal) use stream = Assembly @@ -5517,8 +5515,7 @@ module AltCoverTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("Sample1MethodExclusion.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Sample1MethodExclusion.xml", StringComparison.Ordinal) use stream = Assembly @@ -5528,13 +5525,13 @@ module AltCoverTests = let baseline = XDocument.Load(stream) baseline.Descendants(XName.Get "Method") - |> Seq.filter (fun x -> x.Attributes(XName.Get "skippedDueTo").Any()) + |> Seq.filter _.Attributes(XName.Get "skippedDueTo").Any() |> Seq.iter (fun x -> x.SetAttributeValue(XName.Get "skippedDueTo", "File") x.Descendants(XName.Get "Summary") |> Seq.toList - |> Seq.iter (fun x -> x.Remove())) + |> Seq.iter _.Remove()) //|> Seq.iter (fun s -> s.SetAttributeValue(XName.Get "maxCyclomaticComplexity", "2") // s.SetAttributeValue(XName.Get "minCyclomaticComplexity", "2"))) let result = @@ -5620,14 +5617,14 @@ module AltCoverTests = let classes = doc.Descendants(XName.Get "FullName") - |> Seq.map (fun x -> x.Value) + |> Seq.map _.Value |> Seq.filter (Seq.head >> Char.IsLetterOrDigit) |> Seq.sort |> Seq.toList let methods = doc.Descendants(XName.Get "Name") - |> Seq.map (fun x -> x.Value) + |> Seq.map _.Value |> Seq.sort |> Seq.toList @@ -5679,21 +5676,23 @@ module AltCoverTests = let classes = doc.Descendants(XName.Get "FullName") - |> Seq.filter (fun x -> - x.Parent.Attribute(XName.Get "skippedDueTo") - |> isNull) - |> Seq.map (fun x -> x.Value) + |> Seq.filter ( + _.Parent.Attribute(XName.Get "skippedDueTo") + >> isNull + ) + |> Seq.map _.Value |> Seq.filter (Seq.head >> Char.IsLetterOrDigit) |> Seq.sort - |> Seq.filter (fun x -> - x.EndsWith("Attribute", StringComparison.Ordinal) - |> not) + |> Seq.filter ( + _.EndsWith("Attribute", StringComparison.Ordinal) + >> not + ) |> Seq.toList let methods = doc.Descendants(XName.Get "Name") - |> Seq.map (fun x -> x.Value) - |> Seq.filter (fun x -> x.Contains("Attribute::.ctor") |> not) + |> Seq.map _.Value + |> Seq.filter (_.Contains("Attribute::.ctor") >> not) |> Seq.sort |> Seq.toList diff --git a/AltCover.Tests/Tests2.fs b/AltCover.Tests/Tests2.fs index b927665a7..651af8372 100644 --- a/AltCover.Tests/Tests2.fs +++ b/AltCover.Tests/Tests2.fs @@ -19,13 +19,19 @@ module AltCoverTests2 = let recorderSnk = typeof.Assembly .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith(".Recorder.snk", StringComparison.Ordinal)) + |> Seq.find _.EndsWith(".Recorder.snk", StringComparison.Ordinal) let infrastructureSnk = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("Infrastructure.snk", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("Infrastructure.snk", StringComparison.Ordinal) + + let ivtSnk = + Assembly + .GetExecutingAssembly() + .GetManifestResourceNames() + |> Seq.find _.EndsWith("InternalsVisibleTest.snk", StringComparison.Ordinal) let private provideKeyPair () = use stream = @@ -42,8 +48,7 @@ module AltCoverTests2 = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("AltCover.Recorder.net20.dll", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("AltCover.Recorder.net20.dll", StringComparison.Ordinal) Assembly .GetExecutingAssembly() @@ -142,7 +147,7 @@ module AltCoverTests2 = Assert.That(token1, Is.Not.EquivalentTo(token0)) let token' = - String.Join(String.Empty, token1 |> Seq.map (fun x -> x.ToString("x2"))) + String.Join(String.Empty, token1 |> Seq.map _.ToString("x2")) Assert.That(token', Is.EqualTo("4ebffcaabf10ce6a")) @@ -546,12 +551,12 @@ module AltCoverTests2 = String.Join( String.Empty, prepared.Name.PublicKeyToken - |> Seq.map (fun x -> x.ToString("x2")) + |> Seq.map _.ToString("x2") ) Assert.That(token', Is.EqualTo("4ebffcaabf10ce6a")) - Assert.True( + Assert.That( prepared.CustomAttributes |> Seq.exists (fun a -> a.AttributeType.FullName = "AltCover.Recorder.InstrumentationAttribute"), @@ -761,7 +766,7 @@ module AltCoverTests2 = String.Join( String.Empty, raw.Name.PublicKeyToken - |> Seq.map (fun x -> x.ToString("x2")) + |> Seq.map _.ToString("x2") ) Assert.That(token', Is.EqualTo("4ebffcaabf10ce6a"), "wrong token") @@ -853,8 +858,8 @@ module AltCoverTests2 = let def = ``module``.MainModule.GetTypes() - |> Seq.collect (fun t -> t.Methods) - |> Seq.find (fun m -> m.Name.Equals("MakeConst")) + |> Seq.collect _.Methods + |> Seq.find _.Name.Equals("MakeConst") use sink = File.Open(outputdll, FileMode.Create, FileAccess.ReadWrite) @@ -875,8 +880,8 @@ module AltCoverTests2 = let pathGetterDef = ``module``.MainModule.GetTypes() - |> Seq.collect (fun t -> t.Methods) - |> Seq.find (fun m -> m.Name.Equals("get_Defer")) + |> Seq.collect _.Methods + |> Seq.find _.Name.Equals("get_Defer") let body = pathGetterDef.Body let worker = body.GetILProcessor() @@ -896,7 +901,7 @@ module AltCoverTests2 = Assert.That( pathGetterDef.DebugInformation.Scope.Scopes - |> Seq.exists (fun subscope -> subscope.Start.IsEndOfMethod), + |> Seq.exists _.Start.IsEndOfMethod, Is.False, "subscope.Start.IsEndOfMethod" ) @@ -965,16 +970,16 @@ has been prefixed with Ldc_I4_1 (1 byte) let n = i.ToString().Replace("-", "_") s.Constants.Add - <| ConstantDebugInformation("I" + n, primitive, null) + <| ConstantDebugInformation("I" + n, primitive, nullObject) s.Constants.Add - <| ConstantDebugInformation("A" + n, np, null) + <| ConstantDebugInformation("A" + n, np, nullObject) rescope.Scopes.Add s) rescope.Scopes.Add rescope - Assert.True(InstructionOffset().IsEndOfMethod, "End should go to none") + Assert.That(InstructionOffset().IsEndOfMethod, "End should go to none") // prune 1 recursion and 2 at end => 3 Assert.That(rescope.Scopes |> Seq.length, Is.EqualTo(4 + 3)) @@ -1032,7 +1037,7 @@ has been prefixed with Ldc_I4_1 (1 byte) String.Join( String.Empty, raw.Name.PublicKeyToken - |> Seq.map (fun x -> x.ToString("x2")) + |> Seq.map _.ToString("x2") ) Assert.That(token', Is.EqualTo("4ebffcaabf10ce6a")) @@ -1117,7 +1122,7 @@ has been prefixed with Ldc_I4_1 (1 byte) String.Join( String.Empty, raw.Name.PublicKeyToken - |> Seq.map (fun x -> x.ToString("x2")) + |> Seq.map _.ToString("x2") ) Assert.That(token', Is.EqualTo("c02b1a9f5b7cade8"), "wrong token") @@ -1543,7 +1548,7 @@ has been prefixed with Ldc_I4_1 (1 byte) Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("TailCallSample.dl_", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("TailCallSample.dl_", StringComparison.Ordinal) use stream = Assembly @@ -1923,7 +1928,7 @@ has been prefixed with Ldc_I4_1 (1 byte) Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("SwitchSample.dl_", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("SwitchSample.dl_", StringComparison.Ordinal) use stream = Assembly @@ -1934,7 +1939,7 @@ has been prefixed with Ldc_I4_1 (1 byte) Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("SwitchSample.pd_", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("SwitchSample.pd_", StringComparison.Ordinal) use stream2 = Assembly @@ -1977,7 +1982,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let targets = switch.Operand :?> Instruction array - |> Array.map (fun i -> i.Offset) + |> Array.map _.Offset Assert.That(targets, Is.EquivalentTo [ 31; 33; 31; 33; 31 ]) @@ -2006,7 +2011,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let targets2 = switch2.Operand :?> Instruction array - |> Array.map (fun i -> i.Offset) + |> Array.map _.Offset let next = switch2.Next.Offset let n2 = next + 2 @@ -2086,7 +2091,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let method = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.find (fun m -> m.Name = "as_bar") Visitor.visit [] [] // cheat reset @@ -2182,7 +2187,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let method = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.find (fun m -> m.Name = "Bar") Visitor.visit [] [] // cheat reset @@ -2271,7 +2276,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let method = def.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.find (fun m -> m.Name = "Main") Visitor.visit [] [] // cheat reset @@ -2433,7 +2438,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let opcodes = func.Body.Instructions - |> Seq.map (fun i -> i.OpCode) + |> Seq.map _.OpCode |> Seq.toList let input = @@ -2493,7 +2498,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let opcodes = func.Body.Instructions - |> Seq.map (fun i -> i.OpCode) + |> Seq.map _.OpCode |> Seq.toList let input = @@ -2524,6 +2529,75 @@ has been prefixed with Ldc_I4_1 (1 byte) Assert.That(paired' |> Seq.forall (fun (i, j) -> i = j.OpCode)) + [] + let NoStrongNameShouldUpdateVisibleTo () = + let path = + Path.Combine(AltCoverTests.dir, "Sample2.dll") + + use def = AssemblyResolver.ReadAssembly path + ProgramDatabase.readSymbols def + + CoverageParameters.defaultStrongNameKey <- None + + let result = + Instrument.I.updateVisibleTo def + + let va = + result.CustomAttributes + |> Seq.filter (fun a -> + a.AttributeType.FullName.Equals( + "System.Runtime.CompilerServices.InternalsVisibleToAttribute" + )) + |> Seq.toList + |> List.map (_.ConstructorArguments >> Seq.head) + |> List.map (_.Value >> string) + + let expected = + [ "AltCover.Tests.Visualizer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100916443A2EE1D294E8CFA7666FB3F512D998D7CEAC4909E35EDB2AC1E104DE68890A93716D1D1931F7228AAC0523CACF50FD82CDB4CCF4FF4BF0DED95E3A383F4F371E3B82C45502CE74D7D572583495208C1905E0F1E8A3CCE66C4C75E4CA32E9A8F8DEE64E059C0DC0266E8D2CB6D7EBD464B47E062F80B63D390E389217FB7" + "AltCover.Tests.Visualizer" ] + + test <@ va = expected @> + + [] + let NewStrongNameShouldUpdateVisibleTo () = + let path = + Path.Combine(AltCoverTests.dir, "Sample2.dll") + + use def = AssemblyResolver.ReadAssembly path + + ProgramDatabase.readSymbols def + let token0 = def.Name.PublicKeyToken + + use stream = + Assembly + .GetExecutingAssembly() + .GetManifestResourceStream(ivtSnk) + + use buffer = new MemoryStream() + stream.CopyTo(buffer) + + CoverageParameters.defaultStrongNameKey <- + Some(StrongNameKeyData.Make(buffer.ToArray())) + + let result = + Instrument.I.updateVisibleTo def + + let va = + result.CustomAttributes + |> Seq.filter (fun a -> + a.AttributeType.FullName.Equals( + "System.Runtime.CompilerServices.InternalsVisibleToAttribute" + )) + |> Seq.toList + |> List.map (_.ConstructorArguments >> Seq.head) + |> List.map (_.Value >> string) + + let expected = + [ "AltCover.Tests.Visualizer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100916443A2EE1D294E8CFA7666FB3F512D998D7CEAC4909E35EDB2AC1E104DE68890A93716D1D1931F7228AAC0523CACF50FD82CDB4CCF4FF4BF0DED95E3A383F4F371E3B82C45502CE74D7D572583495208C1905E0F1E8A3CCE66C4C75E4CA32E9A8F8DEE64E059C0DC0266E8D2CB6D7EBD464B47E062F80B63D390E389217FB7" + "AltCover.Tests.Visualizer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100F9A856F46C312969423375AB83A0509FA025FB6EC6C8CC5655AD7EEBADCF63011850CE7367C183B914C95CF7801FE7CB7DC836DBF661FC841CDB5401DFFD3DF995B2204A2CB7E3665DB1381BD966B1D15447424030640829C653DE4E47C54D79BDFA5620864CE46846B87A6901887F6CB5474BCEA43DDC12EA90DFC5DEC9DBAB" ] + + test <@ va = expected @> + [] let UpdateStrongReferencesShouldChangeSigningKeyWherePossible () = let path = @@ -2552,7 +2626,7 @@ has been prefixed with Ldc_I4_1 (1 byte) Assert.That(token1, Is.Not.EquivalentTo(token0)) let token' = - String.Join(String.Empty, token1 |> Seq.map (fun x -> x.ToString("x2"))) + String.Join(String.Empty, token1 |> Seq.map _.ToString("x2")) Assert.That(token', Is.EqualTo "4ebffcaabf10ce6a") Assert.That(result, Is.Empty) @@ -2604,7 +2678,7 @@ has been prefixed with Ldc_I4_1 (1 byte) Assert.That(token1, Is.Not.EquivalentTo(token0)) let token' = - String.Join(String.Empty, token1 |> Seq.map (fun x -> x.ToString("x2"))) + String.Join(String.Empty, token1 |> Seq.map _.ToString("x2")) Assert.That(token', Is.EqualTo "4ebffcaabf10ce6a") Assert.That(result, Is.Empty) @@ -2965,12 +3039,12 @@ has been prefixed with Ldc_I4_1 (1 byte) let visit = def'.MainModule.GetAllTypes() |> Seq.filter (fun t -> t.FullName = "AltCover.Recorder.Instance") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name = "Visit" || m.Name = "Push" || m.Name = "Pop") - |> Seq.sortBy (fun m -> m.Name) + |> Seq.sortBy _.Name |> Seq.toList |> List.rev @@ -3122,7 +3196,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let visit = def'.MainModule.GetAllTypes() - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name = "Visit") |> Seq.head @@ -3394,7 +3468,7 @@ has been prefixed with Ldc_I4_1 (1 byte) let md = prepared.MainModule.Types |> Seq.filter (fun t -> t.FullName = "AltCover.Sample3.Class3") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name = "Log") |> Seq.head @@ -3641,7 +3715,7 @@ has been prefixed with Ldc_I4_1 (1 byte) |> Seq.filter (fun t -> (string t = "AltCover.Output") || (string t = "AltCover.AltCover")) - |> Seq.collect (fun t -> t.GetNestedTypes(BindingFlags.NonPublic)) + |> Seq.collect _.GetNestedTypes(BindingFlags.NonPublic) |> Seq.filter (fun t -> let tokens = [ "info" @@ -3760,8 +3834,7 @@ has been prefixed with Ldc_I4_1 (1 byte) Assert.That(CommandLine.error, Is.EquivalentTo [ unique ]) Assert.That( - CommandLine.exceptions - |> List.map (fun e -> e.Message), + CommandLine.exceptions |> List.map _.Message, Is.EquivalentTo [ unique ] ) @@ -3881,8 +3954,7 @@ has been prefixed with Ldc_I4_1 (1 byte) Assert.That(CommandLine.error, Is.EquivalentTo [ unique ]) Assert.That( - CommandLine.exceptions - |> List.map (fun e -> e.Message), + CommandLine.exceptions |> List.map _.Message, Is.EquivalentTo [ unique ] ) diff --git a/AltCover.Tests/Tests3.fs b/AltCover.Tests/Tests3.fs index d0da92138..8c38ca0e5 100644 --- a/AltCover.Tests/Tests3.fs +++ b/AltCover.Tests/Tests3.fs @@ -27,7 +27,7 @@ module AltCoverTests3 = let program = files - |> Seq.filter (fun x -> x.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) + |> Seq.filter _.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) |> Seq.head let saved = (Console.Out, Console.Error) @@ -101,7 +101,7 @@ module AltCoverTests3 = let optionNames = options |> Seq.map (fun o -> - (o.GetNames() |> Seq.maxBy (fun n -> n.Length)) + (o.GetNames() |> Seq.maxBy _.Length) .ToLowerInvariant()) |> Seq.sort |> Seq.toList @@ -116,7 +116,7 @@ module AltCoverTests3 = let optionNames = options |> Seq.map (fun o -> - (o.GetNames() |> Seq.maxBy (fun n -> n.Length)) + (o.GetNames() |> Seq.maxBy _.Length) .ToLowerInvariant()) |> Seq.sort |> Seq.toList @@ -124,7 +124,7 @@ module AltCoverTests3 = let primitiveNames = typeof |> FSharpType.GetRecordFields - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -142,7 +142,7 @@ module AltCoverTests3 = let typesafeNames = typeof |> FSharpType.GetRecordFields - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -158,7 +158,7 @@ module AltCoverTests3 = let fsapiNames = typeof.GetProperties() - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -179,7 +179,7 @@ module AltCoverTests3 = Args.flagItems >> (List.map fst) Args.countItems >> (List.map fst) ] |> List.collect (fun f -> f args) - |> List.map (fun k -> k.Trim('-')) + |> List.map _.Trim('-') |> List.sort Assert.That( @@ -210,7 +210,7 @@ module AltCoverTests3 = ||| BindingFlags.Public ||| BindingFlags.Instance ) - |> Seq.map (fun p -> p.Name.ToLowerInvariant()) + |> Seq.map _.Name.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -228,7 +228,7 @@ module AltCoverTests3 = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> n.EndsWith("AltCover.targets", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("AltCover.targets", StringComparison.Ordinal) use stream = Assembly @@ -244,7 +244,7 @@ module AltCoverTests3 = let attributeNames = prepare.Attributes() - |> Seq.map (fun p -> p.Name.LocalName.ToLowerInvariant()) + |> Seq.map _.Name.LocalName.ToLowerInvariant() |> Seq.sort |> Seq.toList @@ -264,7 +264,7 @@ module AltCoverTests3 = Assert.That( options |> Seq.filter (fun x -> x.Prototype <> "<>") - |> Seq.forall (fun x -> (String.IsNullOrWhiteSpace >> not) x.Description), + |> Seq.forall (_.Description >> String.IsNullOrWhiteSpace >> not), "empty description for one or more items" ) @@ -1067,17 +1067,19 @@ module AltCoverTests3 = let pcom a b = Path.Combine(b, a) |> canonicalDirectory + let AssertAreEqual (a: obj, b: obj) = Assert.That(a, Is.EqualTo b) + match parse with | Right _ -> CoverageParameters.inputDirectories () |> Seq.toList |> List.zip ([ "."; ".." ] |> List.map canonicalDirectory) - |> List.iter Assert.AreEqual + |> List.iter AssertAreEqual CoverageParameters.outputDirectories () |> Seq.toList |> List.zip ([ "."; ".." ] |> List.map (pcom "__Instrumented")) - |> List.iter Assert.AreEqual + |> List.iter AssertAreEqual CoverageParameters.inplace.Value <- true CoverageParameters.theOutputDirectories.Add "maybe" @@ -1087,7 +1089,7 @@ module AltCoverTests3 = |> List.zip [ canonicalDirectory "maybe" ".." |> (pcom "__Saved") ] - |> List.iter Assert.AreEqual + |> List.iter AssertAreEqual finally CoverageParameters.theOutputDirectories.Clear() @@ -1532,7 +1534,7 @@ module AltCoverTests3 = let token = x |> KeyStore.tokenOfKey - |> List.map (fun x -> x.ToString("x2")) + |> List.map _.ToString("x2") Assert.That(String.Join(String.Empty, token), Is.EqualTo("c02b1a9f5b7cade8")) finally @@ -1677,7 +1679,7 @@ module AltCoverTests3 = String.Join( String.Empty, BitConverter.GetBytes(x) - |> Seq.map (fun x -> x.ToString("x2")) + |> Seq.map _.ToString("x2") )) |> Seq.sort @@ -3300,7 +3302,7 @@ module AltCoverTests3 = let result = Main.I.screenAssembly (Path.GetFileName f) def - Assert.True(result |> Option.isSome, f)) + Assert.That(result |> Option.isSome, f)) Assert.That(sb.ToString(), Is.Empty) @@ -3334,14 +3336,14 @@ module AltCoverTests3 = let s1 = Main.I.screenAssembly "Sample3.dll" prepared - Assert.True(s1 |> Option.isNone, "Sample3.dll") + Assert.That(s1 |> Option.isNone, "Sample3.dll") Environment.NewLine |> sb.Append |> ignore let s1 = Main.I.screenAssembly "Sample4.dll" assembly - Assert.True(s1 |> Option.isNone, "Sample4.dll") + Assert.That(s1 |> Option.isNone, "Sample4.dll") let expected = "Skipping Sample3.dll as it has already been instrumented." @@ -3388,10 +3390,10 @@ module AltCoverTests3 = Assert.That( t.EnumerateFiles("*", SearchOption.AllDirectories) - |> Seq.map (fun x -> x.FullName.Substring(tlen)), + |> Seq.map _.FullName.Substring(tlen), Is.EquivalentTo( f.EnumerateFiles("*", SearchOption.AllDirectories) - |> Seq.map (fun x -> x.FullName.Substring(flen)) + |> Seq.map _.FullName.Substring(flen) ), "Simple to-from comparison failed" ) @@ -3415,10 +3417,7 @@ module AltCoverTests3 = y, Is.EquivalentTo( x - |> Seq.map ( - (fun x -> x.AssemblyPath) - >> Path.GetFileNameWithoutExtension - ) + |> Seq.map (_.AssemblyPath >> Path.GetFileNameWithoutExtension) ), "Prepared lists mismatch" ) @@ -3427,13 +3426,13 @@ module AltCoverTests3 = let assemblyPaths = x - |> Seq.map (fun x -> x.AssemblyPath) + |> Seq.map _.AssemblyPath |> Seq.sort |> Seq.toList let assemblies = f.EnumerateFiles() - |> Seq.map (fun x -> x.FullName) + |> Seq.map _.FullName |> Seq.filter (fun f -> f.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)) @@ -3461,7 +3460,7 @@ module AltCoverTests3 = let program = files - |> Seq.filter (fun x -> x.EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) + |> Seq.filter _.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) |> Seq.head let saved = (Console.Out, Console.Error) @@ -3685,7 +3684,7 @@ module AltCoverTests3 = .GetMethod("main", BindingFlags.NonPublic ||| BindingFlags.Static) let returnCode = - main.Invoke(null, [| [| "TargetsPath" |] |]) + main.Invoke(nullObject, [| [| "TargetsPath" |] |]) Assert.That(returnCode, Is.EqualTo 0) test <@ stderr.ToString() |> String.IsNullOrEmpty @> @@ -3731,7 +3730,7 @@ module AltCoverTests3 = .GetMethod("main", BindingFlags.NonPublic ||| BindingFlags.Static) let returnCode = - main.Invoke(null, [| [| "-i"; unique |] |]) + main.Invoke(nullObject, [| [| "-i"; unique |] |]) Assert.That(returnCode, Is.EqualTo 255) @@ -3811,13 +3810,13 @@ module AltCoverTests3 = let mainHelp = Main.I.declareOptions () - |> Seq.map (fun o -> o.Prototype) + |> Seq.map _.Prototype |> Seq.filter (fun s -> s.Length <> 2) |> Seq.map fixup let runnerHelp = Runner.declareOptions () - |> Seq.map (fun o -> o.Prototype) + |> Seq.map _.Prototype |> Seq.filter (fun s -> s.Length <> 2) |> Seq.map fixup diff --git a/AltCover.Tests/XTests.fs b/AltCover.Tests/XTests.fs index 46a7709e0..ba797805f 100644 --- a/AltCover.Tests/XTests.fs +++ b/AltCover.Tests/XTests.fs @@ -42,6 +42,7 @@ module AltCoverXTests = " + [] let rec RecursiveValidate result expected depth zero = let rcount = result |> Seq.length let ecount = expected |> Seq.length @@ -85,6 +86,7 @@ module AltCoverXTests = RecursiveValidate (r.Elements()) (e.Elements()) (depth + 1) zero) + [] let rec RecursiveValidateOpenCover result expected' depth zero expectSkipped = let xn name = XName.Get(name) let rcount = result |> Seq.length @@ -290,7 +292,7 @@ module AltCoverXTests = "BOCR" ] inputs - |> List.map (fun i -> i.AsString()) + |> List.map _.AsString() |> List.zip expected |> List.iter (fun (a, b) -> test <@ a = b @>) @@ -676,7 +678,7 @@ module AltCoverXTests = TypeSafe.StaticFormat.ShowZero ] let expected = [ "-"; "+"; "++" ] - test <@ inputs |> List.map (fun i -> i.AsString()) = expected @> + test <@ inputs |> List.map _.AsString() = expected @> [] let PrepareOptionsCanBeValidatedWithErrors () = @@ -883,14 +885,13 @@ module AltCoverXTests = "xunit.execution.dotnet.dll" "xunit.runner.reporters.netcoreapp10.dll" "xunit.runner.utility.netcoreapp10.dll" - "xunit.runner.visualstudio.dotnetcore.testadapter.dll" ] + "xunit.runner.visualstudio.testadapter.dll" ] let isWindows = System.Environment.GetEnvironmentVariable("OS") = "Windows_NT" let theFiles = - expected - |> List.sortBy (fun f -> f.ToUpperInvariant()) + expected |> List.sortBy _.ToUpperInvariant() let actualFiles = Directory.GetFiles(output) @@ -903,7 +904,7 @@ module AltCoverXTests = (Path.GetFileNameWithoutExtension f) .StartsWith("Microsoft.", StringComparison.Ordinal) |> not) - |> Seq.sortBy (fun f -> f.ToUpperInvariant()) + |> Seq.sortBy _.ToUpperInvariant() |> Seq.toList test <@ String.Join("; ", actualFiles) = String.Join("; ", theFiles) @> @@ -965,14 +966,14 @@ module AltCoverXTests = match existingDependencies with | Some p -> (p.Value :?> JObject).Properties() - |> Seq.map (fun p -> p.Name) + |> Seq.map _.Name |> Set.ofSeq test <@ reset |> Set.contains "AltCover.Recorder.g" @> let aux = targeted.Properties() - |> Seq.map (fun p -> p.Name) + |> Seq.map _.Name |> Set.ofSeq test @@ -992,7 +993,7 @@ module AltCoverXTests = let lib = libraries.Properties() - |> Seq.map (fun p -> p.Name) + |> Seq.map _.Name |> Set.ofSeq test @@ -1138,14 +1139,13 @@ module AltCoverXTests = Directory.GetFiles(output) |> Seq.map Path.GetFileName |> Seq.toList - |> List.sortBy (fun f -> f.ToUpperInvariant()) + |> List.sortBy _.ToUpperInvariant() let isWindows = System.Environment.GetEnvironmentVariable("OS") = "Windows_NT" let expected = - theFiles - |> List.sortBy (fun f -> f.ToUpperInvariant()) + theFiles |> List.sortBy _.ToUpperInvariant() test <@ actual = expected @> @@ -1352,7 +1352,7 @@ module AltCoverXTests = let md = def.MainModule.Types |> Seq.filter (fun t -> t.FullName = "Tests.M") - |> Seq.collect (fun t -> t.Methods) + |> Seq.collect _.Methods |> Seq.filter (fun m -> m.Name = "makeThing") |> Seq.head @@ -1418,7 +1418,7 @@ module AltCoverXTests = let p = t2.GetProperty("value", BindingFlags.NonPublic ||| BindingFlags.Static) - let v = p.GetValue(null) + let v = p.GetValue(nullObject) test <@ v.IsNotNull @> test <@ v.GetType() = typeof>> @> @@ -1426,7 +1426,7 @@ module AltCoverXTests = let m = t2.GetMethod("instance", BindingFlags.NonPublic ||| BindingFlags.Static) - let v2 = m.Invoke(null, [||]) + let v2 = m.Invoke(nullObject, [||]) test <@ v2.IsNotNull @> test <@ v2.GetType() = typeof> @> @@ -1597,8 +1597,7 @@ module AltCoverXTests = Assembly .GetExecutingAssembly() .GetManifestResourceNames() - |> Seq.find (fun n -> - n.EndsWith("HandRolledMonoCoverage.xml", StringComparison.Ordinal)) + |> Seq.find _.EndsWith("HandRolledMonoCoverage.xml", StringComparison.Ordinal) use stream = Assembly diff --git a/AltCover.Toolkit/CoverageFormats.fs b/AltCover.Toolkit/CoverageFormats.fs index 7c965486f..543ea1e61 100644 --- a/AltCover.Toolkit/CoverageFormats.fs +++ b/AltCover.Toolkit/CoverageFormats.fs @@ -104,7 +104,7 @@ module CoverageFormats = |> Seq.iter (fun target -> let path = target.Descendants(XName.Get "ModulePath") - |> Seq.map (fun n -> n.Value) + |> Seq.map _.Value |> Seq.head |> Path.GetFullPath diff --git a/AltCover.Toolkit/OpenCover.fs b/AltCover.Toolkit/OpenCover.fs index 90bfa4801..a8c5c1626 100644 --- a/AltCover.Toolkit/OpenCover.fs +++ b/AltCover.Toolkit/OpenCover.fs @@ -43,10 +43,11 @@ module OpenCover = let interleave = List.concat [ sp; bp; [ tail ] ] - |> List.sortBy (fun x -> - x.Attribute(XName.Get "offset").Value - |> Int32.TryParse - |> snd) + |> List.sortBy ( + _.Attribute(XName.Get "offset").Value + >> Int32.TryParse + >> snd + ) interleave |> Seq.fold @@ -67,7 +68,7 @@ module OpenCover = |> Int32.TryParse |> snd < next) - kill |> Seq.iter (fun b -> b.Remove()) + kill |> Seq.iter _.Remove() keep else bs @@ -81,13 +82,16 @@ module OpenCover = b.Attribute(XName.Get "offsetchain").Value, b.Attribute(XName.Get "offsetend").Value)) |> List.fold - (fun (ki, ke) (_, bz) -> + (fun (ki, ke) (whatever, bz) -> + ignore whatever + let totalVisits = bz - |> Seq.sumBy (fun b -> - b.Attribute(XName.Get "vc").Value - |> Int32.TryParse - |> snd) + |> Seq.sumBy ( + _.Attribute(XName.Get "vc").Value + >> Int32.TryParse + >> snd + ) let h = bz |> Seq.head @@ -99,7 +103,7 @@ module OpenCover = (List.concat [ ki; bz |> Seq.tail |> Seq.toList ], h :: ke)) ([], []) - kill |> Seq.iter (fun b -> b.Remove()) + kill |> Seq.iter _.Remove() keep else bx @@ -208,7 +212,7 @@ module OpenCover = // npath complexity let np = brapts - |> List.groupBy (fun bp -> bp.Attribute(XName.Get "sl").Value) + |> List.groupBy _.Attribute(XName.Get "sl").Value |> Seq.fold (fun np0 (_, b) -> AltCover.OpenCover.safeMultiply (Seq.length b) np0) 1 m.SetAttributeValue(XName.Get "nPathComplexity", np) @@ -245,7 +249,7 @@ module OpenCover = // Fix offset, sc, ec in let debugInfo = methodDef - |> Option.map (fun md -> md.DebugInformation) + |> Option.map _.DebugInformation |> Option.filter (isNull >> not) m.Descendants(XName.Get "MethodPoint") @@ -269,11 +273,11 @@ module OpenCover = x.Add a debugInfo - |> Option.iter (fun dbg -> - dbg.SequencePoints - |> Seq.filter (fun s -> s.IsHidden |> not) - |> Seq.tryHead - |> Option.iter (fun s -> + |> Option.iter ( + _.SequencePoints + >> Seq.filter (_.IsHidden >> not) + >> Seq.tryHead + >> Option.iter (fun s -> x.Attribute(XName.Get "sc").Value <- s.StartColumn.ToString(CultureInfo.InvariantCulture) @@ -281,14 +285,15 @@ module OpenCover = s.EndColumn.ToString(CultureInfo.InvariantCulture) x.Attribute(XName.Get "offset").Value <- - s.Offset.ToString(CultureInfo.InvariantCulture)))) + s.Offset.ToString(CultureInfo.InvariantCulture)) + )) // Fix sequence points as best we can debugInfo |> Option.iter (fun d -> let sp = d.SequencePoints - |> Seq.filter (fun s -> s.IsHidden |> not) + |> Seq.filter (_.IsHidden >> not) |> Seq.toList seqpts @@ -331,7 +336,7 @@ module OpenCover = |> ignore sp - |> Seq.map (fun s -> s.Document.Url) + |> Seq.map _.Document.Url |> Seq.tryFind File.Exists |> Option.map File.ReadAllLines |> Option.iter (fun f -> @@ -570,12 +575,12 @@ module OpenCover = let attributeOrEmpty name (x: XElement) = x.Attribute(XName.Get name) |> Option.ofObj - |> Option.map (fun m -> m.Value) + |> Option.map _.Value |> Option.defaultValue String.Empty let mergeFiles (files: XElement seq) = files - |> Seq.map (fun x -> x.Attribute(XName.Get "fullPath").Value) + |> Seq.map _.Attribute(XName.Get "fullPath").Value |> Seq.distinct |> Seq.mapi (fun i name -> name, (i + 1)) |> Map.ofSeq @@ -617,7 +622,7 @@ module OpenCover = let tm = x.Ancestors(XName.Get "CoverageSession") - |> Seq.collect (fun c -> c.Descendants(XName.Get "TrackedMethod")) + |> Seq.collect _.Descendants(XName.Get "TrackedMethod") |> Seq.find (fun t -> (attributeOrEmpty "uid" t) == key) let token = attributeOrEmpty "token" tm @@ -637,7 +642,7 @@ module OpenCover = np0.SetAttributeValue(XName.Get "vc", mc) group - |> Seq.map (fun x -> x.Attribute(XName.Get "fileid")) + |> Seq.map _.Attribute(XName.Get "fileid") |> Seq.filter (isNull >> not) |> Seq.tryHead |> Option.iter (fun a -> @@ -646,7 +651,7 @@ module OpenCover = let times = group - |> Seq.collect (fun p -> p.Descendants(XName.Get "Time")) + |> Seq.collect _.Descendants(XName.Get "Time") |> Seq.groupBy (attributeOrEmpty "time") |> Seq.map (fun (t, x) -> t, x |> mergeCounts) |> Seq.filter (fun (_, x) -> x > 0) @@ -659,11 +664,11 @@ module OpenCover = np0.Elements(XName.Get "Times") |> Seq.toList - |> Seq.iter (fun t -> t.Remove()) + |> Seq.iter _.Remove() let tracks = group - |> Seq.collect (fun p -> p.Descendants(XName.Get "TrackedMethodRef")) + |> Seq.collect _.Descendants(XName.Get "TrackedMethodRef") |> Seq.map (mapTracking tracked) |> Seq.groupBy (attributeOrEmpty "uid") |> Seq.map (fun (t, x) -> t, x |> mergeCounts) @@ -677,7 +682,7 @@ module OpenCover = np0.Elements(XName.Get "TrackedMethodRefs") |> Seq.toList - |> Seq.iter (fun t -> t.Remove()) + |> Seq.iter _.Remove() if times |> Seq.isEmpty |> not then let t = XElement(XName.Get "Times") @@ -777,7 +782,7 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove group |> snd - |> Seq.map (fun m -> m.Element(XName.Get "MetadataToken").Value) + |> Seq.map _.Element(XName.Get "MetadataToken").Value |> Seq.tryFind (String.IsNullOrWhiteSpace >> not) |> Option.iter (fun t -> mt.Value <- t) @@ -786,8 +791,8 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let fileRef modu (group: string * XElement seq) = group |> snd - |> Seq.collect (fun x -> x.Elements(XName.Get "FileRef")) - |> Seq.map (fun f -> f.Attribute(XName.Get "uid")) + |> Seq.collect _.Elements(XName.Get "FileRef") + |> Seq.map _.Attribute(XName.Get "uid") |> Seq.filter (isNull >> not) |> Seq.tryHead |> Option.map (fun a -> @@ -803,7 +808,7 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let sps = group |> snd - |> Seq.collect (fun m -> m.Descendants(XName.Get "SequencePoint")) + |> Seq.collect _.Descendants(XName.Get "SequencePoint") |> Seq.groupBy (fun s -> s |> attributeOrEmpty "sl" @@ -831,7 +836,7 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let bps = group |> snd - |> Seq.collect (fun m -> m.Descendants(XName.Get "BranchPoint")) + |> Seq.collect _.Descendants(XName.Get "BranchPoint") |> Seq.groupBy (fun s -> (s |> attributeOrEmpty "sl" @@ -856,9 +861,7 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let mpn = XName.Get "MethodPoint" let methodPoints = - group - |> snd - |> Seq.collect (fun x -> x.Elements mpn) + group |> snd |> Seq.collect _.Elements(mpn) let mpv = methodPoints |> mergeCounts @@ -995,9 +998,9 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let methods = c |> snd - |> Seq.collect (fun m -> m.Descendants(XName.Get "Method")) - |> Seq.filter (fun x -> x.Attribute(XName.Get "skippedDueTo") |> isNull) - |> Seq.groupBy (fun x -> x.Element(XName.Get "Name").Value) + |> Seq.collect _.Descendants(XName.Get "Method") + |> Seq.filter (_.Attribute(XName.Get "skippedDueTo") >> isNull) + |> Seq.groupBy _.Element(XName.Get "Name").Value let (msum, merged) = mergeMethods files tracked methods @@ -1031,7 +1034,7 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let findFiles (f: XElement) = let foundFiles = modules - |> Seq.collect (fun m -> m.Descendants(XName.Get "File")) + |> Seq.collect _.Descendants(XName.Get "File") |> Seq.map (attributeOrEmpty "fullPath") |> Seq.distinct |> Seq.filter (String.IsNullOrWhiteSpace >> not) @@ -1049,9 +1052,9 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let findClasses (c: XElement) = let classes = modules - |> Seq.collect (fun m -> m.Descendants(XName.Get "Class")) - |> Seq.filter (fun x -> x.Attribute(XName.Get "skippedDueTo") |> isNull) - |> Seq.groupBy (fun x -> x.Element(XName.Get "FullName").Value) + |> Seq.collect _.Descendants(XName.Get "Class") + |> Seq.filter (_.Attribute(XName.Get "skippedDueTo") >> isNull) + |> Seq.groupBy _.Element(XName.Get "FullName").Value let msummary, merged = mergeClasses files tracked classes @@ -1094,7 +1097,7 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let trackedMethods = modules - |> Seq.collect (fun m -> m.Descendants(XName.Get "TrackedMethod")) + |> Seq.collect _.Descendants(XName.Get "TrackedMethod") |> Seq.groupBy (attributeOrEmpty "token") |> Seq.map (fun grouped -> let key = (hashValue, fst grouped) @@ -1172,14 +1175,14 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove let files = inputs - |> Seq.collect (fun m -> m.Descendants(XName.Get "File")) + |> Seq.collect _.Descendants(XName.Get "File") |> mergeFiles let (summary, modules) = inputs - |> List.collect (fun x -> x.Descendants(XName.Get "Module") |> Seq.toList) - |> List.filter (fun x -> x.Attribute(XName.Get "skippedDueTo") |> isNull) - |> List.groupBy (fun x -> x.Attribute(hash).Value) + |> List.collect (_.Descendants(XName.Get "Module") >> Seq.toList) + |> List.filter (_.Attribute(XName.Get "skippedDueTo") >> isNull) + |> List.groupBy _.Attribute(hash).Value |> List.map (snd >> (mergeModules files tracked)) |> List.fold (fun (states: Summary, statem) (locals, localm) -> @@ -1228,11 +1231,11 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove // heuristic for coverlet vs altcover let sp = json.Values - |> Seq.collect (fun m -> m.Values) - |> Seq.collect (fun d -> d.Values) - |> Seq.collect (fun c -> c.Values) - |> Seq.filter (fun m -> m.SeqPnts.IsNotNull) - |> Seq.collect (fun m -> m.SeqPnts) + |> Seq.collect _.Values + |> Seq.collect _.Values + |> Seq.collect _.Values + |> Seq.filter _.SeqPnts.IsNotNull + |> Seq.collect _.SeqPnts |> Seq.isEmpty |> not @@ -1254,12 +1257,12 @@ coverlet on Tests.AltCoverRunnerTests/PostprocessShouldRestoreDegenerateOpenCove "PreferStringComparisonOverrideRule", Scope = "member", Target = - "AltCover.OpenCover/Pipe #6 stage #1 at line 52@53::Invoke(System.Tuple`2>,System.Xml.Linq.XElement)", + "AltCover.OpenCover/Pipe #6 stage #1 at line 53@54::Invoke(System.Tuple`2>,System.Xml.Linq.XElement)", Justification = "Compiler Generated")>] [,System.Xml.Linq.XElement)", + "AltCover.OpenCover/Pipe #4 stage #1 at line 760@761::Invoke(System.Tuple`2,System.Xml.Linq.XElement)", Justification = "Compiler Generated")>] () \ No newline at end of file diff --git a/AltCover.UICommon/Configuration.fs b/AltCover.UICommon/Configuration.fs index da532a4ca..4b28fdab4 100644 --- a/AltCover.UICommon/Configuration.fs +++ b/AltCover.UICommon/Configuration.fs @@ -99,7 +99,7 @@ module Configuration = config.XPathSelectElements("//Font") |> Seq.toList - |> Seq.iter (fun x -> x.Remove()) + |> Seq.iter _.Remove() let inject = XElement(XName.Get "Font", font) @@ -166,7 +166,7 @@ module Configuration = config.XPathSelectElements("//RecentlyOpened") |> Seq.toList - |> Seq.iter (fun x -> x.Remove()) + |> Seq.iter _.Remove() let inject = config.FirstNode :?> XElement @@ -182,7 +182,7 @@ module Configuration = let _, config = ensureFile () config.XPathSelectElements("//RecentlyOpened") - |> Seq.map (fun n -> n.FirstNode.ToString()) + |> Seq.map _.FirstNode.ToString() |> Seq.filter (fun n -> File.Exists(n)) |> Seq.toList |> sink @@ -195,7 +195,7 @@ module Configuration = config.XPathSelectElements("//Geometry") |> Seq.toList - |> Seq.iter (fun x -> x.Remove()) + |> Seq.iter _.Remove() let (x, y) = location () let (width, height) = size () @@ -243,7 +243,7 @@ module Configuration = config.XPathSelectElements("//Geometry") |> Seq.toList - |> Seq.iter (fun f -> f.Remove()) + |> Seq.iter _.Remove() config.Save file diff --git a/AltCover.UICommon/CoverageFile.fs b/AltCover.UICommon/CoverageFile.fs index 778d7e278..69e8bf265 100644 --- a/AltCover.UICommon/CoverageFile.fs +++ b/AltCover.UICommon/CoverageFile.fs @@ -68,7 +68,7 @@ module Transformer = // normalize file names let sources = document.Descendants(XName.Get "source") - |> Seq.map (fun x -> x.Value) + |> Seq.map _.Value |> Seq.toList document.Descendants(XName.Get "class") diff --git a/AltCover.UICommon/CoverageFileTree.fs b/AltCover.UICommon/CoverageFileTree.fs index 4074cbc9d..c0481a28c 100644 --- a/AltCover.UICommon/CoverageFileTree.fs +++ b/AltCover.UICommon/CoverageFileTree.fs @@ -65,6 +65,7 @@ module CoverageFileTree = "ReviewSelfAssignmentRule", Justification = "Final line is a self-assignment for 'depth' -- compiler fault")>] + [] let rec private scan (s: string) index depth = match s.[index] with | '<' -> scan s (index + 1) (depth + 1) @@ -124,6 +125,7 @@ module CoverageFileTree = ) let gcroot (s: string) = + // [] let rec step (s: string) (i: int) = let next = s.IndexOf("gcroot<", i, StringComparison.Ordinal) @@ -226,12 +228,12 @@ module CoverageFileTree = Exists = true Stale = false Icon = environment.Icons.Source }) - |> Seq.distinctBy (fun s -> s.FullName) // allows for same name, different path - |> Seq.sortBy (fun s -> s.FileName |> upcase) + |> Seq.distinctBy _.FullName // allows for same name, different path + |> Seq.sortBy (_.FileName >> upcase) |> Seq.toList let hasSource = - sources |> List.exists (fun s -> s.Exists) + sources |> List.exists _.Exists let icon = if hasSource then @@ -313,7 +315,7 @@ module CoverageFileTree = if special <> MethodType.Normal then let pc = - keys |> Seq.map (fun x -> x.Navigator) |> pcCover + keys |> (Seq.map _.Navigator) |> pcCover let newrow = environment.AddNode @@ -327,14 +329,14 @@ module CoverageFileTree = None keys - |> Seq.sortBy (fun key -> key.Name |> DisplayName) + |> Seq.sortBy (_.Name >> DisplayName) |> Seq.iter (applyMethod newrow) else applyMethod theModel (keys |> Seq.head) let methods = nodes - |> Seq.groupBy (fun key -> key.Name |> DisplayName |> HandleSpecialName) + |> Seq.groupBy (_.Name >> DisplayName >> HandleSpecialName) |> Seq.toArray let orderMethods array = @@ -377,15 +379,12 @@ module CoverageFileTree = (environment.Icons.Module, String.Empty) // TODO maybe else let pc = - group - |> snd - |> Seq.map (fun x -> x.Navigator) - |> pcCover + group |> snd |> Seq.map _.Navigator |> pcCover let names = group |> snd - |> Seq.map (fun key -> key.Name |> DisplayName) + |> Seq.map (_.Name >> DisplayName) |> Seq.filter (fun d -> d.[0] <> '.') |> Seq.toList @@ -410,9 +409,7 @@ module CoverageFileTree = || name.StartsWith(n + "/", StringComparison.Ordinal) let classlist = - nodes - |> Seq.groupBy (fun x -> x.ClassName) - |> Seq.toList + nodes |> Seq.groupBy _.ClassName |> Seq.toList let classnames = classlist |> Seq.map fst |> Set.ofSeq @@ -423,8 +420,7 @@ module CoverageFileTree = classnames |> Seq.filter (fun cn -> contains cn "+" || contains cn "/") - |> Seq.map (fun cn -> - cn.Split([| "+"; "/" |], StringSplitOptions.RemoveEmptyEntries).[0]) + |> Seq.map _.Split([| "+"; "/" |], StringSplitOptions.RemoveEmptyEntries).[0] |> Seq.distinct |> Seq.filter (fun mn -> classnames |> Set.contains mn |> not) |> Seq.map (fun mn -> (mn, Seq.empty)) @@ -479,10 +475,7 @@ module CoverageFileTree = let name = fst group let pc = - group - |> snd - |> Seq.map (fun x -> x.Navigator) - |> pcCover + group |> snd |> Seq.map _.Navigator |> pcCover let newrow = environment.AddNode theModel environment.Icons.Namespace pc name None @@ -510,7 +503,7 @@ module CoverageFileTree = else classfullname.Substring(1 + lastdot) Name = m.GetAttribute("name", String.Empty) }) - |> Seq.groupBy (fun x -> x.NameSpace) + |> Seq.groupBy _.NameSpace |> Seq.sortBy fst methods |> Seq.iter (applyToModel model) @@ -542,13 +535,13 @@ module CoverageFileTree = let sourceFiles = navigator.Select("//seqpnt/@document") |> Seq.cast - |> Seq.map (fun x -> x.Value) + |> Seq.map _.Value |> Seq.distinct let missing = sourceFiles |> Seq.map GetSource - |> Seq.filter (fun f -> not f.Exists) + |> Seq.filter (_.Exists >> not) let newer = sourceFiles @@ -559,7 +552,7 @@ module CoverageFileTree = [ (missing, "NotAllSourcePresent") (newer, "SomeSourceModified") ] |> Seq.filter (fun (x, y) -> x |> Seq.isEmpty |> not) - |> Seq.map (fun (x, y) -> Resource.Format(y, [||])) + |> Seq.map (fun (x, y) -> Resource.Format(y, Array.empty)) let pc = pcCover [ navigator ] @@ -615,18 +608,18 @@ module CoverageFileTree = "PreferStringComparisonOverrideRule", Scope = "member", // MethodDefinition Target = - "AltCover.CoverageFileTree/step@128::Invoke(System.String,System.Int32)", + "AltCover.CoverageFileTree/step@130::Invoke(System.String,System.Int32)", Justification = "Replace overload not in netstandard2.0")>] [,AltCover.GuiCommon/MethodKey)", + "AltCover.CoverageFileTree/applyMethod@167::Invoke(AltCover.CoverageTreeContext`2,AltCover.GuiCommon/MethodKey)", Justification = "Possibly too much work")>] [,a>[])", + "AltCover.CoverageFileTree/applyMethods@359-1::Invoke(System.Tuple`2,a>[])", Justification = "Inlined library code")>] () \ No newline at end of file diff --git a/AltCover.UICommon/GuiCommon.fs b/AltCover.UICommon/GuiCommon.fs index fff7d5566..7feb9e281 100644 --- a/AltCover.UICommon/GuiCommon.fs +++ b/AltCover.UICommon/GuiCommon.fs @@ -60,13 +60,14 @@ module GuiCommon = let Embed (node: XPathNavigator) (document: string) = node.SelectAncestors("module", String.Empty, false) |> Seq.cast - |> Seq.collect (fun n -> - n.SelectDescendants("altcover.file", String.Empty, false) - |> Seq.cast) + |> Seq.collect ( + _.SelectDescendants("altcover.file", String.Empty, false) + >> Seq.cast + ) |> Seq.filter (fun n -> n.GetAttribute("document", String.Empty) == document) - |> Seq.map (fun n -> n.GetAttribute("embed", String.Empty)) + |> Seq.map _.GetAttribute("embed", String.Empty) |> Seq.filter (String.IsNullOrWhiteSpace >> not) |> Seq.tryHead diff --git a/AltCover.UICommon/HandlerCommon.fs b/AltCover.UICommon/HandlerCommon.fs index 7ac3f4b47..fdc61d386 100644 --- a/AltCover.UICommon/HandlerCommon.fs +++ b/AltCover.UICommon/HandlerCommon.fs @@ -30,12 +30,12 @@ module HandlerCommon = let document = allpoints - |> Seq.map (fun p -> p.GetAttribute("document", String.Empty)) + |> Seq.map _.GetAttribute("document", String.Empty) |> Seq.tryFind (String.IsNullOrWhiteSpace >> not) let line = allpoints - |> Seq.map (fun p -> p.GetAttribute("line", String.Empty)) + |> Seq.map _.GetAttribute("line", String.Empty) |> Seq.tryFind (String.IsNullOrWhiteSpace >> not) if document |> Option.isNone || line |> Option.isNone then @@ -133,7 +133,7 @@ module HandlerCommon = |> Seq.cast |> Seq.map (coverageToTag lineOnly) |> Seq.filter (filterCoverage sourceLines) - |> Seq.sortByDescending (fun t -> t.VisitCount) + |> Seq.sortByDescending _.VisitCount |> Seq.toList [] let TagLines (visited: 'Tag) (notVisited: 'Tag) (tags: CodeTag list) = tags - |> List.groupBy (fun t -> t.Line) + |> List.groupBy _.Line |> List.map (fun (l, t) -> let total = t @@ -180,7 +180,7 @@ module HandlerCommon = let TagBranches (methodPath: XPathNavigator) (file: Source) = (methodPath.Select("//branch[@document='" + file.FullName + "']") // TODO |> Seq.cast - |> Seq.groupBy (fun n -> n.GetAttribute("line", String.Empty)) + |> Seq.groupBy _.GetAttribute("line", String.Empty) |> Seq.toList |> Seq.map (fun n -> let line = @@ -207,7 +207,7 @@ module HandlerCommon = let files = window.CoverageFiles - |> List.filter (fun n -> not (n.Equals(path, casematch))) + |> List.filter (_.Equals(path, casematch) >> not) |> Seq.truncate (9) |> Seq.toList diff --git a/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj b/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj index 0f611330c..8d8c9a994 100644 --- a/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj +++ b/AltCover.ValidateGendarmeEmulation/AltCover.ValidateGendarmeEmulation.fsproj @@ -3,7 +3,7 @@ net8.0;net472 false - 2023.8.26.15512 + 2023.12.27.19054 ..\packages\altcode.gendarme\$(GendarmeVersion)\tools\ false AltCover.ValidateGendarmeEmulation @@ -55,7 +55,8 @@ - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/AltCover.ValidateGendarmeEmulation/Tests.fs b/AltCover.ValidateGendarmeEmulation/Tests.fs index 09fe5f3b4..9e1bf536b 100644 --- a/AltCover.ValidateGendarmeEmulation/Tests.fs +++ b/AltCover.ValidateGendarmeEmulation/Tests.fs @@ -7,6 +7,7 @@ open AltCover open Mono.Cecil module Rocks = + [] let rec GetAllTypes (t: TypeDefinition) = t :: (List.collect @@ -55,9 +56,9 @@ module ValidateGendarmeEmulation = |> Seq.cast |> Seq.map Rocks.GetAllTypes |> List.concat - |> List.map (fun t -> t.Methods |> Seq.cast) + |> List.map (_.Methods >> Seq.cast) |> Seq.concat - |> Seq.sortBy (fun m -> m.FullName))) + |> Seq.sortBy _.FullName)) |> seqStringify |> Seq.choose id |> Seq.toList @@ -87,9 +88,9 @@ module ValidateGendarmeEmulation = |> Seq.cast |> Seq.map Rocks.GetAllTypes |> List.concat - |> List.map (fun t -> t.Methods |> Seq.cast) + |> List.map (_.Methods >> Seq.cast) |> Seq.concat - |> Seq.sortBy (fun m -> m.FullName))) + |> Seq.sortBy _.FullName)) |> seqStringify |> Seq.choose id |> Seq.toList @@ -118,9 +119,9 @@ module ValidateGendarmeEmulation = |> Seq.cast |> Seq.map Rocks.GetAllTypes |> List.concat - |> List.map (fun t -> t.Methods |> Seq.cast) + |> List.map (_.Methods >> Seq.cast) |> Seq.concat - |> Seq.sortBy (fun m -> m.FullName))) + |> Seq.sortBy _.FullName)) |> seqStringify |> Seq.choose id |> Seq.toList @@ -131,8 +132,7 @@ module ValidateGendarmeEmulation = let GratuitousCoverage () = let l = Left 23 let r = Right true - let mutable x = Object() - x <- null + let mutable x: Object = null test <@ (23).IsNotNull @> test <@ x.IsNotNull |> not @> diff --git a/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj b/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj index bb40106c0..6ee7202f1 100644 --- a/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj +++ b/AltCover.Visualizer.Tests/AltCover.Visualizer.Tests.fsproj @@ -30,7 +30,8 @@ runtime; build; native; contentfiles; analyzers - + + diff --git a/AltCover.Visualizer.Tests/UICommonTests.fs b/AltCover.Visualizer.Tests/UICommonTests.fs index 66d8da6e6..ca499f888 100644 --- a/AltCover.Visualizer.Tests/UICommonTests.fs +++ b/AltCover.Visualizer.Tests/UICommonTests.fs @@ -17,14 +17,14 @@ module VisualizerTests = [ "string"; null; "another string" ] let nulls = - input |> List.map (fun x -> x.IsNotNull |> not) + input |> List.map (_.IsNotNull >> not) test <@ nulls = [ false; true; false ] @> [] let AugmentNonNullableDetectNoNulls () = let input = [ 1; 2; 3 ] - test <@ input |> List.forall (fun x -> x.IsNotNull) @> + test <@ input |> List.forall _.IsNotNull @> // CoverageFile.fs diff --git a/AltCover.Visualizer/Visualizer.fs b/AltCover.Visualizer/Visualizer.fs index cca107a2b..91bc4faa5 100644 --- a/AltCover.Visualizer/Visualizer.fs +++ b/AltCover.Visualizer/Visualizer.fs @@ -120,7 +120,7 @@ module private Gui = String.Join( Environment.NewLine, [ AltCover.AssemblyVersionInformation.AssemblyCopyright - Resource.Format("aboutVisualizer.Copyright", []) + Resource.Format("aboutVisualizer.Copyright", List.empty) "https://learn.microsoft.com/en-us/visualstudio/designers/the-visual-studio-image-library?view=vs-2022" ] ) @@ -282,7 +282,7 @@ module private Gui = ResponseType.Ok, Resource.GetResourceString "OpenFile.Cancel", ResponseType.Cancel, - null + nullObject ) let data = @@ -906,7 +906,7 @@ module private Gui = handler.classStructureTree.QueryTooltip |> Event.add (fun (x: QueryTooltipArgs) -> let tip = x.Tooltip - x.RetVal <- null + x.RetVal <- nullObject let mutable path: TreePath = null if handler.classStructureTree.GetPathAtPos(x.X, x.Y, &path) then diff --git a/Build/NuGet.csproj b/Build/NuGet.csproj index 0f095930a..baea8b2c9 100644 --- a/Build/NuGet.csproj +++ b/Build/NuGet.csproj @@ -27,5 +27,6 @@ + \ No newline at end of file diff --git a/Build/actions.fs b/Build/actions.fs index c0302cc13..1f20ad338 100644 --- a/Build/actions.fs +++ b/Build/actions.fs @@ -20,6 +20,7 @@ module Actions = open AltCoverFake.DotNet.Testing let Clean () = + // [] let rec clean1 depth = try (DirectoryInfo ".") @@ -33,7 +34,7 @@ module Actions = |> Path.GetFullPath |> n.FullName.StartsWith |> not) - |> Seq.map (fun x -> x.FullName) + |> Seq.map _.FullName |> Seq.distinct // arrange so leaves get deleted first, avoiding "does not exist" warnings |> Seq.groupBy (fun x -> @@ -79,6 +80,7 @@ module Actions = clean1 0 let CleanDir folder = + // [] let rec clean1 depth = try Shell.deleteDir folder @@ -107,15 +109,10 @@ open System.Runtime.CompilerServices #if DEBUG [] [] -[] [] -[] [] -[] [] -[] [] -[] #else [] #endif @@ -130,7 +127,6 @@ using System.Runtime.CompilerServices; #if DEBUG [assembly: AssemblyConfiguration("Debug {0}")] [assembly: InternalsVisibleTo("AltCover.Monitor.Tests, PublicKey={1}")] -[assembly: InternalsVisibleTo("AltCover.Monitor.Tests, PublicKey={2}")] #else [assembly: AssemblyConfiguration("Release {0}")] #endif""" @@ -166,18 +162,6 @@ using System.Runtime.CompilerServices; Array.append prefix buffer let InternalsVisibleTo version = - use stream2 = // fsharplint:disable-next-line RedundantNewKeyword - new System.IO.FileStream( - "./Build/SelfTest.snk", - System.IO.FileMode.Open, - System.IO.FileAccess.Read - ) - - //let pair2 = StrongNameKeyPair(stream2) - //let key2 = BitConverter.ToString pair2.PublicKey - let key2 = - stream2 |> GetPublicKey |> BitConverter.ToString - use stream = // fsharplint:disable-next-line RedundantNewKeyword new System.IO.FileStream( "./Build/Infrastructure.snk", @@ -198,8 +182,7 @@ using System.Runtime.CompilerServices; System.Globalization.CultureInfo.InvariantCulture, model, version, - key.Replace("-", String.Empty), - key2.Replace("-", String.Empty) + key.Replace("-", String.Empty) ) // Update the file only if it would change @@ -256,7 +239,7 @@ using System.Runtime.CompilerServices; let recorded = coverageDocument.Descendants(XName.Get("method")) - |> Seq.map (fun x -> x.Attribute(XName.Get("name")).Value) + |> Seq.map _.Attribute(XName.Get("name")).Value |> Seq.filter (fun x -> others |> Seq.exists (fun y -> x = y) |> not) |> Seq.sort |> Seq.toList @@ -288,7 +271,7 @@ using System.Runtime.CompilerServices; let recorded = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get("visitcount")).Value) + |> Seq.map _.Attribute(XName.Get("visitcount")).Value |> Seq.toList let expected = @@ -326,14 +309,14 @@ using System.Runtime.CompilerServices; let zero = recorded |> Seq.filter (fun x -> x.Attribute(XName.Get("visitcount")).Value = "0") - |> Seq.map (fun x -> x.Attribute(XName.Get("line")).Value) + |> Seq.map _.Attribute(XName.Get("line")).Value |> Seq.sort |> Seq.toList let ones = recorded |> Seq.filter (fun x -> x.Attribute(XName.Get("visitcount")).Value = "1") - |> Seq.map (fun x -> x.Attribute(XName.Get("line")).Value) + |> Seq.map _.Attribute(XName.Get("line")).Value |> Seq.sort |> Seq.toList @@ -399,13 +382,11 @@ using System.Runtime.CompilerServices; let AssertResult (msg: string) (result: Fake.Core.ProcessResult<'a>) = Assert.That(result.ExitCode, Is.EqualTo 0, msg) - let Run (file, dir, args) msg = - CreateProcess.fromRawCommand - file - (if isNull args then - Seq.empty - else - args) + let Run (file, dir, (args: string seq)) msg = + printfn "Actions.Run %A on %A with %A" file dir args + args |> Seq.iter (printfn "%A") + + CreateProcess.fromRawCommand file args |> CreateProcess.withWorkingDirectory dir |> CreateProcess.withFramework |> Proc.run @@ -593,8 +574,8 @@ a:hover {color: #ecc;} let Check4Content (coverageDocument: XDocument) = let recorded = coverageDocument.Descendants(XName.Get("Method")) - |> Seq.collect (fun x -> x.Descendants(XName.Get("Name"))) - |> Seq.map (fun x -> x.Value.Replace("Tests.Program", "Program/Program")) + |> Seq.collect _.Descendants(XName.Get("Name")) + |> Seq.map _.Value.Replace("Tests.Program", "Program/Program") |> Seq.sort |> Seq.toList @@ -646,7 +627,7 @@ a:hover {color: #ecc;} let Check4Visits path before (coverageDocument: XDocument) = let recorded = coverageDocument.Descendants(XName.Get("SequencePoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList let expected = @@ -669,10 +650,11 @@ a:hover {color: #ecc;} let vx = sp.Descendants(XName.Get("Time")) - |> Seq.sumBy (fun x -> - x.Attribute(XName.Get("vc")).Value - |> Int32.TryParse - |> snd) + |> Seq.sumBy ( + _.Attribute(XName.Get("vc")).Value + >> Int32.TryParse + >> snd + ) Assert.That(vc, Is.EqualTo vx, sp.Value)) @@ -717,7 +699,7 @@ a:hover {color: #ecc;} Assert.That( coverageDocument.Descendants(XName.Get("TrackedMethodRef")) - |> Seq.map (fun x -> x.ToString()), + |> Seq.map _.ToString(), Is.EquivalentTo [ "" "" diff --git a/Build/get-token.fsx b/Build/get-token.fsx index c51dd26bf..934ca3003 100644 --- a/Build/get-token.fsx +++ b/Build/get-token.fsx @@ -22,6 +22,7 @@ let patchArray s = |> Seq.map (fun (x: byte) -> x.ToString("X2").ToLower()) |> Seq.toList +[] let rec chunkArray (s: string list) = let chunk = 39 s |> Seq.truncate chunk |> Seq.iter Console.Write diff --git a/Build/setup.fs b/Build/setup.fs index fa5a39ea9..f40078c74 100644 --- a/Build/setup.fs +++ b/Build/setup.fs @@ -64,7 +64,7 @@ module Setup = |> XDocument.Load xml.Descendants() - |> Seq.filter (fun x -> x.Attribute(XName.Get("Include")) |> isNull |> not) + |> Seq.filter (_.Attribute(XName.Get("Include")) >> isNull >> not) |> Seq.map (fun x -> (x.Attribute(XName.Get("Include")).Value, x.Attribute(XName.Get("Version")).Value)) |> Map.ofSeq @@ -100,14 +100,19 @@ module Setup = let _Target s f = Target.description s - Target.create s f + + let wrap f x = + printfn ">> %A <<" x + f () + + Target.create s (wrap f) let resetColours _ = Console.ForegroundColor <- consoleBefore |> fst Console.BackgroundColor <- consoleBefore |> snd let FxCop = - (fun _ -> + (fun () -> fxcop |> Option.iter (fun fx -> Directory.ensure "./packages/fxcop/" diff --git a/Build/snkTokens.txt b/Build/snkTokens.txt index 77516963b..4ad3b537b 100644 --- a/Build/snkTokens.txt +++ b/Build/snkTokens.txt @@ -2,6 +2,13 @@ Infrastructure.snk : c02b1a9f5b7cade8 Recorder.snk : 4ebffcaabf10ce6a SelfTest.snk : 3eb3cd726036ff71 ThirdParty.snk : 9aa26ad8b6cf2594 +InternalsVisibleTest.snk : 6a64b6df47008d1c + +0024000004800000940000000602000000240000525341310004000001000100f9a856f46c3129 +69423375ab83a0509fa025fb6ec6c8cc5655ad7eebadcf63011850ce7367c183b914c95cf7801f +e7cb7dc836dbf661fc841cdb5401dffd3df995b2204a2cb7e3665db1381bd966b1d15447424030 +640829c653de4e47c54d79bdfa5620864ce46846b87a6901887f6cb5474bcea43ddc12ea90dfc5 +dec9dbab -- diff --git a/Build/targets.fs b/Build/targets.fs index 8e8213081..c5c98d8a4 100644 --- a/Build/targets.fs +++ b/Build/targets.fs @@ -60,6 +60,7 @@ module Targets = [ @"System\." @"Sample3\.Class2" "Microsoft" + " Seq.toList) } @@ -82,6 +83,7 @@ module Targets = @"Sample3\.Class2" "Microsoft" "ICSharpCode" + " Seq.map TypeSafe.Raw @@ -126,6 +128,7 @@ module Targets = @"Sample3\.Class2" "Microsoft" "ICSharpCode" + " Seq.map TypeSafe.Raw @@ -149,7 +152,7 @@ module Targets = let VersionTemplate = let vx = DotNet.exec - (fun o -> dotnetOptions (o.WithRedirectOutput true)) + (_.WithRedirectOutput(true) >> dotnetOptions) "" "nbgv get-version -v NuGetPackageVersion" @@ -170,19 +173,19 @@ module Targets = lastGoodPackage () let dotnetVersion = - DotNet.getVersion (fun o -> o.WithCommon dotnetOptions) + DotNet.getVersion _.WithCommon(dotnetOptions) printfn "Using dotnet version %s" dotnetVersion let dotnetInfo = - DotNet.exec (fun o -> dotnetOptions (o.WithRedirectOutput true)) "" "--info" + DotNet.exec (_.WithRedirectOutput(true) >> dotnetOptions) "" "--info" let dotnetSdkPath = dotnetInfo.Results - |> Seq.filter (fun x -> x.IsError |> not) - |> Seq.map (fun x -> x.Message) - |> Seq.tryFind (fun x -> x.Contains "Base Path:") - |> Option.map (fun x -> x.Replace("Base Path:", "").TrimStart()) + |> Seq.filter (_.IsError >> not) + |> Seq.map _.Message + |> Seq.tryFind _.Contains("Base Path:") + |> Option.map _.Replace("Base Path:", "").TrimStart() let refdir = dotnetSdkPath @@ -273,7 +276,7 @@ module Targets = |> XDocument.Load xml.Descendants() - |> Seq.filter (fun x -> x.Attribute(XName.Get("Include")) |> isNull |> not) + |> Seq.filter (_.Attribute(XName.Get("Include")) >> isNull >> not) |> Seq.filter (fun x -> match x.Attribute(XName.Get("Condition")) with | null -> true @@ -352,13 +355,10 @@ module Targets = WorkingDirectory = Path.getFullName dir } let testWithCLIArguments (o: Fake.DotNet.DotNet.TestOptions) = - let msb = - { o.MSBuildParams with - ConsoleLogParameters = [] - DistributedLoggers = None - DisableInternalBinLog = true } - - { o with MSBuildParams = msb } + { o with + Fake.DotNet.DotNet.TestOptions.MSBuildParams.ConsoleLogParameters = [] + Fake.DotNet.DotNet.TestOptions.MSBuildParams.DistributedLoggers = None + Fake.DotNet.DotNet.TestOptions.MSBuildParams.DisableInternalBinLog = true } let buildWithCLIArguments (o: Fake.DotNet.DotNet.BuildOptions) = { o with MSBuildParams = cliArguments } @@ -368,14 +368,11 @@ module Targets = ("AltCoverTag", (tag + "_")) :: o.MSBuildParams.Properties - let msb = - { o.MSBuildParams with - ConsoleLogParameters = [] - Properties = p - DistributedLoggers = None - DisableInternalBinLog = true } - - { o with MSBuildParams = msb } + { o with + Fake.DotNet.DotNet.TestOptions.MSBuildParams.ConsoleLogParameters = [] + Fake.DotNet.DotNet.TestOptions.MSBuildParams.Properties = p + Fake.DotNet.DotNet.TestOptions.MSBuildParams.DistributedLoggers = None + Fake.DotNet.DotNet.TestOptions.MSBuildParams.DisableInternalBinLog = true } let buildWithCLITaggedArguments tag (o: Fake.DotNet.DotNet.BuildOptions) = { o with @@ -666,11 +663,14 @@ module Targets = //---------------------------------------------------------------- let _Target s f = + let doTarget s f = let banner x = printfn "" - printfn " ****************** %s ******************" s - f x + // printfn " ****************** %s ******************" s + printfn " ****************** %s ******************" x.TargetInfo.Name + // if we ever need context we could stash it in a mutable at module level + f () Target.create s banner @@ -688,7 +688,7 @@ module Targets = //_Target "Preparation" ignore let PreClean = - (fun _ -> + (fun () -> // ("." |> Information.shortlog).Substring 9 |> printfn "%A" // dir -Recurse *ssemblyAttributes.cs | % { del -Force $_.FullName } !! "**/*ssemblyAttributes.cs" @@ -697,12 +697,12 @@ module Targets = |> List.iter File.delete) let Clean = - (fun _ -> + (fun () -> printfn "Cleaning the build and deploy folders" Actions.Clean()) let SetVersion = - (fun _ -> + (fun () -> // patch gendarme let configjson = @@ -768,7 +768,7 @@ module Targets = let fileVersionTemplate = let vx = DotNet.exec - (fun o -> dotnetOptions (o.WithRedirectOutput true)) + (_.WithRedirectOutput(true) >> dotnetOptions) "" "nbgv get-version -v Version" @@ -779,7 +779,7 @@ module Targets = let tag = rn - |> Array.findIndex (fun l -> l.StartsWith("# ", StringComparison.Ordinal)) + |> Array.findIndex _.StartsWith("# ", StringComparison.Ordinal) let hashv = String.Format("# {0}", Version) rn.[tag] <- rn.[tag].Replace("#", hashv) @@ -863,7 +863,7 @@ module Targets = //_Target "Compilation" ignore let BuildRelease = - (fun _ -> + (fun () -> try [ "./AltCover.sln" "./AltCover.Visualizer.sln" @@ -909,13 +909,13 @@ module Targets = reraise ()) let BuildRecorder = - (fun _ -> msbuildDebug MSBuildPath "./AltCover.Recorder.sln") + (fun () -> msbuildDebug MSBuildPath "./AltCover.Recorder.sln") let BuildReleaseRecorder = - (fun _ -> msbuildRelease MSBuildPath "./AltCover.Recorder.sln") + (fun () -> msbuildRelease MSBuildPath "./AltCover.Recorder.sln") let BuildDebug = - (fun _ -> + (fun () -> Directory.ensure "./_SourceLink" Shell.copyFile "./_SourceLink/Class2.cs" "./Samples/Sample14/Sample14/Class2.txt" @@ -942,7 +942,7 @@ module Targets = Shell.copy "./_SourceLink" (!! "./_Binaries/Sample14/Debug+AnyCPU/net8.0/*")) let BuildMonoSamples = - (fun _ -> + (fun () -> [ "./Samples/Sample8/Sample8.csproj" ] |> Seq.iter dotnetBuildDebug // build to embed on non-Windows @@ -971,7 +971,7 @@ module Targets = |> Actions.Run(mcs, ".", cmd))) let BuildSample31 = - (fun _ -> + (fun () -> let mcs = "_Binaries/MCS/Release+AnyCPU/net472/MCS.exe" @@ -995,7 +995,7 @@ module Targets = // _Target "Analysis" ignore let Lint = - (fun _ -> + (fun () -> let cfg = Path.getFullName "./fsharplint.json" @@ -1077,7 +1077,7 @@ module Targets = // reraise ()) let Gendarme = - (fun _ -> // Needs debug because release is compiled --standalone which contaminates everything + (fun () -> // Needs debug because release is compiled --standalone which contaminates everything Directory.ensure "./_Reports" @@ -1129,7 +1129,7 @@ module Targets = FailBuildOnDefect = true })) let FxCop = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let dumpSuppressions (report: String) = @@ -1368,7 +1368,9 @@ module Targets = { FxCop.Params.Create() with WorkingDirectory = "." DependencyDirectories = - [ "./ThirdParty/gtk-sharp2" + [ Path.GetFullPath "./ThirdParty/gtk-sharp2" + Path.GetFullPath + "./packages/system.valuetuple/4.0.0-rc3-24212-01/lib/netstandard1.1" nugetCache @@ "blackfox.commandline/" + (ddItem "blackfox.commandline") @@ -1477,8 +1479,8 @@ module Targets = let packages = xml.Descendants(XName.Get("PackageReference")) - |> Seq.filter (fun x -> x.Attribute(XName.Get("Include")) |> isNull |> not) - |> Seq.map (fun x -> x.Attribute(XName.Get("Include")).Value) + |> Seq.filter (_.Attribute(XName.Get("Include")) >> isNull >> not) + |> Seq.map _.Attribute(XName.Get("Include")).Value |> Seq.toList let dirs = @@ -1515,7 +1517,7 @@ module Targets = // Unit Test let UnitTest = - (fun _ -> + (fun () -> let reports = Path.getFullName "./_Reports" CreateProcess.fromRawCommand @@ -1542,10 +1544,13 @@ module Targets = if Environment.isWindows - && "GITHUB_RUN_NUMBER" - |> (Environment.environVar - >> String.IsNullOrWhiteSpace - >> not) + && [ "GITHUB_RUN_NUMBER" + "COVERALLS_REPO_TOKEN" ] + |> List.forall ( + Environment.environVar + >> String.IsNullOrWhiteSpace + >> not + ) then let maybe envvar fallback = let x = Environment.environVar envvar @@ -1597,6 +1602,7 @@ module Targets = //_Target "UncoveredUnitTest" ignore let NUnitRetry f spec = + // [] let rec doNUnitRetry depth f spec = try if File.Exists spec then @@ -1631,7 +1637,7 @@ module Targets = doNUnitRetry 0 f spec let JustRecorderUnitTest = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" try @@ -1658,7 +1664,7 @@ module Targets = reraise ()) let JustUnitTest = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" try @@ -1701,7 +1707,7 @@ module Targets = reraise ()) let BuildForUnitTestDotNet = - (fun _ -> + (fun () -> let withTagDebug (p: MSBuildParams) = { p with Properties = @@ -1725,14 +1731,14 @@ module Targets = |> (buildWithCLITaggedArguments "UnitTestDotNet")) !!(@"./*Test*/*Tests.fsproj") - |> Seq.filter (fun s -> s.Contains("Recorder") |> not) // net20 + |> Seq.filter (_.Contains("Recorder") >> not) // net20 |> Seq.iter buildIt !!(@"./*.Valid*/*Valid*.fsproj") |> Seq.iter buildIt) let UnitTestDotNet = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let testIt = @@ -1758,7 +1764,7 @@ module Targets = reraise ()) let BuildForCoverlet = - (fun _ -> + (fun () -> let withTagDebug (p: MSBuildParams) = { p with Properties = @@ -1790,7 +1796,7 @@ module Targets = )) let UnitTestDotNetWithCoverlet = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" try @@ -1842,7 +1848,7 @@ module Targets = x.Value = "System.Void AltCover.CommandLine/Format::.ctor()") |> Seq.toList - key |> List.iter (fun x -> x.Parent.Remove()) + key |> List.iter _.Parent.Remove() let target = (Path.getFullName "./_Reports") @@ -1864,7 +1870,7 @@ module Targets = ReportGenerator.ReportType.XmlSummary ] TargetDir = "_Reports/_UnitTestWithCoverlet" }) (xml - |> List.filter (fun p -> not <| p.Contains("Visualizer"))) + |> List.filter (_.Contains("Visualizer") >> not)) ReportGenerator.generateReports (fun p -> @@ -1872,8 +1878,7 @@ module Targets = ToolType = ToolType.CreateLocalTool() ReportTypes = [ ReportGenerator.ReportType.Html ] TargetDir = "_Reports/_VisualizerWithCoverlet" }) - (xml - |> List.filter (fun p -> p.Contains("Visualizer"))) + (xml |> List.filter _.Contains("Visualizer")) uncovered @"_Reports/_UnitTestWithCoverl*/Summary.xml" |> List.map fst @@ -1883,7 +1888,7 @@ module Targets = reraise ()) let UnitTestWithOpenCover = - (fun _ -> + (fun () -> Directory.ensure "./_Reports/_UnitTestWithOpenCover" let testFiles = @@ -2026,7 +2031,7 @@ module Targets = // Hybrid (Self) Tests let UnitTestWithAltCover = - (fun _ -> + (fun () -> Directory.ensure "./_Reports/_UnitTestWithAltCover" // Tools @@ -2230,7 +2235,7 @@ module Targets = |> printfn "%A uncovered lines") let UnitTestWithAltCoverRunner = - (fun _ -> + (fun () -> Directory.ensure "./_Reports/_UnitTestWithAltCoverRunner" // Tools @@ -2380,6 +2385,7 @@ module Targets = WorkingDirectory = "." } let nUnitRetry2 () = + // [] let rec doNUnitRetry2 depth = try if File.Exists nunitReport then @@ -2418,7 +2424,7 @@ module Targets = let xmlreports = tests |> List.map (fun (_, _, report, _, _, _, _) -> reports @@ report) - |> List.filter (fun r -> not <| r.Contains("Visualizer")) + |> List.filter (_.Contains("Visualizer") >> not) ReportGenerator.generateReports (fun p -> @@ -2438,14 +2444,14 @@ module Targets = TargetDir = "_Reports/_VisualizerTestsWithAltCoverRunner" }) (tests |> List.map (fun (_, _, report, _, _, _, _) -> reports @@ report) - |> List.filter (fun r -> r.Contains("Visualizer"))) + |> List.filter _.Contains("Visualizer")) uncovered @"_Reports/_UnitTestWithAltCoverRunner/Summary.xml" |> List.map fst |> printfn "%A uncovered lines") let UnitTestWithAltCoverCore = - (fun _ -> + (fun () -> Directory.ensure "./_Reports/_UnitTestWithAltCoverCore" let keyfile = @@ -2547,7 +2553,7 @@ module Targets = let xmlreports = tests |> List.map (fun (_, _, report, _, _) -> report) - |> List.filter (fun f -> f.Contains("Visualizer") |> not) + |> List.filter (_.Contains("Visualizer") >> not) ReportGenerator.generateReports (fun p -> @@ -2569,14 +2575,14 @@ module Targets = TargetDir = "_Reports/_VisualizerWithAltCoverCore" }) (tests |> List.map (fun (_, _, report, _, _) -> report) - |> List.filter (fun f -> f.Contains("Visualizer"))) + |> List.filter _.Contains("Visualizer")) uncovered @"_Reports/_UnitTestWithAltCoverCore/Summary.xml" |> List.map fst |> printfn "%A uncovered lines") let UnitTestWithAltCoverCoreRunner = - (fun _ -> + (fun () -> Directory.ensure "./_Reports/_UnitTestWithAltCoverCoreRunner" Shell.cleanDir ("./_Binaries/Sample4LongForm") @@ -2760,7 +2766,7 @@ module Targets = //_Target "OperationalTest" ignore let FSharpTypes = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let simpleReport = @@ -2803,7 +2809,7 @@ module Targets = Actions.ValidateFSharpTypes simpleReport []) let FSharpTests = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let altcover = @@ -2904,7 +2910,7 @@ module Targets = Assert.That(tmrcount, Is.LessThanOrEqualTo sptcount, name.Value))) let AsyncAwaitTests = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" // Provoke this sub-issue : https://github.com/SteveGilham/altcover/issues/105#issuecomment-737203810 // seen in 7.2.800, fixed in commit 93325bb645dcbfaf01b996fc99576ef4501f41b8 @@ -2942,11 +2948,7 @@ module Targets = { Primitive.PrepareOptions.Create() with Report = simpleReport CallContext = [ "[Test]" ] - AssemblyFilter = - [ "Adapter" - "nunit" - "Microsoft" - "testhost" ] + AssemblyFilter = [ "Adapter"; "nunit" ] TypeFilter = [ "System\\."; "Microsoft\\." ] InPlace = true ReportFormat = "OpenCover" @@ -3007,7 +3009,7 @@ module Targets = Assert.That(tmrcount, Is.EqualTo sptcount, name.Value))) let FSAsyncTests = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let altcover = @@ -3115,7 +3117,7 @@ module Targets = Assert.That(tmrcount, Is.EqualTo visited, name.Value)))) let FSharpTypesDotNetRunner = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let altcover = @@ -3185,7 +3187,7 @@ module Targets = Actions.ValidateFSharpTypesCoverage simpleReport) let FSharpTypesDotNetCollecter = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" System.IO.Directory.GetDirectories("./_Reports", "unzi*") @@ -3292,21 +3294,21 @@ module Targets = Actions.ValidateFSharpTypesCoverage simpleReport2) let BasicCSharp = - (fun _ -> + (fun () -> Actions.SimpleInstrumentingRun "_Binaries/Sample1/Debug+AnyCPU/net20" "_Binaries/AltCover/Release+AnyCPU/net472" "BasicCSharp") let BasicCSharpMono = - (fun _ -> + (fun () -> Actions.SimpleInstrumentingRun "_Mono/Sample1" "_Binaries/AltCover/Release+AnyCPU/net472" "BasicCSharpMono") let BasicCSharpUnderMono = - (fun _ -> + (fun () -> monoOnWindows |> Actions.SimpleInstrumentingRunUnderMono "_Binaries/Sample1/Debug+AnyCPU/net20" @@ -3314,7 +3316,7 @@ module Targets = "BasicCSharpUnderMono") let BasicCSharpMonoUnderMono = - (fun _ -> + (fun () -> monoOnWindows |> Actions.SimpleInstrumentingRunUnderMono "_Mono/Sample1" @@ -3322,7 +3324,7 @@ module Targets = "BasicCSharpMono") let CSharpMonoWithDotNet = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let x = @@ -3362,7 +3364,7 @@ module Targets = "CSharpMonoWithDotNet") let CSharpDotNetWithDotNet = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let x = @@ -3404,7 +3406,7 @@ module Targets = "CSharpDotNetWithDotNet") let CSharpDotNetWithFramework = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let simpleReport = @@ -3447,7 +3449,7 @@ module Targets = Actions.ValidateSample1 simpleReport "CSharpDotNetWithFramework") let RecordResumeTest = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let simpleReport = @@ -3513,7 +3515,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get("visitcount")).Value) + |> Seq.map _.Attribute(XName.Get("visitcount")).Value |> Seq.toList let expected = Array.create 20 "0" @@ -3554,7 +3556,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get("visitcount")).Value) + |> Seq.map _.Attribute(XName.Get("visitcount")).Value |> Seq.toList Assert.That( @@ -3572,7 +3574,7 @@ module Targets = Assert.That(hits, Is.LessThanOrEqualTo 8)) let RecordResumeTrackingTest = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let simpleReport = @@ -3641,7 +3643,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("SequencePoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList let expected = Array.create 20 "0" @@ -3682,7 +3684,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("SequencePoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList Assert.That( @@ -3706,7 +3708,7 @@ module Targets = Assert.That(tracked, Is.Not.Empty)) let RecordResumeTestDotNet = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let simpleReport = @@ -3774,7 +3776,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get("visitcount")).Value) + |> Seq.map _.Attribute(XName.Get("visitcount")).Value |> Seq.toList let expected = Array.create 20 "0" @@ -3815,7 +3817,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get("visitcount")).Value) + |> Seq.map _.Attribute(XName.Get("visitcount")).Value |> Seq.toList Assert.That( @@ -3835,7 +3837,7 @@ module Targets = // Packaging let Packaging = - (fun _ -> + (fun () -> let altCover = Path.getFullName "_Binaries/AltCover/Release+AnyCPU/net472/AltCover.exe" @@ -4304,7 +4306,7 @@ module Targets = //_Target "PrepareFrameworkBuild" ignore let PrepareDotNetBuild = - (fun _ -> + (fun () -> let netcoresource = Path.getFullName "./AltCover/AltCover.fsproj" @@ -4315,12 +4317,10 @@ module Targets = { options with OutputPath = Some publish Configuration = DotNet.BuildConfiguration.Release - MSBuildParams = - { options.MSBuildParams with - ConsoleLogParameters = [] - DistributedLoggers = None - DisableInternalBinLog = true - Properties = options.MSBuildParams.Properties } + Fake.DotNet.DotNet.PublishOptions.MSBuildParams.ConsoleLogParameters = [] + Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DistributedLoggers = None + Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DisableInternalBinLog = + true Framework = Some "netcoreapp2.0" }) netcoresource @@ -4329,12 +4329,10 @@ module Targets = { options with OutputPath = Some(publish + ".visualizer") Configuration = DotNet.BuildConfiguration.Release - MSBuildParams = - { options.MSBuildParams with - ConsoleLogParameters = [] - DistributedLoggers = None - DisableInternalBinLog = true - Properties = options.MSBuildParams.Properties } + Fake.DotNet.DotNet.PublishOptions.MSBuildParams.ConsoleLogParameters = [] + Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DistributedLoggers = None + Fake.DotNet.DotNet.PublishOptions.MSBuildParams.DisableInternalBinLog = + true Framework = Some "net5.0" }) (Path.getFullName "./AltCover.Avalonia/AltCover.Avalonia.fsproj") @@ -4381,7 +4379,7 @@ module Targets = XDocument.Load "./Build/AltCover.nuspec" dotnetNupkg.Descendants(x "readme") - |> Seq.iter (fun hint -> hint.SetValue readme) + |> Seq.iter _.SetValue(readme) let title = dotnetNupkg.Descendants(x "title") |> Seq.head @@ -4420,7 +4418,7 @@ module Targets = dotnetNupkg.Save path)) let PrepareReadMe = - (fun _ -> + (fun () -> let c = Copyright .Replace("©", "©") @@ -4440,7 +4438,7 @@ module Targets = //_Target "Deployment" ignore let Unpack = - (fun _ -> + (fun () -> !! "./_Pack*/*.nupkg" |> Seq.iter (fun nugget -> let packdir = Path.GetDirectoryName nugget @@ -4512,7 +4510,7 @@ module Targets = ("documenting " + n))) let WindowsPowerShell = - (fun _ -> + (fun () -> Directory.ensure "./_Documentation" let v = Version.Split([| '-' |]).[0] @@ -4537,7 +4535,7 @@ module Targets = |> (Actions.AssertResult "powershell")) let Pester = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -4655,7 +4653,7 @@ module Targets = |> printfn "%s") let SimpleReleaseTest = - (fun _ -> + (fun () -> let unpack = match NuGetAltCover with | Some test -> @@ -4669,7 +4667,7 @@ module Targets = "SimpleReleaseTest") let SimpleZipReleaseTest = - (fun _ -> + (fun () -> let binaryPath = match NuGetAltCover with | Some test -> @@ -4739,7 +4737,7 @@ module Targets = reportSigil) let SimpleMonoReleaseTest = - (fun _ -> + (fun () -> let unpack = match NuGetAltCover with | Some test -> @@ -4750,7 +4748,7 @@ module Targets = Actions.SimpleInstrumentingRun "_Mono/Sample1" unpack "SimpleMonoReleaseTest") let ReleaseDotNetWithFramework = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -4802,7 +4800,7 @@ module Targets = "ReleaseDotNetWithFramework") let ReleaseMonoWithDotNet = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -4841,7 +4839,7 @@ module Targets = "ReleaseMonoWithDotNet") let ReleaseDotNetWithDotNet = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -4885,7 +4883,7 @@ module Targets = "ReleaseDotNetWithDotNet") let ReleaseFSharpTypesDotNetRunner = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -4961,7 +4959,7 @@ module Targets = Actions.ValidateFSharpTypesCoverage x) let ReleaseFSharpTypesX86DotNetRunner = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -5067,7 +5065,7 @@ module Targets = Environment.SetEnvironmentVariable("platform", "")) let ReleaseXUnitFSharpTypesDotNetRunner = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -5139,7 +5137,7 @@ module Targets = Actions.ValidateFSharpTypesCoverage x) let OpenCoverForPester = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let reportDir = @@ -5258,7 +5256,7 @@ module Targets = Shell.copyFile binary2Target binary2) let ReleaseXUnitFSharpTypesShowVisualized = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -5325,7 +5323,7 @@ module Targets = let vcs = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get "visitcount").Value |> int) + |> Seq.map (_.Attribute(XName.Get "visitcount").Value >> int) |> Seq.groupBy id |> Seq.sortBy fst |> Seq.toList @@ -5383,7 +5381,7 @@ module Targets = let vcs = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get "visitcount").Value |> int) + |> Seq.map (_.Attribute(XName.Get "visitcount").Value >> int) |> Seq.groupBy id |> Seq.sortBy fst |> Seq.toList @@ -5432,7 +5430,7 @@ module Targets = let vcs = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get "visitcount").Value |> int) + |> Seq.map (_.Attribute(XName.Get "visitcount").Value >> int) |> Seq.groupBy id |> Seq.sortBy fst |> Seq.toList @@ -5514,7 +5512,7 @@ module Targets = let vcs = coverageDocument.Descendants(XName.Get("seqpnt")) - |> Seq.map (fun x -> x.Attribute(XName.Get "visitcount").Value |> int) + |> Seq.map (_.Attribute(XName.Get "visitcount").Value >> int) |> Seq.groupBy id |> Seq.sortBy fst |> Seq.toList @@ -5530,7 +5528,7 @@ module Targets = )) let ReleaseXUnitFSharpTypesDotNetFullRunner = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let unpack = @@ -5602,7 +5600,7 @@ module Targets = Actions.CheckSample4Visits before x) let JsonReporting = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let runner = @@ -5655,9 +5653,9 @@ module Targets = let recorded = coverageDocument.Values - |> Seq.collect (fun d -> d.Values) - |> Seq.collect (fun c -> c.Values) - |> Seq.collect (fun m -> m.Keys) + |> Seq.collect _.Values + |> Seq.collect _.Values + |> Seq.collect _.Keys |> Seq.sort |> Seq.toList @@ -5722,11 +5720,11 @@ module Targets = let recorded = coverageDocument.Values - |> Seq.collect (fun d -> d.Values) - |> Seq.collect (fun c -> c.Values) - |> Seq.collect (fun m -> m.Values) - |> Seq.collect (fun m -> m.SeqPnts) - |> Seq.map (fun s -> s.VC) + |> Seq.collect _.Values + |> Seq.collect _.Values + |> Seq.collect _.Values + |> Seq.collect _.SeqPnts + |> Seq.map _.VC |> Seq.toList let expected = @@ -5744,14 +5742,14 @@ module Targets = let methods = coverageDocument.Values - |> Seq.collect (fun d -> d.Values) - |> Seq.collect (fun c -> c.Values) + |> Seq.collect _.Values + |> Seq.collect _.Values |> Seq.collect id |> Seq.toList let trackedFormat = methods - |> List.filter (fun m -> m.Value.TId.HasValue) + |> List.filter _.Value.TId.HasValue |> List.map (fun m -> m.Key, m.Value.TId.Value) |> List.sortBy snd |> List.map (sprintf "%A") @@ -5765,7 +5763,7 @@ module Targets = //let trackedTimes = methods - |> List.filter (fun m -> m.Value.TId.HasValue) + |> List.filter _.Value.TId.HasValue // |> List.collect (fun m -> let first = m.Value.Entry |> List.iter (fun m -> let first = @@ -5793,14 +5791,13 @@ module Targets = let trackedVisits = coverageDocument.Values - |> Seq.collect (fun d -> d.Values) - |> Seq.collect (fun c -> c.Values) - |> Seq.collect (fun m -> m.Values) - |> Seq.collect (fun m -> m.SeqPnts) - |> Seq.filter (fun s -> s.Tracks |> isNull |> not) - |> Seq.collect (fun s -> s.Tracks) - |> Seq.map (fun i -> - i.ToString(System.Globalization.CultureInfo.InvariantCulture)) + |> Seq.collect _.Values + |> Seq.collect _.Values + |> Seq.collect _.Values + |> Seq.collect _.SeqPnts + |> Seq.filter (_.Tracks >> isNull >> not) + |> Seq.collect _.Tracks + |> Seq.map _.ToString(System.Globalization.CultureInfo.InvariantCulture) |> Seq.toList Assert.That( @@ -5820,7 +5817,7 @@ module Targets = checkSample4Visits before x) let MSBuildTest = - (fun _ -> + (fun () -> Directory.ensure "./_Reports" let build = Path.getFullName "Build" @@ -5842,16 +5839,14 @@ module Targets = { dotnetOptions o' with WorkingDirectory = sample }) - let mparams = - { tmp.MSBuildParams with - ConsoleLogParameters = [] - DistributedLoggers = None - DisableInternalBinLog = true - Properties = - ("AltCoverTag", "MSBuildTest_") - :: tmp.MSBuildParams.Properties } - - { tmp with MSBuildParams = mparams }) + { tmp with + Fake.DotNet.DotNet.MSBuildOptions.MSBuildParams.ConsoleLogParameters = [] + Fake.DotNet.DotNet.MSBuildOptions.MSBuildParams.DistributedLoggers = None + Fake.DotNet.DotNet.MSBuildOptions.MSBuildParams.DisableInternalBinLog = + true + Fake.DotNet.DotNet.MSBuildOptions.MSBuildParams.Properties = + ("AltCoverTag", "MSBuildTest_") + :: tmp.MSBuildParams.Properties }) (build @@ "msbuildtest.proj") printfn "Checking samples4 output" @@ -5882,7 +5877,7 @@ module Targets = "./Samples/Sample4/Sample4LongForm.fsproj") let Cake2Test = - (fun _ -> + (fun () -> let before = Actions.ticksNow () try @@ -6030,7 +6025,7 @@ module Targets = Actions.CleanDir folder)) let ApiUse = - (fun _ -> + (fun () -> let before = Actions.ticksNow () try @@ -6183,7 +6178,7 @@ module Targets = Actions.CleanDir folder)) let DotnetTestIntegration = - (fun _ -> + (fun () -> let assertFile f = Assert.That(File.Exists f, f) let assertCopied p = @@ -6504,7 +6499,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("SequencePoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList Assert.That( @@ -6553,7 +6548,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("SequencePoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList Assert.That( @@ -6632,7 +6627,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("SequencePoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList Assert.That( @@ -6680,7 +6675,7 @@ module Targets = let recorded = coverageDocument.Descendants(XName.Get("SequencePoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList Assert.That( @@ -7014,7 +7009,7 @@ module Targets = Actions.CleanDir folder) let Issue20 = - (fun _ -> // plus added verbosity testing + (fun () -> // plus added verbosity testing try let config = XDocument.Load "./Build/NuGet.config.dotnettest" @@ -7154,8 +7149,13 @@ module Targets = Shell.mkdir folder Actions.CleanDir folder) + let debugNoBuildIn dir (o: Fake.DotNet.DotNet.TestOptions) = + { o.WithCommon(withWorkingDirectoryVM dir) with + Configuration = DotNet.BuildConfiguration.Debug + NoBuild = false } + let Issue23 = - (fun _ -> + (fun () -> try Directory.ensure "./_Issue23" Shell.cleanDir ("./_Issue23") @@ -7212,9 +7212,7 @@ module Targets = DotNet.test (fun p -> - (({ p.WithCommon(withWorkingDirectoryVM "_Issue23") with - Configuration = DotNet.BuildConfiguration.Debug - NoBuild = false }) + ((p |> debugNoBuildIn "_Issue23") .WithAltCoverOptions pp0 cc0 @@ -7231,7 +7229,7 @@ module Targets = Actions.CleanDir folder) let Issue67 = - (fun _ -> + (fun () -> try Directory.ensure "./_Issue67" // escaping the | in a regex by doubling Shell.cleanDir ("./_Issue67") @@ -7294,9 +7292,7 @@ module Targets = DotNet.test (fun p -> - (({ p.WithCommon(withWorkingDirectoryVM "_Issue67") with - Configuration = DotNet.BuildConfiguration.Debug - NoBuild = false }) + ((p |> debugNoBuildIn "_Issue67") .WithAltCoverOptions pp0 cc0 @@ -7311,7 +7307,7 @@ module Targets = let passed = cover.Descendants(XName.Get("Module")) - |> Seq.filter (fun x -> x.Attribute(XName.Get("skippedDueTo")) |> isNull) + |> Seq.filter (_.Attribute(XName.Get("skippedDueTo")) >> isNull) |> Seq.length Assert.That(passed, Is.EqualTo 2) @@ -7323,7 +7319,7 @@ module Targets = Actions.CleanDir folder) let Issue72 = - (fun _ -> // Confusing switch case coverage @ https://github.com/SteveGilham/altcover/issues/72 + (fun () -> // Confusing switch case coverage @ https://github.com/SteveGilham/altcover/issues/72 try Directory.ensure "./Samples/Sample16/Test/_Issue72" Shell.cleanDir ("./Samples/Sample16/Test/_Issue72") @@ -7391,9 +7387,8 @@ module Targets = DotNet.test (fun p -> - (({ p.WithCommon(withWorkingDirectoryVM "./Samples/Sample16/Test/_Issue72") with - Configuration = DotNet.BuildConfiguration.Debug - NoBuild = false }) + ((p + |> debugNoBuildIn "./Samples/Sample16/Test/_Issue72") .WithAltCoverOptions pp0 cc0 @@ -7421,7 +7416,7 @@ module Targets = let found = coverageDocument.Descendants(XName.Get("BranchPoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList test @@ -7461,9 +7456,8 @@ module Targets = DotNet.test (fun p -> - (({ p.WithCommon(withWorkingDirectoryVM "./Samples/Sample16/Test/_Issue72") with - Configuration = DotNet.BuildConfiguration.Debug - NoBuild = false }) + ((p + |> debugNoBuildIn "./Samples/Sample16/Test/_Issue72") .WithAltCoverOptions pp1 cc0 @@ -7491,7 +7485,7 @@ module Targets = let found = coverageDocument.Descendants(XName.Get("BranchPoint")) - |> Seq.map (fun x -> x.Attribute(XName.Get("vc")).Value) + |> Seq.map _.Attribute(XName.Get("vc")).Value |> Seq.toList test @@ -7523,9 +7517,7 @@ module Targets = DotNet.test (fun p -> - (({ p.WithCommon(withWorkingDirectoryVM "./Samples/Sample16/Test") with - Configuration = DotNet.BuildConfiguration.Debug - NoBuild = false }) + ((p |> debugNoBuildIn "./Samples/Sample16/Test") .WithAltCoverOptions psln cc0 @@ -7546,7 +7538,7 @@ module Targets = Actions.CleanDir folder) let DotnetGlobalIntegration = - (fun _ -> + (fun () -> let working = Path.getFullName "./_DotnetGlobalTest" @@ -7696,7 +7688,7 @@ module Targets = Actions.CleanDir folder) let Issue114 = - (fun _ -> + (fun () -> try Directory.ensure "./_Issue114" Shell.cleanDir ("./_Issue114") @@ -7759,9 +7751,7 @@ module Targets = DotNet.test (fun p -> - (({ p.WithCommon(withWorkingDirectoryVM "_Issue114") with - Configuration = DotNet.BuildConfiguration.Debug - NoBuild = false }) + ((p |> debugNoBuildIn "_Issue114") .WithAltCoverOptions pp0 cc0 @@ -7778,7 +7768,7 @@ module Targets = Actions.CleanDir folder) let Issue156 = - (fun _ -> + (fun () -> try Directory.ensure "./_Issue156" Shell.cleanDir ("./_Issue156") @@ -7855,9 +7845,7 @@ module Targets = DotNet.test (fun p -> - (({ p.WithCommon(withWorkingDirectoryVM "_Issue156/Tests") with - Configuration = DotNet.BuildConfiguration.Debug - NoBuild = false }) + ((p |> debugNoBuildIn "_Issue156/Tests") .WithAltCoverOptions pp0 cc0 @@ -7874,7 +7862,7 @@ module Targets = // AOB let MakeDocumentation = - (fun _ -> + (fun () -> let branch = Information.getBranchName (".") Assert.That(branch, Is.EqualTo("master").Or.StartWith("develop/docs/"), branch) @@ -7887,7 +7875,7 @@ module Targets = |> (Actions.AssertResult "powershell")) let BulkReport = - (fun _ -> + (fun () -> printfn "Overall coverage reporting" // coverageSummary () @@ -7925,9 +7913,10 @@ module Targets = let files = !!(@"./**/*.xml") - |> Seq.filter (fun f -> - f.StartsWith(packages, StringComparison.Ordinal) - |> not) + |> Seq.filter ( + _.StartsWith(packages, StringComparison.Ordinal) + >> not + ) |> Seq.toList let xml = @@ -8003,7 +7992,7 @@ module Targets = true) |> List.map fst - Assert.That(coberturaFiles, Is.EquivalentTo [], "coberturaFiles") + Assert.That(coberturaFiles, Is.EquivalentTo List.empty, "coberturaFiles") let cobertura2Files = xml @@ -8078,12 +8067,12 @@ module Targets = "AltCover.Tests/OpenCoverWithEmbeds.xml" "AltCover.Tests/OpenCoverWithPartials.xml" "AltCover.Tests/Sample4FullTracking.xml" - "_Reports\AltCoverAsyncAwaitTests.xml" - "RegressionTesting\issue37\coverage.xml" - "Samples\Sample16\Test\_Issue72\combined.Test.xml" - "Samples\Sample16\Test\_Issue72\original.Test.xml" - "Samples\Sample16\Test\_Reports\solution.Test.xml" - "Samples\Sample16\Test\_Reports\solution.Test2.xml" + "_Reports/AltCoverAsyncAwaitTests.xml" + "RegressionTesting/issue37/coverage.xml" + "Samples/Sample16/Test/_Issue72/combined.Test.xml" + "Samples/Sample16/Test/_Issue72/original.Test.xml" + "Samples/Sample16/Test/_Reports/solution.Test.xml" + "Samples/Sample16/Test/_Reports/solution.Test2.xml" // coverlet "AltCover.Api.Tests/OpenCoverForPester.coverlet.xml" "AltCover.Tests/OpenCoverForPester.coverlet.expected.xml" @@ -8137,7 +8126,7 @@ module Targets = //_Target "All" ignore let CppInline = - (fun _ -> + (fun () -> if Environment.isWindows then Directory.ensure "./_Reports/CppInline" msbuildDebug None "./Samples/Sample29/SimpleMix.sln" @@ -8168,7 +8157,7 @@ module Targets = // AOB let All = - (fun _ -> + (fun () -> if Environment.isWindows && currentBranch.StartsWith "release/" @@ -8285,7 +8274,8 @@ module Targets = _Target "Issue114" Issue114 _Target "Issue156" Issue156 _Target "MakeDocumentation" MakeDocumentation - _Target "BulkReport" (if Environment.isWindows then BulkReport else ignore) + _Target "BulkReport" BulkReport + _Target "All" All _Target "CppInline" CppInline _Target "None" ignore @@ -8536,9 +8526,9 @@ module Targets = ==> "Deployment" // test is duplicated in the Pester testing |> ignore - "Unpack" ==> "ReleaseFSharpTypesX86DotNetRunner" - =?> ("Deployment", Option.isSome dotnetPath86) - |> ignore + //"Unpack" ==> "ReleaseFSharpTypesX86DotNetRunner" + //=?> ("Deployment", Option.isSome dotnetPath86) + //|> ignore "Unpack" ==> "ReleaseXUnitFSharpTypesShowVisualized" diff --git a/Demo/Service/Service/Program.fs b/Demo/Service/Service/Program.fs index 3c6880c9a..5cadbf4aa 100644 --- a/Demo/Service/Service/Program.fs +++ b/Demo/Service/Service/Program.fs @@ -71,6 +71,7 @@ type Service() as this = async { let interval = TimeSpan(0, 0, 5) + // [] let rec loop () = if this.waiter.WaitOne(interval) then Debug.WriteLine "Service exiting" diff --git a/Directory.Packages.props b/Directory.Packages.props index dd35d69a1..1b5c53e2f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,14 +3,14 @@ - - - - - - - - + + + + + + + + @@ -40,20 +40,20 @@ - - + + - - + + - - + + @@ -62,8 +62,8 @@ - - + + @@ -75,18 +75,19 @@ - - + + + - + - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/OutputBuildProps.props b/OutputBuildProps.props index 21bb2d75e..569c6d5cf 100644 --- a/OutputBuildProps.props +++ b/OutputBuildProps.props @@ -13,7 +13,7 @@ $(MSBuildThisFileDirectory)Build\ $(KeyDir)Infrastructure.snk $(OutputPath)\$(TargetFramework)\$(MSBuildProjectName).xml - --keyfile:$(InfrastructureKey) + --keyfile:$(InfrastructureKey) --strict-indentation+ Major false true @@ -23,6 +23,7 @@ $(InfrastructureKey) false false + FS3559;FS3560 diff --git a/RegressionTesting/SoakTest1/Program.fs b/RegressionTesting/SoakTest1/Program.fs index 552a5a796..29ff9de75 100644 --- a/RegressionTesting/SoakTest1/Program.fs +++ b/RegressionTesting/SoakTest1/Program.fs @@ -42,6 +42,7 @@ module ThreadLevel = let internal push x = CallTrack.Push x let internal pop () = CallTrack.Pop() + // [] let rec stack1 i = let here = Thread.CurrentThread.GetHashCode() @@ -100,6 +101,7 @@ module AsyncLevel = let internal push x = CallTrack.Push x let internal pop () = CallTrack.Pop() + // [] let rec stack1 i = let here = Thread.CurrentThread.GetHashCode() diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 4c60c9276..3e3e8294d 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -3,10 +3,13 @@ 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 24) +# (Habu series release 25) +* [BUGFIX] Issue 197 : Update `[InternalsVisibleTo]` references during instrumentation. Finally fixing an issue that's been there since 2010! + +# 8.6.95 (Habu series release 24) * Built with and supports net8.0 release * Other dependency updates. -* Minor housekeeping chnages, but no actual new features. +* Minor housekeeping changes, but no actual new features. # 8.6.68 (Habu series release 23) * Omit anonymous types from coverage, in the same way as other compiler generated code (auto-properties, equality and related operations on F# distributed unions, etc.) diff --git a/Samples/Sample2/Sample2.fs b/Samples/Sample2/Sample2.fs index 75fc8a7f8..2fac6ba41 100644 --- a/Samples/Sample2/Sample2.fs +++ b/Samples/Sample2/Sample2.fs @@ -61,4 +61,7 @@ module DU = module Program = [] let main _ = 0 -#endif \ No newline at end of file +#endif + +[] +() \ No newline at end of file diff --git a/Samples/Sample2/Sample2.fsproj b/Samples/Sample2/Sample2.fsproj index aca12b892..194db6f9d 100644 --- a/Samples/Sample2/Sample2.fsproj +++ b/Samples/Sample2/Sample2.fsproj @@ -18,7 +18,8 @@ - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Samples/Sample21/Sample21.csproj b/Samples/Sample21/Sample21.csproj index 0528578db..02cf91579 100644 --- a/Samples/Sample21/Sample21.csproj +++ b/Samples/Sample21/Sample21.csproj @@ -8,7 +8,8 @@ - + + diff --git a/Samples/Sample22/UnitTest1.fs b/Samples/Sample22/UnitTest1.fs index be6c4c581..d90135a3f 100644 --- a/Samples/Sample22/UnitTest1.fs +++ b/Samples/Sample22/UnitTest1.fs @@ -7,6 +7,7 @@ open Tests [] let Setup () = () +[] let rec RecursiveValidateOpenCover result expected' depth zero expectSkipped = let x name = XName.Get(name) let rcount = result |> Seq.length diff --git a/Samples/Sample23/Sample23.csproj b/Samples/Sample23/Sample23.csproj index 6d3cdbb20..9571c4904 100644 --- a/Samples/Sample23/Sample23.csproj +++ b/Samples/Sample23/Sample23.csproj @@ -10,7 +10,8 @@ - + + diff --git a/Samples/Sample24/Sample24.csproj b/Samples/Sample24/Sample24.csproj index ef16e9713..1fe5cc7d7 100644 --- a/Samples/Sample24/Sample24.csproj +++ b/Samples/Sample24/Sample24.csproj @@ -15,7 +15,8 @@ - + + diff --git a/Samples/Sample24/UnitTest1.cs b/Samples/Sample24/UnitTest1.cs index 0e515d3bc..8151634ba 100644 --- a/Samples/Sample24/UnitTest1.cs +++ b/Samples/Sample24/UnitTest1.cs @@ -15,7 +15,7 @@ public void Setup() public async Task AddAsync_Returns_The_Sum_Of_X_And_Y() { int result = await AddAsync(1, 1); - Assert.AreEqual(AddSynch(1, 1), result); + Assert.That(AddSynch(1, 1), Is.EqualTo(result)); } public async Task AddAsync(int x, int y) diff --git a/Samples/Sample25/Sample25.fsproj b/Samples/Sample25/Sample25.fsproj index e12b1ed3f..70a39c504 100644 --- a/Samples/Sample25/Sample25.fsproj +++ b/Samples/Sample25/Sample25.fsproj @@ -4,6 +4,7 @@ net20 Sample25 Sample25 + --keyfile:$(InfrastructureKey) diff --git a/Samples/Sample4/Sample4LongForm.fsproj b/Samples/Sample4/Sample4LongForm.fsproj index 2ac226a0d..9524c68fc 100644 --- a/Samples/Sample4/Sample4LongForm.fsproj +++ b/Samples/Sample4/Sample4LongForm.fsproj @@ -8,6 +8,7 @@ 3 $(BuildDependsOn);AfterBuildMigrated $(BuildDir)$(ProjectBuildDirectoryName)/legacy + --keyfile:$(InfrastructureKey) diff --git a/Samples/Sample6/Library1.fs b/Samples/Sample6/Library1.fs index e47236167..fb2acf498 100644 --- a/Samples/Sample6/Library1.fs +++ b/Samples/Sample6/Library1.fs @@ -9,7 +9,7 @@ module Module = let aux i = i + 1 let FI li = - let rec FII lii acc = + let (* []*) rec FII lii acc = match lii with | [] -> acc | x :: xs -> FII xs (aux acc) diff --git a/Samples/Sample7/Sample7.fsproj b/Samples/Sample7/Sample7.fsproj index f3564be99..d51caeda3 100644 --- a/Samples/Sample7/Sample7.fsproj +++ b/Samples/Sample7/Sample7.fsproj @@ -12,7 +12,7 @@ - + all diff --git a/ThirdParty/BlackFox.CommandLine.dll b/ThirdParty/BlackFox.CommandLine.dll index b39a13f94..d4a9855a4 100644 Binary files a/ThirdParty/BlackFox.CommandLine.dll and b/ThirdParty/BlackFox.CommandLine.dll differ diff --git a/docs/AltCover.DotNet/AltCover.DotNet-apidoc.md b/docs/AltCover.DotNet/AltCover.DotNet-apidoc.md index b755d301e..415a20dd6 100644 --- a/docs/AltCover.DotNet/AltCover.DotNet-apidoc.md +++ b/docs/AltCover.DotNet/AltCover.DotNet-apidoc.md @@ -5,6 +5,6 @@ | public type | description | | --- | --- | | static class [DotNet](./AltCover/DotNet-apidoc) | Construction of `dotnet test` command line options. | -| static class [Options](./AltCover/Options-apidoc) | Containst concrete `...Options` implementations | +| static class [Options](./AltCover/Options-apidoc) | Contains concrete `...Options` implementations | diff --git a/docs/AltCover.DotNet/DotNet-fsapidoc.md b/docs/AltCover.DotNet/DotNet-fsapidoc.md index d587c6b23..a948b56fc 100644 --- a/docs/AltCover.DotNet/DotNet-fsapidoc.md +++ b/docs/AltCover.DotNet/DotNet-fsapidoc.md @@ -10,11 +10,9 @@ namespace AltCover [] module DotNet = begin type ICLIOptions = - interface abstract member ForceDelete : bool with get abstract member FailFast : bool with get abstract member ShowSummary : System.String with get - end [] type CLIOptions = diff --git a/docs/AltCover.Engine/Abstract-fsapidoc.md b/docs/AltCover.Engine/Abstract-fsapidoc.md index 53bc278ec..4a5dbdd4d 100644 --- a/docs/AltCover.Engine/Abstract-fsapidoc.md +++ b/docs/AltCover.Engine/Abstract-fsapidoc.md @@ -28,7 +28,6 @@ The members correspond to the like-named command line options for `AltCover Runn ``` type ICollectOptions = - interface abstract member RecorderDirectory : String with get abstract member WorkingDirectory : String with get abstract member Executable : String with get @@ -40,7 +39,6 @@ The members correspond to the like-named command line options for `AltCover Runn abstract member ExposeReturnCode : bool with get abstract member SummaryFormat : String with get abstract member Verbosity : System.Diagnostics.TraceLevel with get - end ``` ### interface `IPrepareOptions` @@ -51,7 +49,6 @@ The members correspond to the like-named command line options for `AltCover`, ex ``` type IPrepareOptions = - interface abstract member InputDirectories : IEnumerable with get abstract member OutputDirectories : IEnumerable with get abstract member SymbolDirectories : IEnumerable with get @@ -88,7 +85,6 @@ The members correspond to the like-named command line options for `AltCover`, ex abstract member ShowGenerated : bool with get abstract member Verbosity : System.Diagnostics.TraceLevel with get abstract member Trivia : bool with get - end ``` ### interface `ILoggingOptions` @@ -98,11 +94,9 @@ command line and usage warninings only. ``` type ILoggingOptions = - interface abstract member Info : Action with get abstract member Warn : Action with get abstract member Failure : Action with get abstract member Echo : Action with get abstract member Verbose : Action with get - end diff --git a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions-apidoc.md index 708ae21d1..a94946946 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions-apidoc.md @@ -25,11 +25,11 @@ public abstract class PrepareOptions : IEquatable, IStructuralEq | [ExposeReturnCode](AltCover.PrepareOptions/ExposeReturnCode-apidoc) { get; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [FileFilter](AltCover.PrepareOptions/FileFilter-apidoc) { get; } | Corresponds to command line option `-f, --fileFilter=VALUE` | | [InPlace](AltCover.PrepareOptions/InPlace-apidoc) { get; } | Corresponds to command line option `--inplace` | -| [InputDirectories](AltCover.PrepareOptions/InputDirectories-apidoc) { get; } | Corresponds to command line option ` -i, --inputDirectory=VALUE` | -| [Keys](AltCover.PrepareOptions/Keys-apidoc) { get; } | Corresponds to command line option ` -k, --key=VALUE` | +| [InputDirectories](AltCover.PrepareOptions/InputDirectories-apidoc) { get; } | Corresponds to command line option `-i, --inputDirectory=VALUE` | +| [Keys](AltCover.PrepareOptions/Keys-apidoc) { get; } | Corresponds to command line option `-k, --key=VALUE` | | [LineCover](AltCover.PrepareOptions/LineCover-apidoc) { get; } | Corresponds to command line option `--linecover` | | [LocalSource](AltCover.PrepareOptions/LocalSource-apidoc) { get; } | Corresponds to command line option `-l, --localSource` | -| [MethodFilter](AltCover.PrepareOptions/MethodFilter-apidoc) { get; } | Corresponds to command line option ` -m, --methodFilter=VALUE` | +| [MethodFilter](AltCover.PrepareOptions/MethodFilter-apidoc) { get; } | Corresponds to command line option `-m, --methodFilter=VALUE` | | [MethodPoint](AltCover.PrepareOptions/MethodPoint-apidoc) { get; } | Corresponds to command line option `--methodpoint` | | [MethodTopLevel](AltCover.PrepareOptions/MethodTopLevel-apidoc) { get; } | Corresponds to command line option `--methodtoplevel=VALUE` | | [OutputDirectories](AltCover.PrepareOptions/OutputDirectories-apidoc) { get; } | Corresponds to command line option `-o, --outputDirectory=VALUE` | @@ -37,17 +37,17 @@ public abstract class PrepareOptions : IEquatable, IStructuralEq | [Report](AltCover.PrepareOptions/Report-apidoc) { get; } | Corresponds to command line option `-r, --report=VALUE` | | [ReportFormat](AltCover.PrepareOptions/ReportFormat-apidoc) { get; } | Corresponds to command line option `--reportFormat=VALUE` | | [Save](AltCover.PrepareOptions/Save-apidoc) { get; } | Corresponds to command line option `--save` | -| [ShowGenerated](AltCover.PrepareOptions/ShowGenerated-apidoc) { get; } | Corresponds to command line option ` --showGenerated` | +| [ShowGenerated](AltCover.PrepareOptions/ShowGenerated-apidoc) { get; } | Corresponds to command line option `--showGenerated` | | [ShowStatic](AltCover.PrepareOptions/ShowStatic-apidoc) { get; } | Corresponds to command line option `--showstatic[=VALUE]` | | [SingleVisit](AltCover.PrepareOptions/SingleVisit-apidoc) { get; } | Corresponds to command line option `--single` | | [SourceLink](AltCover.PrepareOptions/SourceLink-apidoc) { get; } | Corresponds to command line option `--sourcelink` | | [StrongNameKey](AltCover.PrepareOptions/StrongNameKey-apidoc) { get; } | Corresponds to command line option `--sn, --strongNameKey=VALUE` | | [SymbolDirectories](AltCover.PrepareOptions/SymbolDirectories-apidoc) { get; } | Corresponds to command line option `-y, --symbolDirectory=VALUE` | -| [Trivia](AltCover.PrepareOptions/Trivia-apidoc) { get; } | Corresponds to command line option ` --trivia` | +| [Trivia](AltCover.PrepareOptions/Trivia-apidoc) { get; } | Corresponds to command line option `--trivia` | | [TypeFilter](AltCover.PrepareOptions/TypeFilter-apidoc) { get; } | Corresponds to command line option `-t, --typeFilter=VALUE` | | [TypeTopLevel](AltCover.PrepareOptions/TypeTopLevel-apidoc) { get; } | Corresponds to command line option `--typetoplevel=VALUE` | | [Verbosity](AltCover.PrepareOptions/Verbosity-apidoc) { get; } | Corresponds to command line options `-q` and `--verbose` | -| [VisibleBranches](AltCover.PrepareOptions/VisibleBranches-apidoc) { get; } | Corresponds to command line option ` -v, --visibleBranches` | +| [VisibleBranches](AltCover.PrepareOptions/VisibleBranches-apidoc) { get; } | Corresponds to command line option `-v, --visibleBranches` | | [ZipFile](AltCover.PrepareOptions/ZipFile-apidoc) { get; } | Corresponds to command line option `--zipfile` | | [Validate](AltCover.PrepareOptions/Validate-apidoc)() | Does simple checking of the arguments without causing any changes to the system | | class [Abstract](AltCover.PrepareOptions.Abstract-apidoc) | Options expressed as an interface | diff --git a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/InputDirectories-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/InputDirectories-apidoc.md index 02487114d..3146a2ec5 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/InputDirectories-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/InputDirectories-apidoc.md @@ -1,6 +1,6 @@ # AltCover.PrepareOptions.InputDirectories property -Corresponds to command line option ` -i, --inputDirectory=VALUE` +Corresponds to command line option `-i, --inputDirectory=VALUE` ```csharp public FSharpList InputDirectories { get; } diff --git a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Keys-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Keys-apidoc.md index fa1628ee0..c47cbf338 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Keys-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Keys-apidoc.md @@ -1,6 +1,6 @@ # AltCover.PrepareOptions.Keys property -Corresponds to command line option ` -k, --key=VALUE` +Corresponds to command line option `-k, --key=VALUE` ```csharp public FSharpList Keys { get; } diff --git a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/MethodFilter-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/MethodFilter-apidoc.md index 10dde8188..b8f5aeb49 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/MethodFilter-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/MethodFilter-apidoc.md @@ -1,6 +1,6 @@ # AltCover.PrepareOptions.MethodFilter property -Corresponds to command line option ` -m, --methodFilter=VALUE` +Corresponds to command line option `-m, --methodFilter=VALUE` ```csharp public FSharpList MethodFilter { get; } diff --git a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/ShowGenerated-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/ShowGenerated-apidoc.md index f325b2325..400fdc4c9 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/ShowGenerated-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/ShowGenerated-apidoc.md @@ -1,6 +1,6 @@ # AltCover.PrepareOptions.ShowGenerated property -Corresponds to command line option ` --showGenerated` +Corresponds to command line option `--showGenerated` ```csharp public bool ShowGenerated { get; } diff --git a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Trivia-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Trivia-apidoc.md index 847a3ef31..08960c5fb 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Trivia-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/Trivia-apidoc.md @@ -1,6 +1,6 @@ # AltCover.PrepareOptions.Trivia property -Corresponds to command line option ` --trivia` +Corresponds to command line option `--trivia` ```csharp public bool Trivia { get; } diff --git a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/VisibleBranches-apidoc.md b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/VisibleBranches-apidoc.md index 06523da6a..7e4ae82fa 100644 --- a/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/VisibleBranches-apidoc.md +++ b/docs/AltCover.Engine/AltCover/AltCover.PrepareOptions/VisibleBranches-apidoc.md @@ -1,6 +1,6 @@ # AltCover.PrepareOptions.VisibleBranches property -Corresponds to command line option ` -v, --visibleBranches` +Corresponds to command line option `-v, --visibleBranches` ```csharp public bool VisibleBranches { get; } diff --git a/docs/AltCover.Engine/AltCover/Collect-apidoc.md b/docs/AltCover.Engine/AltCover/Collect-apidoc.md index 33eb14213..254d8278f 100644 --- a/docs/AltCover.Engine/AltCover/Collect-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Collect-apidoc.md @@ -21,7 +21,7 @@ public class Collect : Task | [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]` | | [Threshold](Collect/Threshold-apidoc) { get; set; } | Corresponds to command line option `-t, --threshold=VALUE` | -| [Verbosity](Collect/Verbosity-apidoc) { get; set; } | Corresponds to command line options ` -q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) | +| [Verbosity](Collect/Verbosity-apidoc) { get; set; } | Corresponds to command line options `-q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) | | [WorkingDirectory](Collect/WorkingDirectory-apidoc) { get; set; } | Corresponds to command line option `-w, --workingDirectory=VALUE` | | override [Execute](Collect/Execute-apidoc)() | Perform the operation | diff --git a/docs/AltCover.Engine/AltCover/Collect/Verbosity-apidoc.md b/docs/AltCover.Engine/AltCover/Collect/Verbosity-apidoc.md index 6f8abe3cf..8e423c52a 100644 --- a/docs/AltCover.Engine/AltCover/Collect/Verbosity-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Collect/Verbosity-apidoc.md @@ -1,6 +1,6 @@ # Collect.Verbosity property -Corresponds to command line options ` -q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) +Corresponds to command line options `-q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) ```csharp public string Verbosity { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Echo-apidoc.md b/docs/AltCover.Engine/AltCover/Echo-apidoc.md index bc85bfd7e..01a2a3963 100644 --- a/docs/AltCover.Engine/AltCover/Echo-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Echo-apidoc.md @@ -13,7 +13,7 @@ public class Echo : Task | [Echo](Echo/Echo-apidoc)() | The default constructor | | [Colour](Echo/Colour-apidoc) { get; set; } | The name of the output colour, defaulting to current | | [Text](Echo/Text-apidoc) { get; set; } | The text to write, a required parameter | -| [Verbosity](Echo/Verbosity-apidoc) { get; set; } | Corresponds to command line option ` -q` (expects names of `System.Diagnostics.TraceLevel` values) | +| [Verbosity](Echo/Verbosity-apidoc) { get; set; } | Corresponds to command line option `-q` (expects names of `System.Diagnostics.TraceLevel` values) | | override [Execute](Echo/Execute-apidoc)() | Perform the operation | ## See Also diff --git a/docs/AltCover.Engine/AltCover/Echo/Verbosity-apidoc.md b/docs/AltCover.Engine/AltCover/Echo/Verbosity-apidoc.md index b67873a2d..9238ca0e5 100644 --- a/docs/AltCover.Engine/AltCover/Echo/Verbosity-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Echo/Verbosity-apidoc.md @@ -1,6 +1,6 @@ # Echo.Verbosity property -Corresponds to command line option ` -q` (expects names of `System.Diagnostics.TraceLevel` values) +Corresponds to command line option `-q` (expects names of `System.Diagnostics.TraceLevel` values) ```csharp public string Verbosity { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Prepare-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare-apidoc.md index d0cf92062..1b71ed310 100644 --- a/docs/AltCover.Engine/AltCover/Prepare-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare-apidoc.md @@ -23,11 +23,11 @@ public class Prepare : Task | [ExposeReturnCode](Prepare/ExposeReturnCode-apidoc) { get; set; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [FileFilter](Prepare/FileFilter-apidoc) { get; set; } | Corresponds to command line option `-f, --fileFilter=VALUE` | | [InPlace](Prepare/InPlace-apidoc) { get; set; } | Corresponds to command line option `--inplace` | -| [InputDirectories](Prepare/InputDirectories-apidoc) { get; set; } | Corresponds to command line option ` -i, --inputDirectory=VALUE` | -| [Keys](Prepare/Keys-apidoc) { get; set; } | Corresponds to command line option ` -k, --key=VALUE` | +| [InputDirectories](Prepare/InputDirectories-apidoc) { get; set; } | Corresponds to command line option `-i, --inputDirectory=VALUE` | +| [Keys](Prepare/Keys-apidoc) { get; set; } | Corresponds to command line option `-k, --key=VALUE` | | [LineCover](Prepare/LineCover-apidoc) { get; set; } | Corresponds to command line option `--linecover` | | [LocalSource](Prepare/LocalSource-apidoc) { get; set; } | Corresponds to command line option `-l, --localSource` | -| [MethodFilter](Prepare/MethodFilter-apidoc) { get; set; } | Corresponds to command line option ` -m, --methodFilter=VALUE` | +| [MethodFilter](Prepare/MethodFilter-apidoc) { get; set; } | Corresponds to command line option `-m, --methodFilter=VALUE` | | [MethodPoint](Prepare/MethodPoint-apidoc) { get; set; } | Corresponds to command line option `--methodpoint` | | [MethodTopLevel](Prepare/MethodTopLevel-apidoc) { get; set; } | Corresponds to command line option `--methodtoplevel=VALUE` | | [OutputDirectories](Prepare/OutputDirectories-apidoc) { get; set; } | Corresponds to command line option `-o, --outputDirectory=VALUE` | @@ -35,17 +35,17 @@ public class Prepare : Task | [Report](Prepare/Report-apidoc) { get; set; } | Corresponds to command line option `-r, --report=VALUE` | | [ReportFormat](Prepare/ReportFormat-apidoc) { get; set; } | Corresponds to command line option `--reportFormat=VALUE` | | [Save](Prepare/Save-apidoc) { get; set; } | Corresponds to command line option `--save` | -| [ShowGenerated](Prepare/ShowGenerated-apidoc) { get; set; } | Corresponds to command line option ` --showGenerated` | +| [ShowGenerated](Prepare/ShowGenerated-apidoc) { get; set; } | Corresponds to command line option `--showGenerated` | | [ShowStatic](Prepare/ShowStatic-apidoc) { get; set; } | Corresponds to command line option `--showstatic[=VALUE]` | | [SingleVisit](Prepare/SingleVisit-apidoc) { get; set; } | Corresponds to command line option `--single` | | [SourceLink](Prepare/SourceLink-apidoc) { get; set; } | Corresponds to command line option `--sourcelink` | | [StrongNameKey](Prepare/StrongNameKey-apidoc) { get; set; } | Corresponds to command line option `--sn, --strongNameKey=VALUE` | | [SymbolDirectories](Prepare/SymbolDirectories-apidoc) { get; set; } | Corresponds to command line option `-y, --symbolDirectory=VALUE` | -| [Trivia](Prepare/Trivia-apidoc) { get; set; } | Corresponds to command line option ` --trivia` | +| [Trivia](Prepare/Trivia-apidoc) { get; set; } | Corresponds to command line option `--trivia` | | [TypeFilter](Prepare/TypeFilter-apidoc) { get; set; } | Corresponds to command line option `-t, --typeFilter=VALUE` | | [TypeTopLevel](Prepare/TypeTopLevel-apidoc) { get; set; } | Corresponds to command line option `--typetoplevel=VALUE` | -| [Verbosity](Prepare/Verbosity-apidoc) { get; set; } | Corresponds to command line options ` -q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) | -| [VisibleBranches](Prepare/VisibleBranches-apidoc) { get; set; } | Corresponds to command line option ` -v, --visibleBranches` | +| [Verbosity](Prepare/Verbosity-apidoc) { get; set; } | Corresponds to command line options `-q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) | +| [VisibleBranches](Prepare/VisibleBranches-apidoc) { get; set; } | Corresponds to command line option `-v, --visibleBranches` | | [ZipFile](Prepare/ZipFile-apidoc) { get; set; } | Corresponds to command line option `--zipfile` | | override [Execute](Prepare/Execute-apidoc)() | Perform the operation | diff --git a/docs/AltCover.Engine/AltCover/Prepare/InputDirectories-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare/InputDirectories-apidoc.md index 1c45328f5..778d92e92 100644 --- a/docs/AltCover.Engine/AltCover/Prepare/InputDirectories-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare/InputDirectories-apidoc.md @@ -1,6 +1,6 @@ # Prepare.InputDirectories property -Corresponds to command line option ` -i, --inputDirectory=VALUE` +Corresponds to command line option `-i, --inputDirectory=VALUE` ```csharp public string[] InputDirectories { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Prepare/Keys-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare/Keys-apidoc.md index f6a0b332b..2880f6dac 100644 --- a/docs/AltCover.Engine/AltCover/Prepare/Keys-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare/Keys-apidoc.md @@ -1,6 +1,6 @@ # Prepare.Keys property -Corresponds to command line option ` -k, --key=VALUE` +Corresponds to command line option `-k, --key=VALUE` ```csharp public string[] Keys { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Prepare/MethodFilter-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare/MethodFilter-apidoc.md index 4441cbbb9..2abf3463a 100644 --- a/docs/AltCover.Engine/AltCover/Prepare/MethodFilter-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare/MethodFilter-apidoc.md @@ -1,6 +1,6 @@ # Prepare.MethodFilter property -Corresponds to command line option ` -m, --methodFilter=VALUE` +Corresponds to command line option `-m, --methodFilter=VALUE` ```csharp public string[] MethodFilter { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Prepare/ShowGenerated-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare/ShowGenerated-apidoc.md index 94f6bd6dd..a3db34b3c 100644 --- a/docs/AltCover.Engine/AltCover/Prepare/ShowGenerated-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare/ShowGenerated-apidoc.md @@ -1,6 +1,6 @@ # Prepare.ShowGenerated property -Corresponds to command line option ` --showGenerated` +Corresponds to command line option `--showGenerated` ```csharp public bool ShowGenerated { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Prepare/Trivia-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare/Trivia-apidoc.md index 57fab5bf6..91bf7f20e 100644 --- a/docs/AltCover.Engine/AltCover/Prepare/Trivia-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare/Trivia-apidoc.md @@ -1,6 +1,6 @@ # Prepare.Trivia property -Corresponds to command line option ` --trivia` +Corresponds to command line option `--trivia` ```csharp public bool Trivia { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Prepare/Verbosity-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare/Verbosity-apidoc.md index e98dd11b7..9b41dcd77 100644 --- a/docs/AltCover.Engine/AltCover/Prepare/Verbosity-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare/Verbosity-apidoc.md @@ -1,6 +1,6 @@ # Prepare.Verbosity property -Corresponds to command line options ` -q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) +Corresponds to command line options `-q` and `--verbose` (expects names of `System.Diagnostics.TraceLevel` values) ```csharp public string Verbosity { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Prepare/VisibleBranches-apidoc.md b/docs/AltCover.Engine/AltCover/Prepare/VisibleBranches-apidoc.md index a771ced31..18ed5f1cd 100644 --- a/docs/AltCover.Engine/AltCover/Prepare/VisibleBranches-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Prepare/VisibleBranches-apidoc.md @@ -1,6 +1,6 @@ # Prepare.VisibleBranches property -Corresponds to command line option ` -v, --visibleBranches` +Corresponds to command line option `-v, --visibleBranches` ```csharp public bool VisibleBranches { get; set; } diff --git a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions-apidoc.md index 2aa057d5b..62314cdbc 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions-apidoc.md @@ -24,11 +24,11 @@ public sealed class PrepareOptions : IEquatable, IStructuralEqua | [ExposeReturnCode](Primitive.PrepareOptions/ExposeReturnCode-apidoc) { get; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [FileFilter](Primitive.PrepareOptions/FileFilter-apidoc) { get; } | Corresponds to command line option `-f, --fileFilter=VALUE` | | [InPlace](Primitive.PrepareOptions/InPlace-apidoc) { get; } | Corresponds to command line option `--inplace` | -| [InputDirectories](Primitive.PrepareOptions/InputDirectories-apidoc) { get; } | Corresponds to command line option ` -i, --inputDirectory=VALUE` | -| [Keys](Primitive.PrepareOptions/Keys-apidoc) { get; } | Corresponds to command line option ` -k, --key=VALUE` | +| [InputDirectories](Primitive.PrepareOptions/InputDirectories-apidoc) { get; } | Corresponds to command line option `-i, --inputDirectory=VALUE` | +| [Keys](Primitive.PrepareOptions/Keys-apidoc) { get; } | Corresponds to command line option `-k, --key=VALUE` | | [LineCover](Primitive.PrepareOptions/LineCover-apidoc) { get; } | Corresponds to command line option `--linecover` | | [LocalSource](Primitive.PrepareOptions/LocalSource-apidoc) { get; } | Corresponds to command line option `-l, --localSource` | -| [MethodFilter](Primitive.PrepareOptions/MethodFilter-apidoc) { get; } | Corresponds to command line option ` -m, --methodFilter=VALUE` | +| [MethodFilter](Primitive.PrepareOptions/MethodFilter-apidoc) { get; } | Corresponds to command line option `-m, --methodFilter=VALUE` | | [MethodPoint](Primitive.PrepareOptions/MethodPoint-apidoc) { get; } | Corresponds to command line option `--methodpoint` | | [MethodTopLevel](Primitive.PrepareOptions/MethodTopLevel-apidoc) { get; } | Corresponds to command line option `--methodtoplevel=VALUE` | | [OutputDirectories](Primitive.PrepareOptions/OutputDirectories-apidoc) { get; } | Corresponds to command line option `-o, --outputDirectory=VALUE` | @@ -36,17 +36,17 @@ public sealed class PrepareOptions : IEquatable, IStructuralEqua | [Report](Primitive.PrepareOptions/Report-apidoc) { get; } | Corresponds to command line option `-r, --report=VALUE` | | [ReportFormat](Primitive.PrepareOptions/ReportFormat-apidoc) { get; } | Corresponds to command line option `--reportFormat=VALUE` | | [Save](Primitive.PrepareOptions/Save-apidoc) { get; } | Corresponds to command line option `--save` | -| [ShowGenerated](Primitive.PrepareOptions/ShowGenerated-apidoc) { get; } | Corresponds to command line option ` --showGenerated` | +| [ShowGenerated](Primitive.PrepareOptions/ShowGenerated-apidoc) { get; } | Corresponds to command line option `--showGenerated` | | [ShowStatic](Primitive.PrepareOptions/ShowStatic-apidoc) { get; } | Corresponds to command line option `--showstatic[=VALUE]` | | [SingleVisit](Primitive.PrepareOptions/SingleVisit-apidoc) { get; } | Corresponds to command line option `--single` | | [SourceLink](Primitive.PrepareOptions/SourceLink-apidoc) { get; } | Corresponds to command line option `--sourcelink` | | [StrongNameKey](Primitive.PrepareOptions/StrongNameKey-apidoc) { get; } | Corresponds to command line option `--sn, --strongNameKey=VALUE` | | [SymbolDirectories](Primitive.PrepareOptions/SymbolDirectories-apidoc) { get; } | Corresponds to command line option `-y, --symbolDirectory=VALUE` | -| [Trivia](Primitive.PrepareOptions/Trivia-apidoc) { get; } | Corresponds to command line option ` --trivia` | +| [Trivia](Primitive.PrepareOptions/Trivia-apidoc) { get; } | Corresponds to command line option `--trivia` | | [TypeFilter](Primitive.PrepareOptions/TypeFilter-apidoc) { get; } | Corresponds to command line option `-t, --typeFilter=VALUE` | | [TypeTopLevel](Primitive.PrepareOptions/TypeTopLevel-apidoc) { get; } | Corresponds to command line option `--typetoplevel=VALUE` | | [Verbosity](Primitive.PrepareOptions/Verbosity-apidoc) { get; } | Corresponds to command line options `-q` and `--verbose` | -| [VisibleBranches](Primitive.PrepareOptions/VisibleBranches-apidoc) { get; } | Corresponds to command line option ` -v, --visibleBranches` | +| [VisibleBranches](Primitive.PrepareOptions/VisibleBranches-apidoc) { get; } | Corresponds to command line option `-v, --visibleBranches` | | [ZipFile](Primitive.PrepareOptions/ZipFile-apidoc) { get; } | Corresponds to command line option `--zipfile` | ## See Also diff --git a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/InputDirectories-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/InputDirectories-apidoc.md index 7edacf98a..515cc4a13 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/InputDirectories-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/InputDirectories-apidoc.md @@ -1,6 +1,6 @@ # Primitive.PrepareOptions.InputDirectories property -Corresponds to command line option ` -i, --inputDirectory=VALUE` +Corresponds to command line option `-i, --inputDirectory=VALUE` ```csharp public IEnumerable InputDirectories { get; } diff --git a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Keys-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Keys-apidoc.md index 246355dc4..212287709 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Keys-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Keys-apidoc.md @@ -1,6 +1,6 @@ # Primitive.PrepareOptions.Keys property -Corresponds to command line option ` -k, --key=VALUE` +Corresponds to command line option `-k, --key=VALUE` ```csharp public IEnumerable Keys { get; } diff --git a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/MethodFilter-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/MethodFilter-apidoc.md index 31a239488..346619ac8 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/MethodFilter-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/MethodFilter-apidoc.md @@ -1,6 +1,6 @@ # Primitive.PrepareOptions.MethodFilter property -Corresponds to command line option ` -m, --methodFilter=VALUE` +Corresponds to command line option `-m, --methodFilter=VALUE` ```csharp public IEnumerable MethodFilter { get; } diff --git a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/ShowGenerated-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/ShowGenerated-apidoc.md index 39a317835..6b0db68a4 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/ShowGenerated-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/ShowGenerated-apidoc.md @@ -1,6 +1,6 @@ # Primitive.PrepareOptions.ShowGenerated property -Corresponds to command line option ` --showGenerated` +Corresponds to command line option `--showGenerated` ```csharp public bool ShowGenerated { get; } diff --git a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Trivia-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Trivia-apidoc.md index ea0a16d51..7d17aaed3 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Trivia-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/Trivia-apidoc.md @@ -1,6 +1,6 @@ # Primitive.PrepareOptions.Trivia property -Corresponds to command line option ` --trivia` +Corresponds to command line option `--trivia` ```csharp public bool Trivia { get; } diff --git a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/VisibleBranches-apidoc.md b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/VisibleBranches-apidoc.md index c4a2146ac..15cdd7189 100644 --- a/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/VisibleBranches-apidoc.md +++ b/docs/AltCover.Engine/AltCover/Primitive.PrepareOptions/VisibleBranches-apidoc.md @@ -1,6 +1,6 @@ # Primitive.PrepareOptions.VisibleBranches property -Corresponds to command line option ` -v, --visibleBranches` +Corresponds to command line option `-v, --visibleBranches` ```csharp public bool VisibleBranches { get; } diff --git a/docs/AltCover.Engine/AltCover/RunSettings-apidoc.md b/docs/AltCover.Engine/AltCover/RunSettings-apidoc.md index 48d0287df..743676db9 100644 --- a/docs/AltCover.Engine/AltCover/RunSettings-apidoc.md +++ b/docs/AltCover.Engine/AltCover/RunSettings-apidoc.md @@ -15,7 +15,7 @@ public class RunSettings : Task | [RunSettings](RunSettings/RunSettings-apidoc)() | The default constructor | | [Extended](RunSettings/Extended-apidoc) { get; set; } | The settings file generated, an output parameter | | [TestSetting](RunSettings/TestSetting-apidoc) { get; set; } | The current settings file to be extended | -| [Verbosity](RunSettings/Verbosity-apidoc) { get; set; } | Corresponds to command line option ` -q` (expects names of `System.Diagnostics.TraceLevel` values) | +| [Verbosity](RunSettings/Verbosity-apidoc) { get; set; } | Corresponds to command line option `-q` (expects names of `System.Diagnostics.TraceLevel` values) | | override [Execute](RunSettings/Execute-apidoc)() | Perform the operation | ## See Also diff --git a/docs/AltCover.Engine/AltCover/RunSettings/Verbosity-apidoc.md b/docs/AltCover.Engine/AltCover/RunSettings/Verbosity-apidoc.md index 7f2e8b6a5..e4c2246d9 100644 --- a/docs/AltCover.Engine/AltCover/RunSettings/Verbosity-apidoc.md +++ b/docs/AltCover.Engine/AltCover/RunSettings/Verbosity-apidoc.md @@ -1,6 +1,6 @@ # RunSettings.Verbosity property -Corresponds to command line option ` -q` (expects names of `System.Diagnostics.TraceLevel` values) +Corresponds to command line option `-q` (expects names of `System.Diagnostics.TraceLevel` values) ```csharp public string Verbosity { get; set; } diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions-apidoc.md index eb3068623..40c7327f9 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions-apidoc.md @@ -24,11 +24,11 @@ public sealed class PrepareOptions : IEquatable, IStructuralEqua | [ExposeReturnCode](TypeSafe.PrepareOptions/ExposeReturnCode-apidoc) { get; } | Corresponds to the converse of command line option `--dropReturnCode ` | | [FileFilter](TypeSafe.PrepareOptions/FileFilter-apidoc) { get; } | Corresponds to command line option `-f, --fileFilter=VALUE` | | [InPlace](TypeSafe.PrepareOptions/InPlace-apidoc) { get; } | Corresponds to command line option `--inplace` | -| [InputDirectories](TypeSafe.PrepareOptions/InputDirectories-apidoc) { get; } | Corresponds to command line option ` -i, --inputDirectory=VALUE` | -| [Keys](TypeSafe.PrepareOptions/Keys-apidoc) { get; } | Corresponds to command line option ` -k, --key=VALUE` | +| [InputDirectories](TypeSafe.PrepareOptions/InputDirectories-apidoc) { get; } | Corresponds to command line option `-i, --inputDirectory=VALUE` | +| [Keys](TypeSafe.PrepareOptions/Keys-apidoc) { get; } | Corresponds to command line option `-k, --key=VALUE` | | [LineCover](TypeSafe.PrepareOptions/LineCover-apidoc) { get; } | Corresponds to command line option `--linecover` | | [LocalSource](TypeSafe.PrepareOptions/LocalSource-apidoc) { get; } | Corresponds to command line option `-l, --localSource` | -| [MethodFilter](TypeSafe.PrepareOptions/MethodFilter-apidoc) { get; } | Corresponds to command line option ` -m, --methodFilter=VALUE` | +| [MethodFilter](TypeSafe.PrepareOptions/MethodFilter-apidoc) { get; } | Corresponds to command line option `-m, --methodFilter=VALUE` | | [MethodPoint](TypeSafe.PrepareOptions/MethodPoint-apidoc) { get; } | Corresponds to command line option `--methodpoint` | | [MethodTopLevel](TypeSafe.PrepareOptions/MethodTopLevel-apidoc) { get; } | Corresponds to command line option `--methodtoplevel=VALUE` | | [OutputDirectories](TypeSafe.PrepareOptions/OutputDirectories-apidoc) { get; } | Corresponds to command line option `-o, --outputDirectory=VALUE` | @@ -36,17 +36,17 @@ public sealed class PrepareOptions : IEquatable, IStructuralEqua | [Report](TypeSafe.PrepareOptions/Report-apidoc) { get; } | Corresponds to command line option `-r, --report=VALUE` | | [ReportFormat](TypeSafe.PrepareOptions/ReportFormat-apidoc) { get; } | Corresponds to command line option `--reportFormat=VALUE` | | [Save](TypeSafe.PrepareOptions/Save-apidoc) { get; } | Corresponds to command line option `--save` | -| [ShowGenerated](TypeSafe.PrepareOptions/ShowGenerated-apidoc) { get; } | Corresponds to command line option ` --showGenerated` | +| [ShowGenerated](TypeSafe.PrepareOptions/ShowGenerated-apidoc) { get; } | Corresponds to command line option `--showGenerated` | | [ShowStatic](TypeSafe.PrepareOptions/ShowStatic-apidoc) { get; } | Corresponds to command line option `--showstatic[=VALUE]` | | [SingleVisit](TypeSafe.PrepareOptions/SingleVisit-apidoc) { get; } | Corresponds to command line option `--single` | | [SourceLink](TypeSafe.PrepareOptions/SourceLink-apidoc) { get; } | Corresponds to command line option `--sourcelink` | | [StrongNameKey](TypeSafe.PrepareOptions/StrongNameKey-apidoc) { get; } | Corresponds to command line option `--sn, --strongNameKey=VALUE` | | [SymbolDirectories](TypeSafe.PrepareOptions/SymbolDirectories-apidoc) { get; } | Corresponds to command line option `-y, --symbolDirectory=VALUE` | -| [Trivia](TypeSafe.PrepareOptions/Trivia-apidoc) { get; } | Corresponds to command line option ` --trivia` | +| [Trivia](TypeSafe.PrepareOptions/Trivia-apidoc) { get; } | Corresponds to command line option `--trivia` | | [TypeFilter](TypeSafe.PrepareOptions/TypeFilter-apidoc) { get; } | Corresponds to command line option `-t, --typeFilter=VALUE` | | [TypeTopLevel](TypeSafe.PrepareOptions/TypeTopLevel-apidoc) { get; } | Corresponds to command line option `--typetoplevel=VALUE` | | [Verbosity](TypeSafe.PrepareOptions/Verbosity-apidoc) { get; } | Corresponds to command line options `-q` and `--verbose` | -| [VisibleBranches](TypeSafe.PrepareOptions/VisibleBranches-apidoc) { get; } | Corresponds to command line option ` -v, --visibleBranches` | +| [VisibleBranches](TypeSafe.PrepareOptions/VisibleBranches-apidoc) { get; } | Corresponds to command line option `-v, --visibleBranches` | | [ZipFile](TypeSafe.PrepareOptions/ZipFile-apidoc) { get; } | Corresponds to command line option `--zipfile` | ## See Also diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/InputDirectories-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/InputDirectories-apidoc.md index 2e27d3e25..1ae0184be 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/InputDirectories-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/InputDirectories-apidoc.md @@ -1,6 +1,6 @@ # TypeSafe.PrepareOptions.InputDirectories property -Corresponds to command line option ` -i, --inputDirectory=VALUE` +Corresponds to command line option `-i, --inputDirectory=VALUE` ```csharp public DirectoryPaths InputDirectories { get; } diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Keys-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Keys-apidoc.md index fadcd5082..f2d41c741 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Keys-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Keys-apidoc.md @@ -1,6 +1,6 @@ # TypeSafe.PrepareOptions.Keys property -Corresponds to command line option ` -k, --key=VALUE` +Corresponds to command line option `-k, --key=VALUE` ```csharp public FilePaths Keys { get; } diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/MethodFilter-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/MethodFilter-apidoc.md index 2e8fa4591..c9944ca7e 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/MethodFilter-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/MethodFilter-apidoc.md @@ -1,6 +1,6 @@ # TypeSafe.PrepareOptions.MethodFilter property -Corresponds to command line option ` -m, --methodFilter=VALUE` +Corresponds to command line option `-m, --methodFilter=VALUE` ```csharp public Filters MethodFilter { get; } diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/ShowGenerated-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/ShowGenerated-apidoc.md index a3626c856..20689fa02 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/ShowGenerated-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/ShowGenerated-apidoc.md @@ -1,6 +1,6 @@ # TypeSafe.PrepareOptions.ShowGenerated property -Corresponds to command line option ` --showGenerated` +Corresponds to command line option `--showGenerated` ```csharp public Flag ShowGenerated { get; } diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Trivia-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Trivia-apidoc.md index 4cab33e9e..43cd4cdce 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Trivia-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/Trivia-apidoc.md @@ -1,6 +1,6 @@ # TypeSafe.PrepareOptions.Trivia property -Corresponds to command line option ` --trivia` +Corresponds to command line option `--trivia` ```csharp public Flag Trivia { get; } diff --git a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/VisibleBranches-apidoc.md b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/VisibleBranches-apidoc.md index aadd96caa..74ccb916d 100644 --- a/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/VisibleBranches-apidoc.md +++ b/docs/AltCover.Engine/AltCover/TypeSafe.PrepareOptions/VisibleBranches-apidoc.md @@ -1,6 +1,6 @@ # TypeSafe.PrepareOptions.VisibleBranches property -Corresponds to command line option ` -v, --visibleBranches` +Corresponds to command line option `-v, --visibleBranches` ```csharp public Flag VisibleBranches { get; } diff --git a/docs/AltCover.Engine/WhatIfExtension-fsapidoc.md b/docs/AltCover.Engine/WhatIfExtension-fsapidoc.md index cf6913723..44949a0f7 100644 --- a/docs/AltCover.Engine/WhatIfExtension-fsapidoc.md +++ b/docs/AltCover.Engine/WhatIfExtension-fsapidoc.md @@ -8,12 +8,10 @@ namespace AltCover ``` ## module `PrepareExtension` and module `CollectExtension` ``` -[] module PrepareExtension = begin [] val WhatIf : prepare:Abstract.IPrepareOptions -> AltCover.ValidatedCommandLine end -[] module CollectExtension = begin [] val WhatIf : diff --git a/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md b/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md index 14d5b928a..64d2a9d13 100644 --- a/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md +++ b/docs/AltCover.Fake.DotNet.Testing.AltCover/Abstract-fsapidoc.md @@ -28,7 +28,6 @@ The members correspond to the like-named command line options for `AltCover Runn ``` type ICollectOptions = - interface abstract member RecorderDirectory : String with get abstract member WorkingDirectory : String with get abstract member Executable : String with get @@ -40,7 +39,6 @@ The members correspond to the like-named command line options for `AltCover Runn abstract member ExposeReturnCode : bool with get abstract member SummaryFormat : String with get abstract member Verbosity : System.Diagnostics.TraceLevel with get - end ``` ### interface `IPrepareOptions` @@ -51,7 +49,6 @@ The members correspond to the like-named command line options for `AltCover`, ex ``` type IPrepareOptions = - interface abstract member InputDirectories : IEnumerable with get abstract member OutputDirectories : IEnumerable with get abstract member SymbolDirectories : IEnumerable with get @@ -88,7 +85,6 @@ The members correspond to the like-named command line options for `AltCover`, ex abstract member ShowGenerated : bool with get abstract member Verbosity : System.Diagnostics.TraceLevel with get abstract member Trivia : bool with get - end ``` diff --git a/docs/AltCover.Fake.DotNet.Testing.AltCover/DotNet-fsapidoc.md b/docs/AltCover.Fake.DotNet.Testing.AltCover/DotNet-fsapidoc.md index e4b2b2a4f..4be7c304d 100644 --- a/docs/AltCover.Fake.DotNet.Testing.AltCover/DotNet-fsapidoc.md +++ b/docs/AltCover.Fake.DotNet.Testing.AltCover/DotNet-fsapidoc.md @@ -9,11 +9,9 @@ namespace AltCoverFake.DotNet.Testing [] module DotNet = begin type ICLIOptions = - interface abstract member ForceDelete : bool with get abstract member FailFast : bool with get abstract member ShowSummary : System.String with get - end [] type CLIOptions = @@ -54,9 +52,9 @@ vs collect:Abstract.ICollectOptions -> options:ICLIOptions -> (string*string) list ## module `Options` -* [] -* default interface implementations with get and set members, and - * type CLI - implements DotNet.ICLIOptions : default values fale or empty +* `[]` +* default interface implementations with get and set members + * type CLI - implements DotNet.ICLIOptions : default values false or empty * type Collect - implements Abstract.ICollectOptions : default values as per the `Primitive.CollectOptions` record * type Prepare - implements Abstract.IPrepareOptions : default values as per the `Primitive.PrepareOptions` record