diff --git a/.gitignore b/.gitignore
index e3605d7e1..0cd48026b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,3 +68,5 @@ Tests/TestResults/
ThirdParty/gendarme.zip
ThirdParty/gendarme/
Sample4/TestResults/
+Sample18/TestResults/
+*.user
diff --git a/AltCover.CSApi/Definitions.cs b/AltCover.CSApi/Definitions.cs
index c05593fff..5969377bd 100644
--- a/AltCover.CSApi/Definitions.cs
+++ b/AltCover.CSApi/Definitions.cs
@@ -301,14 +301,18 @@ namespace AltCover
public static class CSApi
{
- public static int Prepare(IPrepareArgs p, ILogArgs l)
+ public static int Prepare(IPrepareArgs prepareArgs, ILogArgs log)
{
- return Api.Prepare(p.ToParameters(), l.ToParameters());
+ if (prepareArgs == null) throw new ArgumentNullException(nameof(prepareArgs));
+ if (log == null) throw new ArgumentNullException(nameof(log));
+ return Api.Prepare(prepareArgs.ToParameters(), log.ToParameters());
}
- public static int Collect(ICollectArgs c, ILogArgs l)
+ public static int Collect(ICollectArgs collectArgs, ILogArgs log)
{
- return Api.Collect(c.ToParameters(), l.ToParameters());
+ if (collectArgs == null) throw new ArgumentNullException(nameof(collectArgs));
+ if (log == null) throw new ArgumentNullException(nameof(log));
+ return Api.Collect(collectArgs.ToParameters(), log.ToParameters());
}
public static string Ipmo()
@@ -329,22 +333,26 @@ private static DotNet.CLIArgs ToCLIArgs(ICLIArg args)
return DotNet.CLIArgs.NewMany(new[] { force, failfast, showsummary });
}
- public static string ToTestArguments(IPrepareArgs p,
- ICollectArgs c,
- ICLIArg force)
+ public static string ToTestArguments(IPrepareArgs prepareArgs,
+ ICollectArgs collectArgs,
+ ICLIArg control)
{
- return DotNet.ToTestArguments(p.ToParameters(),
- c.ToParameters(),
- ToCLIArgs(force));
+ if (prepareArgs == null) throw new ArgumentNullException(nameof(prepareArgs));
+ if (collectArgs == null) throw new ArgumentNullException(nameof(collectArgs));
+ return DotNet.ToTestArguments(prepareArgs.ToParameters(),
+ collectArgs.ToParameters(),
+ ToCLIArgs(control));
}
- public static string[] ToTestArgumentList(IPrepareArgs p,
- ICollectArgs c,
- ICLIArg force)
+ public static string[] ToTestArgumentList(IPrepareArgs prepareArgs,
+ ICollectArgs collectArgs,
+ ICLIArg control)
{
- return DotNet.ToTestArgumentList(p.ToParameters(),
- c.ToParameters(),
- ToCLIArgs(force)).
+ if (prepareArgs == null) throw new ArgumentNullException(nameof(prepareArgs));
+ if (collectArgs == null) throw new ArgumentNullException(nameof(collectArgs));
+ return DotNet.ToTestArgumentList(prepareArgs.ToParameters(),
+ collectArgs.ToParameters(),
+ ToCLIArgs(control)).
ToArray();
}
}
diff --git a/AltCover.CSApi/Properties/AssemblyInfo.cs b/AltCover.CSApi/Properties/AssemblyInfo.cs
index 35533fe87..72d37dea2 100644
--- a/AltCover.CSApi/Properties/AssemblyInfo.cs
+++ b/AltCover.CSApi/Properties/AssemblyInfo.cs
@@ -8,6 +8,7 @@
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
+[assembly: System.CLSCompliant(true)]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/AltCover.CSApi/altcover.csapi.core.csproj b/AltCover.CSApi/altcover.csapi.core.csproj
index bd047be4e..59999d057 100644
--- a/AltCover.CSApi/altcover.csapi.core.csproj
+++ b/AltCover.CSApi/altcover.csapi.core.csproj
@@ -11,6 +11,7 @@
true
true
$(ProjectDir)..\Build\Infrastructure.snk
+ $(ProjectDir)../
diff --git a/AltCover.Cake/Cake.cs b/AltCover.Cake/Cake.cs
index b6cfe50c6..8d35bb942 100644
--- a/AltCover.Cake/Cake.cs
+++ b/AltCover.Cake/Cake.cs
@@ -1,4 +1,5 @@
-using Cake.Core;
+using System.Diagnostics.CodeAnalysis;
+using Cake.Core;
using Cake.Core.Annotations;
using LogLevel = Cake.Core.Diagnostics.LogLevel;
using Verbosity = Cake.Core.Diagnostics.Verbosity;
@@ -7,53 +8,55 @@
namespace AltCover.Cake
{
- public static class Api
+ public static class Api
+ {
+ private static ILogArgs MakeLog(ICakeContext context, ILogArgs log)
{
- private static ILogArgs MakeLog(ICakeContext context, ILogArgs l)
- {
- if (l != null)
- return l;
+ if (log != null)
+ return log;
- if (context != null)
- return new LogArgs()
- {
- Info = x => context.Log.Write(Verbosity.Normal, LogLevel.Information, x),
- Warn = x => context.Log.Write(Verbosity.Normal, LogLevel.Warning, x),
- Echo = x => context.Log.Write(Verbosity.Normal, LogLevel.Error, x),
- Error = x => context.Log.Write(Verbosity.Verbose, LogLevel.Information, x),
- };
+ if (context != null)
+ return new LogArgs()
+ {
+ Info = x => context.Log.Write(Verbosity.Normal, LogLevel.Information, x),
+ Warn = x => context.Log.Write(Verbosity.Normal, LogLevel.Warning, x),
+ Echo = x => context.Log.Write(Verbosity.Normal, LogLevel.Error, x),
+ Error = x => context.Log.Write(Verbosity.Verbose, LogLevel.Information, x),
+ };
- return new LogArgs()
- {
- Info = x => { },
- Warn = x => { },
- Echo = x => { },
- Error = x => { }
- };
- }
+ return new LogArgs()
+ {
+ Info = x => { },
+ Warn = x => { },
+ Echo = x => { },
+ Error = x => { }
+ };
+ }
- [CakeMethodAlias]
- public static int Prepare(this ICakeContext context, IPrepareArgs p, ILogArgs l = null)
- {
- return CSApi.Prepare(p, MakeLog(context, l));
- }
+ [CakeMethodAlias]
+ public static int Prepare(this ICakeContext context, IPrepareArgs prepareArgs, ILogArgs log = null)
+ {
+ return CSApi.Prepare(prepareArgs, MakeLog(context, log));
+ }
- [CakeMethodAlias]
- public static int Collect(this ICakeContext context, ICollectArgs c, ILogArgs l = null)
- {
- return CSApi.Collect(c, MakeLog(context, l));
- }
+ [CakeMethodAlias]
+ public static int Collect(this ICakeContext context, ICollectArgs collectArgs, ILogArgs log = null)
+ {
+ return CSApi.Collect(collectArgs, MakeLog(context, log));
+ }
- [CakeMethodAlias]
- public static string Ipmo(this ICakeContext context)
- {
- return CSApi.Ipmo();
- }
+ [CakeMethodAlias]
+ public static string Ipmo(this ICakeContext context)
+ {
+ if (context == null) throw new System.ArgumentNullException(nameof(context));
+ return CSApi.Ipmo();
+ }
- [CakeMethodAlias]
- public static string Version(this ICakeContext context)
- {
- return CSApi.Version();
- }
+ [CakeMethodAlias]
+ public static string Version(this ICakeContext context)
+ {
+ if (context == null) throw new System.ArgumentNullException(nameof(context));
+ return CSApi.Version();
}
+ }
}
\ No newline at end of file
diff --git a/AltCover.Cake/DotNet.cs b/AltCover.Cake/DotNet.cs
index 54d7a72cb..1434ecd82 100644
--- a/AltCover.Cake/DotNet.cs
+++ b/AltCover.Cake/DotNet.cs
@@ -9,60 +9,67 @@
namespace AltCover.Cake
{
- public class AltCoverSettings
- {
- public IPrepareArgs PreparationPhase { get; set; }
- public ICollectArgs CollectionPhase { get; set; }
+ public class AltCoverSettings
+ {
+ public IPrepareArgs PreparationPhase { get; set; }
+ public ICollectArgs CollectionPhase { get; set; }
public ICLIArg Control { get; set; }
- public Func Customize()
- {
+ public Func Customize()
+ {
return pabIn =>
{
- var pabOut = new ProcessArgumentBuilder();
- if (pabIn != null)
+ var pabOut = new ProcessArgumentBuilder();
+ if (pabIn != null)
+ {
+ pabIn.CopyTo(pabOut);
+ }
+ var args = CSApi.ToTestArgumentList(
+ this.PreparationPhase,
+ this.CollectionPhase,
+ this.Control);
+ Array.Reverse(args);
+ Array.ForEach(
+ args,
+ t => pabOut.Prepend(t));
+ return pabOut;
+ };
+ }
+
+ public Func Concatenate(Func customIn)
{
- pabIn.CopyTo(pabOut);
+ var altcover = Customize();
+ if (customIn == null)
+ {
+ return altcover;
+ }
+ else
+ {
+ return args => altcover(customIn(args));
+ }
}
- var args = CSApi.ToTestArgumentList(
- this.PreparationPhase,
- this.CollectionPhase,
- this.Control);
- Array.Reverse(args);
- Array.ForEach(
- args,
- t => pabOut.Prepend(t));
- return pabOut;
- };
}
- public Func Concatenate(Func customIn)
+ [CakeAliasCategory("DotNetCore")]
+ public static class DotNet
{
- var altcover = Customize();
- if (customIn == null)
- {
- return altcover;
- }
- else
- {
- return args => altcover(customIn(args));
- }
- }
- }
+ [CakeMethodAlias]
+ [CakeAliasCategory("Test")]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage(
+ "Gendarme.Rules.Maintainability", "AvoidUnnecessarySpecializationRule",
+ Justification = "AvoidSpeculativeGenerality too")]
+ public static void DotNetCoreTest(
+ this ICakeContext context,
+ FilePath project,
+ DotNetCoreTestSettings settings,
+ AltCoverSettings altcover)
+ {
+ if (project == null) throw new ArgumentNullException(nameof(project));
+ if (settings == null) throw new ArgumentNullException(nameof(settings));
+ if (altcover == null) throw new ArgumentNullException(nameof(altcover));
- [CakeAliasCategory("DotNetCore")]
- public static class DotNet
- {
- [CakeMethodAlias]
- [CakeAliasCategory("Test")]
- public static void DotNetCoreTest(
- this ICakeContext context,
- FilePath project,
- DotNetCoreTestSettings settings,
- AltCoverSettings altcover)
- {
- settings.ArgumentCustomization = altcover.Concatenate(settings.ArgumentCustomization);
- context.DotNetCoreTest(project.FullPath, settings);
+ settings.ArgumentCustomization = altcover.Concatenate(settings.ArgumentCustomization);
+ context.DotNetCoreTest(project.GetFilename().FullPath, settings);
+ }
}
- }
}
\ No newline at end of file
diff --git a/AltCover.Cake/Properties/AssemblyInfo.cs b/AltCover.Cake/Properties/AssemblyInfo.cs
index 261cb1289..61c0ee3b5 100644
--- a/AltCover.Cake/Properties/AssemblyInfo.cs
+++ b/AltCover.Cake/Properties/AssemblyInfo.cs
@@ -8,6 +8,7 @@
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
+[assembly: System.CLSCompliant(true)]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/AltCover.Cake/altcover.cake.core.csproj b/AltCover.Cake/altcover.cake.core.csproj
index 82477c67c..063edbdd8 100644
--- a/AltCover.Cake/altcover.cake.core.csproj
+++ b/AltCover.Cake/altcover.cake.core.csproj
@@ -9,6 +9,7 @@
true
true
true
+ $(ProjectDir)../
diff --git a/AltCover.FSApi/CoverageFormats.fs b/AltCover.FSApi/CoverageFormats.fs
index d16f3d09d..771428d04 100644
--- a/AltCover.FSApi/CoverageFormats.fs
+++ b/AltCover.FSApi/CoverageFormats.fs
@@ -117,7 +117,8 @@ module CoverageFormats =
transform.Transform(navigable, output)
XmlUtilities.PrependDeclaration rewrite
- rewrite.SelectNodes("//method").OfType()
+ use methods = rewrite.SelectNodes("//method")
+ methods.OfType()
|> Seq.iter (fun m ->
let c = m.GetAttribute("class")
m.SetAttribute("class", c.Replace('/', '+'))
@@ -125,7 +126,8 @@ module CoverageFormats =
let lead = name.Substring(name.LastIndexOf("::", StringComparison.Ordinal) + 2)
m.SetAttribute("name", lead.Substring(0, lead.IndexOf('('))))
- rewrite.SelectNodes("//module").OfType()
+ use modules = rewrite.SelectNodes("//module")
+ modules.OfType()
|> Seq.iter (fun m ->
let path = m.GetAttribute("name")
let info = System.IO.FileInfo path
@@ -137,7 +139,8 @@ module CoverageFormats =
let culture = System.Threading.Thread.CurrentThread.CurrentCulture
try
System.Threading.Thread.CurrentThread.CurrentCulture <- CultureInfo.InvariantCulture
- rewrite.SelectNodes("//coverage").OfType()
+ use coverage = rewrite.SelectNodes("//coverage")
+ coverage.OfType()
|> Seq.iter (fun c ->
let now =
DateTime.UtcNow.ToLongDateString() + ":" + DateTime.UtcNow.ToLongTimeString()
diff --git a/AltCover.FSApi/Definitions.fs b/AltCover.FSApi/Definitions.fs
index 52db3cafd..a94735552 100644
--- a/AltCover.FSApi/Definitions.fs
+++ b/AltCover.FSApi/Definitions.fs
@@ -17,7 +17,7 @@ module DotNet =
[]
type CLIArgs =
| Force of bool
diff --git a/AltCover.FSApi/OpenCover.fs b/AltCover.FSApi/OpenCover.fs
index f2d6441c6..7c3e041a2 100644
--- a/AltCover.FSApi/OpenCover.fs
+++ b/AltCover.FSApi/OpenCover.fs
@@ -11,8 +11,10 @@ open System.Xml.XPath
module OpenCoverUtilities =
let private CompressMethod withinSequencePoint sameSpan (m : XmlElement) =
- let sp = m.GetElementsByTagName("SequencePoint").OfType() |> Seq.toList
- let bp = m.GetElementsByTagName("BranchPoint").OfType() |> Seq.toList
+ use sp0 = m.GetElementsByTagName("SequencePoint")
+ let sp = sp0.OfType() |> Seq.toList
+ use bp0 =m.GetElementsByTagName("BranchPoint")
+ let bp = bp0.OfType() |> Seq.toList
if sp
|> List.isEmpty
|> not
@@ -108,11 +110,13 @@ module OpenCoverUtilities =
let CompressBranching (navigable : IXPathNavigable) withinSequencePoint sameSpan =
// Validate
let xmlDocument = new XmlDocument()
- navigable.CreateNavigator().ReadSubtree() |> xmlDocument.Load
+ use reader = navigable.CreateNavigator().ReadSubtree()
+ reader |> xmlDocument.Load
xmlDocument.Schemas <- XmlUtilities.LoadSchema AltCover.Base.ReportFormat.OpenCover
xmlDocument.Validate(null)
// Get all the methods
- xmlDocument.SelectNodes("//Method")
+ use methods = xmlDocument.SelectNodes("//Method")
+ methods
|> Seq.cast
|> Seq.iter (CompressMethod withinSequencePoint sameSpan)
// tidy up here
diff --git a/AltCover.FSApi/Xhtml.fs b/AltCover.FSApi/Xhtml.fs
index e026ac227..c055d1efb 100644
--- a/AltCover.FSApi/Xhtml.fs
+++ b/AltCover.FSApi/Xhtml.fs
@@ -33,7 +33,8 @@ module Xhtml =
do use output = rewrite.CreateNavigator().AppendChild()
transform.Transform(intermediate, output)
- rewrite.DocumentElement.SelectNodes("//script[@language='JavaScript']").OfType
+ use scripts = rewrite.DocumentElement.SelectNodes("//script[@language='JavaScript']")
+ scripts.OfType
()
|> Seq.iter (fun n ->
let text = n.InnerText
diff --git a/AltCover.FSApi/Xml.fs b/AltCover.FSApi/Xml.fs
index e25456ab6..c7902b642 100644
--- a/AltCover.FSApi/Xml.fs
+++ b/AltCover.FSApi/Xml.fs
@@ -10,6 +10,8 @@ open System.Xml.Linq
open System.Xml.Schema
open System.Xml.Xsl
+open Augment
+
[]
module XmlUtilities =
[ isNull
- |> not
+ if xDeclaration.IsNotNull
then
let xmlDeclaration =
xmlDocument.CreateXmlDeclaration
@@ -33,6 +33,9 @@ module XmlUtilities =
[]
+ []
let ToXDocument(xmlDocument : XmlDocument) =
use nodeReader = new XmlNodeReader(xmlDocument)
nodeReader.MoveToContent() |> ignore // skips leading comments
@@ -101,6 +104,6 @@ module XmlUtilities =
| :? FileLoadException -> fallback
[]
- let PrependDeclaration(x : XmlDocument) =
+ let internal PrependDeclaration(x : XmlDocument) =
let xmlDeclaration = x.CreateXmlDeclaration("1.0", "utf-8", null)
x.InsertBefore(xmlDeclaration, x.FirstChild) |> ignore
\ No newline at end of file
diff --git a/AltCover.NetCoreApp/Program.fs b/AltCover.NetCoreApp/Program.fs
index 70bd23190..c00bf7f7c 100644
--- a/AltCover.NetCoreApp/Program.fs
+++ b/AltCover.NetCoreApp/Program.fs
@@ -1,13 +1,24 @@
namespace AltCover
+open System
+open System.Runtime.InteropServices
+
+[]
+[]
+()
+
module DotNetAltCover =
let internal ToConsole() =
Output.Error <- CommandLine.WriteErr
- Output.Usage <- CommandLine.Usage
+ Output.Usage <- CommandLine.UsageBase
Output.Echo <- CommandLine.WriteErr
Output.Info <- CommandLine.WriteOut
[]
+ []
let private Main arguments =
ToConsole()
AltCover.Main.EffectiveMain arguments
\ No newline at end of file
diff --git a/AltCover.NetCoreApp/altcover.netcoreapp.core.fsproj b/AltCover.NetCoreApp/altcover.netcoreapp.core.fsproj
index 2f6656e32..b6e7653f6 100644
--- a/AltCover.NetCoreApp/altcover.netcoreapp.core.fsproj
+++ b/AltCover.NetCoreApp/altcover.netcoreapp.core.fsproj
@@ -9,6 +9,7 @@
true
true
$(SolutionDir)AltCover/AltCover.ico
+ $(ProjectDir)../
@@ -25,6 +26,7 @@
4
true
+ TRACE;DEBUG;CODE_ANALYSIS
diff --git a/AltCover.PowerShell/Command.fs b/AltCover.PowerShell/Command.fs
index a2fa9f4f9..c9ae26a82 100644
--- a/AltCover.PowerShell/Command.fs
+++ b/AltCover.PowerShell/Command.fs
@@ -20,6 +20,9 @@ type ShowHidden =
[]
[]
+[]
[]
@@ -280,7 +283,7 @@ type InvokeAltCoverCommand(runner : bool) =
let where = self.SessionState.Path.CurrentLocation.Path
Directory.SetCurrentDirectory where
let makeError s =
- ErrorRecord(InvalidOperationException(), s, ErrorCategory.InvalidOperation, self)
+ ErrorRecord(InvalidOperationException(s), s, ErrorCategory.InvalidOperation, self)
|> self.WriteError
let status = self.Dispatch()
diff --git a/AltCover.Recorder/Adapter.fs b/AltCover.Recorder/Adapter.fs
index 1d385ecab..333cf0ebb 100644
--- a/AltCover.Recorder/Adapter.fs
+++ b/AltCover.Recorder/Adapter.fs
@@ -25,21 +25,25 @@ module Adapter =
let entry = Dictionary()
Instance.Visits.Add(name, entry)
+ let internal Init n l = let tmp = { PointVisit.Create() with Count = n }
+ tmp.Tracks.AddRange l
+ tmp
+
let VisitsAdd name line number =
prepareName name
- let v = PointVisit.Init number []
+ let v = Init number []
Instance.Visits.[name].Add(line, v)
let VisitsAddTrack name line number =
prepareName name
let v1 =
- PointVisit.Init number
+ Init number
[ Call 17
Call 42 ]
Instance.Visits.[name].Add(line, v1)
let v2 =
- PointVisit.Init (number + 1L)
+ Init (number + 1L)
[ Time 17L
Both
{ Time = 42L
diff --git a/AltCover.Recorder/Base.fs b/AltCover.Recorder/Base.fs
index 32dcef0f5..d2efe6021 100644
--- a/AltCover.Recorder/Base.fs
+++ b/AltCover.Recorder/Base.fs
@@ -76,19 +76,10 @@ and []
}
with
static member Create () = { Count = 0L; Tracks = List
-
+
all
runtime; build; native; contentfiles; analyzers
-
+
diff --git a/Build/rules-fake.xml b/Build/rules-fake.xml
deleted file mode 100644
index 4900d8bc8..000000000
--- a/Build/rules-fake.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Build/rules-gtk.xml b/Build/rules-gtk.xml
deleted file mode 100644
index 24a52284c..000000000
--- a/Build/rules-gtk.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Build/setup.fsx b/Build/setup.fsx
index cc54c5e9d..6428f78d8 100644
--- a/Build/setup.fsx
+++ b/Build/setup.fsx
@@ -49,10 +49,10 @@ nuget Fake.DotNet.Testing.XUnit2 >= 5.19.1
nuget Fake.IO.FileSystem >= 5.19.1
nuget Fake.DotNet.Testing.Coverlet >= 5.19.1
nuget Fake.Testing.ReportGenerator >= 5.19.1
-nuget AltCode.Fake.DotNet.Gendarme >= 5.9.3.10
+nuget AltCode.Fake.DotNet.Gendarme >= 5.18.1.24
nuget BlackFox.CommandLine >= 1.0.0
nuget BlackFox.VsWhere >= 1.0.0
-nuget FSharpLint.Core >= 0.12.10
+nuget FSharpLint.Core >= 0.13.3
nuget Markdown >= 2.2.1
nuget NUnit >= 3.12.0
nuget YamlDotNet >= 8.1 //"
diff --git a/Build/targets.fsx b/Build/targets.fsx
index c3409d739..551488190 100644
--- a/Build/targets.fsx
+++ b/Build/targets.fsx
@@ -444,15 +444,10 @@ _Target "Lint" (fun _ ->
let failOnIssuesFound (issuesFound: bool) =
Assert.That(issuesFound, Is.False, "Lint issues were found")
try
- let settings =
- Configuration.SettingsFileName
- |> Path.getFullName
- |> File.ReadAllText
-
- let lintConfig =
- FSharpLint.Application.ConfigurationManagement.loadConfigurationFile settings
let options =
- { Lint.OptionalLintParameters.Default with Configuration = Some lintConfig }
+ { Lint.OptionalLintParameters.Default with Configuration = FromFile (Path.getFullName "./fsharplint.json")
+ //Configuration.SettingsFileName
+ }
!!"**/*.fsproj"
|> Seq.collect (fun n -> !!(Path.GetDirectoryName n @@ "*.fs"))
@@ -460,15 +455,24 @@ _Target "Lint" (fun _ ->
|> Seq.map (fun f ->
match Lint.lintFile options f with
| Lint.LintResult.Failure x -> failwithf "%A" x
- | Lint.LintResult.Success w -> w)
+ | Lint.LintResult.Success w ->
+ w
+ |> Seq.filter (fun x ->
+ match x.Details.SuggestedFix with
+ | Some l -> match l.Force() with
+ | Some fix -> fix.FromText <> "AltCover_Fake" // special case
+ | _ -> false
+ | _ -> false))
|> Seq.concat
|> Seq.fold (fun _ x ->
- printfn "Info: %A\r\n Range: %A\r\n Fix: %A\r\n====" x.Info x.Range x.Fix
+ printfn "Info: %A\r\n Range: %A\r\n Fix: %A\r\n====" x.Details.Message x.Details.Range x.Details.SuggestedFix
true) false
|> failOnIssuesFound
with
- | :? System.MissingMethodException -> // TODO
+ | :? System.MissingMethodException ->
printfn "MissingMethodException raised"
+ | :? System.ArgumentOutOfRangeException ->
+ printfn "ArgumentOutOfRangeException raised"
| ex ->
printfn "%A" ex
reraise()
@@ -484,6 +488,8 @@ _Target "Gendarme" (fun _ -> // Needs debug because release is compiled --standa
("_Binaries/AltCover.FSApi/Debug+AnyCPU/netstandard2.0/publish", "netstandard2.0", "./AltCover.FSApi/altcover.fsapi.core.fsproj")
("_Binaries/AltCover.Visualizer/Debug+AnyCPU/netcoreapp2.1/publish", "netcoreapp2.1", "./AltCover.Visualizer/altcover.visualizer.core.fsproj")
("_Binaries/AltCover.Fake.DotNet.Testing.AltCover/Debug+AnyCPU/netstandard2.0/publish", "netstandard2.0", "./AltCover.Fake.DotNet.Testing.AltCover/altcover.fake.dotnet.testing.altcover.core.fsproj")
+ ("_Binaries/AltCover.Cake/Debug+AnyCPU/netstandard2.0/publish", "netstandard2.0", "./AltCover.Cake/altcover.cake.core.csproj")
+ ("_Binaries/altcover.netcoreapp/Debug+AnyCPU/netcoreapp2.0/publish", "netcoreapp2.0", "./AltCover.NetCoreApp/altcover.netcoreapp.core.fsproj")
]
|> Seq.iter (fun (pub, rt, proj) -> DotNet.publish (fun options ->
{ options with
@@ -491,22 +497,23 @@ _Target "Gendarme" (fun _ -> // Needs debug because release is compiled --standa
Configuration = DotNet.BuildConfiguration.Debug
NoBuild = true
MSBuildParams = { MSBuild.CliArguments.Create() with
+ DisableInternalBinLog = true
Properties = [("AltCoverGendarme", "true")] }
Framework = Some rt }) proj)
- [ ("./Build/rules.xml",
+ [ ("./Build/common-rules.xml",
[ "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.0/publish/AltCover.dll"
- "_Binaries/AltCover.Shadow/Debug+AnyCPU/netstandard2.0/publish/AltCover.Shadow.dll" ])
-
- ("./Build/rules-posh.xml",
- [ "_Binaries/AltCover.PowerShell/Debug+AnyCPU/netstandard2.0/publish/AltCover.PowerShell.dll"
- "_Binaries/AltCover.FSApi/Debug+AnyCPU/netstandard2.0/publish/AltCover.FSApi.dll" ])
-
- ("./Build/rules-gtk.xml",
- [ "_Binaries/AltCover.Visualizer/Debug+AnyCPU/netcoreapp2.1/publish/AltCover.Visualizer.dll" ])
-
- ("./Build/rules-fake.xml",
- [ "_Binaries/AltCover.Fake.DotNet.Testing.AltCover/Debug+AnyCPU/netstandard2.0/publish/AltCover.Fake.DotNet.Testing.AltCover.dll" ]) ]
+ "_Binaries/AltCover.Shadow/Debug+AnyCPU/netstandard2.0/publish/AltCover.Shadow.dll"
+ "_Binaries/AltCover.PowerShell/Debug+AnyCPU/netstandard2.0/publish/AltCover.PowerShell.dll"
+ "_Binaries/AltCover.FSApi/Debug+AnyCPU/netstandard2.0/publish/AltCover.FSApi.dll"
+ "_Binaries/AltCover.Visualizer/Debug+AnyCPU/netcoreapp2.1/publish/AltCover.Visualizer.dll"
+ "_Binaries/AltCover.Fake.DotNet.Testing.AltCover/Debug+AnyCPU/netstandard2.0/publish/AltCover.Fake.DotNet.Testing.AltCover.dll"
+ "_Binaries/altcover.netcoreapp/Debug+AnyCPU/netcoreapp2.0/publish/altcover.netcoreapp.dll"
+ ])
+ ("./Build/csharp-rules.xml",
+ [ "_Binaries/AltCover.Cake/Debug+AnyCPU/netstandard2.0/publish/AltCover.Cake.dll"
+ "_Binaries/AltCover.Cake/Debug+AnyCPU/netstandard2.0/publish/AltCover.CSapi.dll"
+ ]) ]
|> Seq.iter (fun (ruleset, files) ->
Gendarme.run
{ Gendarme.Params.Create() with
@@ -527,12 +534,12 @@ _Target "FxCop" (fun _ ->
let rules =
[ "-Microsoft.Design#CA1004"
"-Microsoft.Design#CA1006"
- "-Microsoft.Design#CA1011" // maybe sometimes
+ "-Microsoft.Design#CA1011" // reconsider @ Genbu; maybe sometimes
"-Microsoft.Design#CA1062" // null checks, In F#!
"-Microsoft.Maintainability#CA1506"
- "-Microsoft.Naming#CA1704"
- "-Microsoft.Naming#CA1707"
- "-Microsoft.Naming#CA1709"
+ "-Microsoft.Naming#CA1704" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1707" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1709" // reconsider @ Genbu
"-Microsoft.Naming#CA1715"
"-Microsoft.Usage#CA2208" ]
@@ -571,30 +578,30 @@ _Target "FxCop" (fun _ ->
([ "_Binaries/AltCover.PowerShell/Debug+AnyCPU/net47/AltCover.PowerShell.dll" ], [],
[ "-Microsoft.Design#CA1059"
"-Microsoft.Usage#CA2235"
- "-Microsoft.Performance#CA1819"
+ "-Microsoft.Performance#CA1819" // reconsider @ genbu
"-Microsoft.Design#CA1020"
"-Microsoft.Design#CA1004"
"-Microsoft.Design#CA1006"
- "-Microsoft.Design#CA1011"
+ "-Microsoft.Design#CA1011" // reconsider @ Genbu
"-Microsoft.Design#CA1062"
"-Microsoft.Maintainability#CA1506"
- "-Microsoft.Naming#CA1704"
- "-Microsoft.Naming#CA1707"
- "-Microsoft.Naming#CA1709"
+ "-Microsoft.Naming#CA1704" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1707" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1709" // reconsider @ Genbu
"-Microsoft.Naming#CA1715" ])
([ "_Binaries/AltCover.FSApi/Debug+AnyCPU/net45/AltCover.FSApi.dll" ], [],
[ "-Microsoft.Usage#CA2235"
- "-Microsoft.Performance#CA1819"
+ "-Microsoft.Performance#CA1819" // reconsider @ genbu
"-Microsoft.Design#CA1020"
"-Microsoft.Design#CA1034"
"-Microsoft.Design#CA1004"
"-Microsoft.Design#CA1006"
- "-Microsoft.Design#CA1011"
+ "-Microsoft.Design#CA1011" // reconsider @ Genbu
"-Microsoft.Design#CA1062"
"-Microsoft.Maintainability#CA1506"
- "-Microsoft.Naming#CA1704"
- "-Microsoft.Naming#CA1707"
- "-Microsoft.Naming#CA1709"
+ "-Microsoft.Naming#CA1704" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1707" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1709" // reconsider @ Genbu
"-Microsoft.Naming#CA1715" ])
([ "_Binaries/AltCover.Visualizer/Debug+AnyCPU/net45/AltCover.Visualizer.exe" ],
[ "AltCover.Augment"
@@ -623,14 +630,38 @@ _Target "FxCop" (fun _ ->
"AltCover.Internals.DotNet"
"AltCoverFake.DotNet.DotNet" ],
[ "-Microsoft.Design#CA1006"
- "-Microsoft.Design#CA1011"
+ "-Microsoft.Design#CA1011" // reconsider @ Genbu
"-Microsoft.Design#CA1020"
"-Microsoft.Design#CA1062"
- "-Microsoft.Naming#CA1704"
- "-Microsoft.Naming#CA1707"
- "-Microsoft.Naming#CA1709"
+ "-Microsoft.Naming#CA1704" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1707" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1709" // reconsider @ Genbu
"-Microsoft.Naming#CA1724"
- "-Microsoft.Usage#CA2208" ]) ]
+ "-Microsoft.Usage#CA2208" ])
+ ([ "_Binaries/AltCover.CSapi/Debug+AnyCPU/net45/AltCover.CSapi.dll"
+ //"_Binaries/altcover.netcoreapp/Debug+AnyCPU/netcoreapp2.0/altcover.netcoreapp.dll"
+ ],
+ [],
+ [
+ "-Microsoft.Design#CA1011" // reconsider @ Genbu
+ "-Microsoft.Design#CA1020"
+ "-Microsoft.Naming#CA1704" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1709" // reconsider @ Genbu
+ "-Microsoft.Performance#CA1819" // reconsider @ genbu
+ "-Microsoft.Naming#CA1716" // reconsider @ genbu
+ ])
+ ([ "_Binaries/AltCover.Cake/Debug+AnyCPU/net46/AltCover.Cake.dll"
+ ],
+ [],
+ [
+ "-Microsoft.Design#CA1011" // reconsider @ Genbu
+ "-Microsoft.Design#CA1020"
+ "-Microsoft.Design#CA1026" // can we suppress this one??
+ "-Microsoft.Design#CA2210" // can't strongname this as Cake isn't strongnamed
+ "-Microsoft.Naming#CA1704" // reconsider @ Genbu
+ "-Microsoft.Naming#CA1709" // reconsider @ Genbu
+ "-Microsoft.Performance#CA1819" // reconsider @ genbu
+ ]) ]
|> Seq.iter (fun (files, types, ruleset) ->
files
|> FxCop.run
diff --git a/Recorder.Tests/Recorder.Tests.fs b/Recorder.Tests/Recorder.Tests.fs
index 6e120d0fd..d42b66bb1 100644
--- a/Recorder.Tests/Recorder.Tests.fs
+++ b/Recorder.Tests/Recorder.Tests.fs
@@ -44,7 +44,7 @@ module AltCoverTests =
let private UpdateReport a b =
Adapter.UpdateReport(a, ReportFormat.NCover, b, b) |> ignore
- let private PointVisitInit a b = PointVisit.Init(a, b)
+ let private PointVisitInit a b = Adapter.Init(a, b)
let resource2 =
Assembly.GetExecutingAssembly().GetManifestResourceNames()
@@ -56,14 +56,6 @@ module AltCoverTests =
let ShouldBeAbleToGetTheDefaultReportFileName() =
Assert.True( Instance.ReportFile = "Coverage.Default.xml" )
- []
- let SafeDisposalProtects() =
- let obj1 =
- { new System.IDisposable with
- member x.Dispose() = ObjectDisposedException("Bang!") |> raise }
- Assist.SafeDispose obj1
- Assert.True( true )
-
[]
let DefaultAccessorsBehaveAsExpected() =
let v1 = DateTime.UtcNow.Ticks
@@ -355,31 +347,31 @@ module AltCoverTests =
Instance.Visits.Clear())
GetMyMethodName "<="
- []
- let TabledVisitsShouldIncrementCount() =
- GetMyMethodName "=>"
- lock Instance.Visits (fun () ->
- Adapter.Reset()
- try
- Instance.Visits.Clear()
- let key = " "
- Instance.VisitImpl(key, 23, (Adapter.Null()))
- let table = Dictionary>()
- table.Add(key, Dictionary())
- let payloads =
- [ Adapter.Call 17
- Adapter.Time 23L
- Adapter.NewBoth(5L, 42) ]
-
- let pv = PointVisitInit 42L payloads
- table.[key].Add(23, pv)
- let n = Counter.AddTable(Instance.Visits, table)
- Assert.That(n, Is.EqualTo 45)
- Assert.That(Instance.Visits.[key].[23].Count, Is.EqualTo 43)
- Assert.That(Instance.Visits.[key].[23].Tracks, Is.EquivalentTo payloads)
- finally
- Instance.Visits.Clear())
- GetMyMethodName "<="
+ //[]
+ //let TabledVisitsShouldIncrementCount() =
+ // GetMyMethodName "=>"
+ // lock Instance.Visits (fun () ->
+ // Adapter.Reset()
+ // try
+ // Instance.Visits.Clear()
+ // let key = " "
+ // Instance.VisitImpl(key, 23, (Adapter.Null()))
+ // let table = Dictionary>()
+ // table.Add(key, Dictionary())
+ // let payloads =
+ // [ Adapter.Call 17
+ // Adapter.Time 23L
+ // Adapter.NewBoth(5L, 42) ]
+
+ // let pv = PointVisitInit 42L payloads
+ // table.[key].Add(23, pv)
+ // let n = Counter.AddTable(Instance.Visits, table)
+ // Assert.That(n, Is.EqualTo 45)
+ // Assert.That(Instance.Visits.[key].[23].Count, Is.EqualTo 43)
+ // Assert.That(Instance.Visits.[key].[23].Tracks, Is.EquivalentTo payloads)
+ // finally
+ // Instance.Visits.Clear())
+ // GetMyMethodName "<="
[]
let OldDocumentStartIsNotUpdated() =
diff --git a/Recorder.Tests/Tracer.Tests.fs b/Recorder.Tests/Tracer.Tests.fs
index 4c22012df..7f787c21a 100644
--- a/Recorder.Tests/Tracer.Tests.fs
+++ b/Recorder.Tests/Tracer.Tests.fs
@@ -30,7 +30,7 @@ module AltCoverCoreTests =
let mutable client = Tracer.Create unique
try
client <- client.OnStart()
- Assert.True(client.IsConnected() |> not)
+ Assert.True(client.IsConnected |> not)
with _ ->
client.Close()
reraise()
@@ -44,7 +44,7 @@ module AltCoverCoreTests =
let mutable client = Tracer.Create unique
try
client <- client.OnStart()
- Assert.True(client.IsConnected())
+ Assert.True(client.IsConnected)
finally
client.Close()
@@ -79,7 +79,7 @@ module AltCoverCoreTests =
if pts > 0 then
let p = formatter.ReadInt32()
let n = formatter.ReadInt64()
- let pv = PointVisit.Init(n, [])
+ let pv = Adapter.Init(n, [])
t.[m].Add(p, pv)
let rec tracking() =
let track = formatter.ReadByte() |> int
@@ -125,7 +125,7 @@ module AltCoverCoreTests =
try
Adapter.VisitsClear()
Instance.trace <- client.OnStart()
- Assert.True( Instance.trace.IsConnected(), "connection failed")
+ Assert.True( Instance.trace.IsConnected, "connection failed")
Instance.IsRunner <- true
Adapter.VisitImplNone("name", 23)
finally
@@ -157,8 +157,8 @@ module AltCoverCoreTests =
[ Adapter.Time 17L
Adapter.NewBoth(42L, 23) ]
- t.["name"].[23] <- PointVisit.Init(1L, expect23)
- t.["name"].[24] <- PointVisit.Init(2L, expect24)
+ t.["name"].[23] <- Adapter.Init(1L, expect23)
+ t.["name"].[24] <- Adapter.Init(2L, expect24)
let expected =
[ (String.Empty, 0, Adapter.Table t)
@@ -169,7 +169,7 @@ module AltCoverCoreTests =
let mutable client = Tracer.Create tag
try
Instance.trace <- client.OnStart()
- Assert.True( Instance.trace.IsConnected(), "connection failed")
+ Assert.True( Instance.trace.IsConnected, "connection failed")
Instance.IsRunner <- true
Adapter.VisitsClear()
@@ -258,7 +258,7 @@ module AltCoverCoreTests =
Instance.trace <- client.OnStart()
Assert.That(Instance.trace.Equals client, Is.False)
Assert.That(Instance.trace.Equals expected, Is.False)
- Assert.True(Instance.trace.IsConnected(), "connection failed")
+ Assert.True(Instance.trace.IsConnected, "connection failed")
let formatter = System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
let (a, b, c) = expected |> Seq.head
Instance.trace.Push(a, b, c)
diff --git a/Tests.Visualizer/GtkVisualizerTests.fs b/Tests.Visualizer/GtkVisualizerTests.fs
index b5e06c32d..4c4db1ad6 100644
--- a/Tests.Visualizer/GtkVisualizerTests.fs
+++ b/Tests.Visualizer/GtkVisualizerTests.fs
@@ -17,12 +17,11 @@ type AltCoverTests() =
[]
member self.AugmentNullableDetectNulls() =
let input = [ "string"; null; "another string" ]
- let nulls = input |> List.map (Option.nullable >> Option.isNone)
+ let nulls = input |> List.map (fun x -> x.IsNotNull |> not)
test <@ nulls = [ false; true; false ] @>
[]
- member self.AugmentGetOrElseFillsInNone() =
- let input = [ "string"; null; "another string" ]
- let strings = input |> List.map (Option.nullable >> (Option.getOrElse "fallback"))
- test <@ strings = [ "string"; "fallback"; "another string" ] @>
+ member self.AugmentNonNullableDetectNoNulls() =
+ let input = [ 1; 2 ;3 ]
+ test <@ input |> List.forall (fun x -> x.IsNotNull) @>
end
\ No newline at end of file
diff --git a/Tests/Program.fs b/Tests/Program.fs
index d0230c2a1..9589d2df4 100644
--- a/Tests/Program.fs
+++ b/Tests/Program.fs
@@ -1,6 +1,7 @@
namespace AltCover.Expecto.Tests
#if NETCOREAPP3_0
+open AltCover.Augment
open Expecto
open Mono.Cecil
open Mono.Cecil.Cil
@@ -15,7 +16,6 @@ module TestMain =
Tests.AltCoverRunnerTests.MaxTimeLast, "Runner.MaxTimeLast"
Tests.AltCoverRunnerTests.MinTimeFirst, "Runner.MinTimeFirst"
Tests.AltCoverRunnerTests.MinTimeLast, "Runner.MinTimeLast"
- Tests.AltCoverRunnerTests.SafeDisposalProtects, "Runner.SafeDisposalProtects"
Tests.AltCoverRunnerTests.JunkUspidGivesNegativeIndex, "Runner.JunkUspidGivesNegativeIndex"
Tests.AltCoverRunnerTests.RealIdShouldIncrementCount, "Runner.RealIdShouldIncrementCount"
Tests.AltCoverRunnerTests.RealIdShouldIncrementList, "Runner.RealIdShouldIncrementList"
@@ -464,7 +464,7 @@ module TestMain =
let testMethods = def.MainModule.GetTypes()
|> Seq.collect (fun t -> t.Methods)
- |> Seq.filter (fun m -> m.CustomAttributes |> isNull |> not)
+ |> Seq.filter (fun m -> m.CustomAttributes.IsNotNull)
|> Seq.filter (fun m -> m.CustomAttributes |> Seq.exists (fun a -> a.AttributeType.Name = "TestAttribute"))
|> Seq.map (fun m -> m.DeclaringType.FullName + "::" + m.Name)
diff --git a/Tests/Runner.Tests.fs b/Tests/Runner.Tests.fs
index 6837f30d6..08edab479 100644
--- a/Tests/Runner.Tests.fs
+++ b/Tests/Runner.Tests.fs
@@ -57,15 +57,6 @@ module AltCoverRunnerTests =
let ago = now - TimeSpan(1,0,0,0)
test <@ (Base.Counter.MinTime now ago) = ago @>
- []
- let SafeDisposalProtects() =
- Runner.init()
- let obj1 =
- { new System.IDisposable with
- member x.Dispose() = ObjectDisposedException("Bang!") |> raise }
- Assist.SafeDispose obj1
- test <@ true @>
-
#if NETCOREAPP2_0
#else
[]
@@ -179,6 +170,10 @@ module AltCoverRunnerTests =
|> Seq.find
(fun n -> n.EndsWith("Sample1WithOpenCover.xml", StringComparison.Ordinal))
+ let internal Init n l = let tmp = { PointVisit.Create() with Count = n }
+ tmp.Tracks.AddRange l
+ tmp
+
#if NETCOREAPP2_0
#else
[]
@@ -197,8 +192,8 @@ module AltCoverRunnerTests =
worker.Write(buffer, 0, size)
worker.Position <- 0L
let payload = Dictionary()
- [ 0..9 ] |> Seq.iter (fun i -> payload.[10 - i] <- PointVisit.Init (int64(i + 1)) [])
- [ 11..12 ] |> Seq.iter (fun i -> payload.[i ||| Counter.BranchFlag] <- PointVisit.Init (int64(i - 10)) [])
+ [ 0..9 ] |> Seq.iter (fun i -> payload.[10 - i] <- Init (int64(i + 1)) [])
+ [ 11..12 ] |> Seq.iter (fun i -> payload.[i ||| Counter.BranchFlag] <- Init (int64(i - 10)) [])
let item = Dictionary>()
item.Add("7C-CD-66-29-A3-6C-6D-5F-A7-65-71-0E-22-7D-B2-61-B5-1F-65-9A", payload)
Counter.UpdateReport ignore (fun _ _ -> ()) true item ReportFormat.OpenCover worker
@@ -244,7 +239,7 @@ module AltCoverRunnerTests =
worker.Write(buffer, 0, size)
()
let payload = Dictionary()
- [ 0..9 ] |> Seq.iter (fun i -> payload.[i] <- PointVisit.Init (int64(i + 1)) [])
+ [ 0..9 ] |> Seq.iter (fun i -> payload.[i] <- Init (int64(i + 1)) [])
visits.["f6e3edb3-fb20-44b3-817d-f69d1a22fc2f"] <- payload
Counter.DoFlush ignore (fun _ _ -> ()) true visits
AltCover.Base.ReportFormat.NCover reportFile None |> ignore
@@ -293,7 +288,7 @@ module AltCoverRunnerTests =
worker.Write(buffer, 0, size)
()
let payload = Dictionary()
- [ 0..9 ] |> Seq.iter (fun i -> payload.[i] <- PointVisit.Init (int64(i + 1)) [])
+ [ 0..9 ] |> Seq.iter (fun i -> payload.[i] <- Init (int64(i + 1)) [])
visits.["f6e3edb3-fb20-44b3-817d-f69d1a22fc2f"] <- payload
Counter.DoFlush ignore (fun _ _ -> ()) true visits
AltCover.Base.ReportFormat.NCover reportFile (Some outputFile) |> ignore
@@ -326,7 +321,7 @@ module AltCoverRunnerTests =
use stderr = new StringWriter()
Console.SetError stderr
let empty = OptionSet()
- CommandLine.Usage { Intro = "UsageError"; Options = empty; Options2 = options}
+ CommandLine.UsageBase { Intro = "UsageError"; Options = empty; Options2 = options}
let result = stderr.ToString().Replace("\r\n", "\n")
let expected = """Error - usage is:
-r, --recorderDirectory=VALUE
@@ -1901,11 +1896,11 @@ or
Assert.That(File.Exists(unique + ".acv"))
let expected = Dictionary>()
let a = Dictionary()
- a.Add(0, PointVisit.Init 1L [])
+ a.Add(0, Init 1L [])
let b = Dictionary()
- b.Add(1, PointVisit.Init 1L [])
+ b.Add(1, Init 1L [])
let c = Dictionary()
- c.Add(3, PointVisit.Init 1L [])
+ c.Add(3, Init 1L [])
expected.Add ("a", a)
expected.Add ("b", b)
expected.Add ("c", c)
@@ -1998,7 +1993,7 @@ or
Base.Time 42L
Base.Call 5 ]
- let pv = PointVisit.Init 42L (payloads0 |> List.tail)
+ let pv = Init 42L (payloads0 |> List.tail)
let table = Dictionary>()
table.Add("Extra", Dictionary())
table.["Extra"].Add(3, pv)
@@ -2191,8 +2186,8 @@ or
let visits = Dictionary>()
let visit = Dictionary()
visits.Add("6A-33-AA-93-82-ED-22-9D-F8-68-2C-39-5B-93-9F-74-01-76-00-9F", visit)
- visit.Add(100663297, PointVisit.Init 1L []) // should fill in the expected non-zero value
- visit.Add(100663298, PointVisit.Init 23L []) // should be ignored
+ visit.Add(100663297, Init 1L []) // should fill in the expected non-zero value
+ visit.Add(100663298, Init 23L []) // should be ignored
Runner.PostProcess visits Base.ReportFormat.OpenCover after
Assert.That
(after.OuterXml.Replace("uspid=\"100663298", "uspid=\"13"), Is.EqualTo before,
@@ -2681,7 +2676,7 @@ or
let baseline = XDocument.Load(stream)
let excluded = XName.Get "excluded"
baseline.Descendants()
- |> Seq.iter (fun x -> if x.Attribute(excluded) |> isNull |> not then
+ |> Seq.iter (fun x -> if x.Attribute(excluded).IsNotNull then
x.SetAttributeValue(excluded, "false"))
let unique =
Path.Combine
@@ -2839,7 +2834,7 @@ or
let baseline = XDocument.Load(stream)
let excluded = XName.Get "excluded"
baseline.Descendants()
- |> Seq.iter (fun x -> if x.Attribute(excluded) |> isNull |> not then
+ |> Seq.iter (fun x -> if x.Attribute(excluded) .IsNotNull then
x.SetAttributeValue(excluded, "false"))
let unique =
Path.Combine
diff --git a/Tests/Tests.fs b/Tests/Tests.fs
index 2097e12b5..6e1c84531 100644
--- a/Tests/Tests.fs
+++ b/Tests/Tests.fs
@@ -956,7 +956,7 @@ module AltCoverTests =
Visitor.reportFormat <- Some Base.ReportFormat.OpenCover
Visitor.NameFilters.Clear()
let deeper =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.None) |> Seq.toList
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.None) |> Seq.toList
Assert.That(deeper.Length, Is.EqualTo 3)
deeper
|> List.skip 1
@@ -1007,7 +1007,7 @@ module AltCoverTests =
Visitor.reportFormat <- Some Base.ReportFormat.OpenCover
Visitor.NameFilters.Clear()
let deeper =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.Automatic) |> Seq.toList
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.Automatic) |> Seq.toList
Assert.That(deeper.Length, Is.EqualTo 3)
deeper
|> List.skip 1
@@ -1361,12 +1361,12 @@ module AltCoverTests =
let inputs =
[ Node.Start []
- Node.Assembly(def, Inspect.Instrument, [])
- Node.Module(null, Inspect.Ignore)
- Node.Type(null, Inspect.Instrument, Exemption.None)
- Node.Method(null, Inspect.Ignore, None, Exemption.None)
+ Node.Assembly(def, Inspections.Instrument, [])
+ Node.Module(null, Inspections.Ignore)
+ Node.Type(null, Inspections.Instrument, Exemption.None)
+ Node.Method(null, Inspections.Ignore, None, Exemption.None)
Node.MethodPoint(null, None, 0, true, Exemption.None)
- Node.AfterMethod(null, Inspect.Ignore, None)
+ Node.AfterMethod(null, Inspections.Ignore, None)
Node.AfterModule
Node.AfterAssembly (def, [])
Node.Finish ]
@@ -1378,7 +1378,7 @@ module AltCoverTests =
[ AfterAssembly (def, []) ]
[ AfterModule ]
[ AfterType ]
- [ AfterMethod(null, Inspect.Ignore, None) ]
+ [ AfterMethod(null, Inspections.Ignore, None) ]
[]
[]
[]
@@ -1418,7 +1418,7 @@ module AltCoverTests =
let inputs =
[ Node.MethodPoint(null, None, 0, true, Exemption.None)
- Node.AfterMethod(null, Inspect.Ignore, None)
+ Node.AfterMethod(null, Inspections.Ignore, None)
Node.AfterModule
Node.AfterAssembly (def, [])
Node.Finish ]
@@ -1453,7 +1453,7 @@ module AltCoverTests =
>> FilterClass.Build FilterScope.File
>> Visitor.NameFilters.Add)
let deeper =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.None) |> Seq.toList
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.None) |> Seq.toList
Assert.That(deeper.Length, Is.EqualTo 12)
deeper
|> List.skip 10
@@ -1492,7 +1492,7 @@ module AltCoverTests =
Visitor.reportFormat <- Some Base.ReportFormat.OpenCover
Visitor.NameFilters.Clear()
let deeper =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.Declared)
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.Declared)
|> Seq.toList
//deeper |> List.skip 21 |> Seq.iter (fun n -> match n with
@@ -1553,7 +1553,7 @@ module AltCoverTests =
Visitor.NameFilters.Clear()
Visitor.coalesceBranches := true
let deeper =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.StaticAnalysis)
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.StaticAnalysis)
|> Seq.toList
let reported =
@@ -1599,14 +1599,14 @@ module AltCoverTests =
>> FilterRegex.Exclude
>> FilterClass.Build FilterScope.Method
>> Visitor.NameFilters.Add)
- let deeper = Visitor.Deeper <| Node.Type(type', Inspect.Instrument, Exemption.None) |> Seq.toList
+ let deeper = Visitor.Deeper <| Node.Type(type', Inspections.Instrument, Exemption.None) |> Seq.toList
Visitor.Visit [] [] // cheat reset
let expected =
type'.Methods
|> Seq.map (fun m ->
let flag =
- if m.Name = ".ctor" then Inspect.Instrument
- else Inspect.Ignore
+ if m.Name = ".ctor" then Inspections.Instrument
+ else Inspections.Ignore
let node = Node.Method(m, flag, None, Exemption.None)
List.concat [ [ node ]
@@ -1634,14 +1634,14 @@ module AltCoverTests =
>> FilterClass.Build FilterScope.Type
>> Visitor.NameFilters.Add)
let deeper =
- Visitor.Deeper <| Node.Module(module', Inspect.Instrument) |> Seq.toList
+ Visitor.Deeper <| Node.Module(module', Inspections.Instrument) |> Seq.toList
Visitor.Visit [] [] // cheat reset
let expected =
module'.Types // we have no nested types in this test
|> Seq.map (fun t ->
let flag =
- if t.Name <> "Program" then Inspect.Instrument
- else Inspect.Ignore
+ if t.Name <> "Program" then Inspections.Instrument
+ else Inspections.Ignore
let node = Node.Type(t, flag, Exemption.None)
List.concat [ [ node ]
@@ -1660,12 +1660,12 @@ module AltCoverTests =
let def = Mono.Cecil.AssemblyDefinition.ReadAssembly path
ProgramDatabase.ReadSymbols def
Visitor.Visit [] [] // cheat reset
- let deeper = Visitor.Deeper <| Node.Assembly(def, Inspect.Instrument, []) |> Seq.toList
+ let deeper = Visitor.Deeper <| Node.Assembly(def, Inspections.Instrument, []) |> Seq.toList
Visitor.Visit [] [] // cheat reset
let expected =
def.Modules // we have no nested types in this test
|> Seq.map (fun t ->
- let node = Node.Module(t, Inspect.Instrument)
+ let node = Node.Module(t, Inspections.Instrument)
List.concat [ [ node ]
(Visitor.Deeper >> Seq.toList) node
[ AfterModule ] ])
@@ -1684,12 +1684,12 @@ module AltCoverTests =
// assembly definitions care about being separate references in equality tests
let def =
match Seq.head deeper with
- | Node.Assembly(def', Inspect.Instrument, []) -> def'
+ | Node.Assembly(def', Inspections.Instrument, []) -> def'
| _ ->
Assert.Fail()
null
- let assembly = Node.Assembly(def, Inspect.Instrument, [])
+ let assembly = Node.Assembly(def, Inspections.Instrument, [])
let expected =
List.concat [ [ assembly ]
@@ -1716,12 +1716,12 @@ module AltCoverTests =
// assembly definitions care about being separate references in equality tests
let def =
match Seq.head deeper with
- | Node.Assembly(def', Inspect.Ignore, []) -> def'
+ | Node.Assembly(def', Inspections.Ignore, []) -> def'
| _ ->
Assert.Fail()
null
- let assembly = Node.Assembly(def, Inspect.Ignore, [])
+ let assembly = Node.Assembly(def, Inspections.Ignore, [])
let expected =
List.concat [ [ assembly ]
@@ -1786,12 +1786,12 @@ module AltCoverTests =
// assembly definitions care about being separate references in equality tests
let def =
match accumulator.[1] with
- | Node.Assembly(def', Inspect.Instrument, ux) -> def'
+ | Node.Assembly(def', Inspections.Instrument, ux) -> def'
| _ ->
Assert.Fail()
null
- let assembly = Node.Assembly(def, Inspect.Instrument, ux)
+ let assembly = Node.Assembly(def, Inspections.Instrument, ux)
let expected =
List.concat [ [ Start [ path, ux ]
@@ -2370,7 +2370,7 @@ module AltCoverTests =
>> FilterClass.Build FilterScope.File
>> Visitor.NameFilters.Add)
let branches =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.None)
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.None)
|> Seq.map (fun n ->
match n with
| BranchPoint b -> Some b
diff --git a/Tests/Tests2.fs b/Tests/Tests2.fs
index d55a0ef28..6e435d687 100644
--- a/Tests/Tests2.fs
+++ b/Tests/Tests2.fs
@@ -7,6 +7,7 @@ open System.Security
open System.Security.Cryptography
open AltCover
+open AltCover.Augment
open Mono.Cecil
open Mono.Cecil.Cil
open Mono.Cecil.Rocks
@@ -334,7 +335,7 @@ module AltCoverTests2 =
(fun f -> f.Name.IndexOf("Mono.Cecil", StringComparison.Ordinal) >= 0)
|> Seq.iter (fun f ->
let resolved = Instrument.HookResolveHandler.Invoke(null, f)
- test' <@ resolved |> isNull |> not @> <| f.ToString())
+ test' <@ resolved.IsNotNull @> <| f.ToString())
raw.MainModule.AssemblyReferences
|> Seq.filter
(fun f -> f.Name.IndexOf("Mono.Cecil", StringComparison.Ordinal) >= 0)
@@ -355,7 +356,7 @@ module AltCoverTests2 =
|> Seq.iter (fun f ->
f.Version <- System.Version("666.666.666.666")
let resolved = Instrument.HookResolveHandler.Invoke(null, f)
- test' <@ resolved |> isNull |> not @> <| f.ToString())
+ test' <@ resolved .IsNotNull @> <| f.ToString())
finally
Instrument.ResolutionTable.Clear()
@@ -489,7 +490,7 @@ module AltCoverTests2 =
" " + alter + " <= Sample3.g, Version=0.0.0.0, Culture=neutral, PublicKeyToken=4ebffcaabf10ce6a"
]
Assert.That(traces, Is.EquivalentTo expectedTraces)
- let expectedSymbols = if "Mono.Runtime" |> Type.GetType |> isNull |> not then ".dll.mdb" else ".pdb"
+ let expectedSymbols = if ("Mono.Runtime" |> Type.GetType).IsNotNull then ".dll.mdb" else ".pdb"
let isWindows =
#if NETCOREAPP2_0
false // recorder symbols not read here
@@ -931,7 +932,7 @@ module AltCoverTests2 =
|> Seq.length
let handlersBefore = recorder.Head.Body.ExceptionHandlers.Count
- AltCover.Instrument.Track state recorder.Head Inspect.Track <| Some(42, "hello")
+ AltCover.Instrument.Track state recorder.Head Inspections.Track <| Some(42, "hello")
Assert.That
(recorder.Head.Body.Instructions.Count, Is.EqualTo(countBefore + 5 - tailsBefore))
Assert.That
@@ -977,7 +978,7 @@ module AltCoverTests2 =
|> Seq.length
let handlersBefore = target.Body.ExceptionHandlers.Count
- AltCover.Instrument.Track state target Inspect.Track <| Some(42, "hello")
+ AltCover.Instrument.Track state target Inspections.Track <| Some(42, "hello")
Assert.That
(target.Body.Instructions.Count, Is.EqualTo(countBefore + 5 - tailsBefore))
Assert.That(target.Body.ExceptionHandlers.Count, Is.EqualTo(handlersBefore + 1))
@@ -1030,7 +1031,7 @@ module AltCoverTests2 =
|> Array.map (fun i -> i.Offset)
Assert.That (targets, Is.EquivalentTo [ 31; 33; 31; 33; 31 ])
- let m = Node.Method (target, Inspect.Instrument, None, Exemption.None)
+ let m = Node.Method (target, Inspections.Instrument, None, Exemption.None)
let steps = Visitor.BuildSequence m
Assert.That(steps, Is.Not.Empty)
@@ -1082,7 +1083,7 @@ module AltCoverTests2 =
let state = AltCover.InstrumentContext.Build([])
let countBefore = recorder.Head.Body.Instructions.Count
let handlersBefore = recorder.Head.Body.ExceptionHandlers.Count
- AltCover.Instrument.Track state recorder.Head Inspect.Track None
+ AltCover.Instrument.Track state recorder.Head Inspections.Track None
Assert.That(recorder.Head.Body.Instructions.Count, Is.EqualTo countBefore)
Assert.That(recorder.Head.Body.ExceptionHandlers.Count, Is.EqualTo handlersBefore)
@@ -1100,7 +1101,7 @@ module AltCoverTests2 =
try
Visitor.reportFormat <- Some Base.ReportFormat.OpenCover
let branches =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.None)
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.None)
|> Seq.map (fun n ->
match n with
| BranchPoint b -> Some b
@@ -1159,7 +1160,7 @@ module AltCoverTests2 =
try
Visitor.reportFormat <- Some Base.ReportFormat.OpenCover
let branches =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.None)
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.None)
|> Seq.map (fun n ->
match n with
| BranchPoint b -> Some b
@@ -1217,7 +1218,7 @@ module AltCoverTests2 =
try
Visitor.reportFormat <- Some Base.ReportFormat.OpenCover
let branches =
- Visitor.Deeper <| Node.Method(method, Inspect.Instrument, None, Exemption.None)
+ Visitor.Deeper <| Node.Method(method, Inspections.Instrument, None, Exemption.None)
|> Seq.map (fun n ->
match n with
| BranchPoint b -> Some b
@@ -1266,14 +1267,14 @@ module AltCoverTests2 =
let TypeShouldNotChangeState() =
let input = InstrumentContext.Build []
let output =
- Instrument.InstrumentationVisitor input (Node.Type(null, Inspect.Ignore, Exemption.None))
+ Instrument.InstrumentationVisitor input (Node.Type(null, Inspections.Ignore, Exemption.None))
Assert.That(output, Is.SameAs input)
[]
let ExcludedMethodShouldNotChangeState() =
let input = InstrumentContext.Build []
let output =
- Instrument.InstrumentationVisitor input (Node.Method(null, Inspect.Ignore, None, Exemption.None))
+ Instrument.InstrumentationVisitor input (Node.Method(null, Inspections.Ignore, None, Exemption.None))
Assert.That(output, Is.SameAs input)
[]
@@ -1294,7 +1295,7 @@ module AltCoverTests2 =
let input = InstrumentContext.Build []
let output =
Instrument.InstrumentationVisitor input
- (Node.Method(func, Inspect.Instrument, None, Exemption.None))
+ (Node.Method(func, Inspections.Instrument, None, Exemption.None))
Assert.That(output.MethodBody, Is.SameAs func.Body)
[]
@@ -1325,7 +1326,7 @@ module AltCoverTests2 =
let diff = paired |> List.map (fun (i, j) -> (i, i = j.OpCode))
let output =
Instrument.InstrumentationVisitor input
- (Node.AfterMethod(func, Inspect.Ignore, None))
+ (Node.AfterMethod(func, Inspections.Ignore, None))
Assert.That(output, Is.SameAs input)
let paired' = Seq.zip diff input.MethodBody.Instructions
Assert.That(paired' |> Seq.forall (fun ((i, x), j) -> x = (i = j.OpCode)))
@@ -1357,7 +1358,7 @@ module AltCoverTests2 =
Assert.That(paired |> Seq.exists (fun (i, j) -> i <> j.OpCode))
let output =
Instrument.InstrumentationVisitor input
- (Node.AfterMethod(func, Inspect.Instrument, None))
+ (Node.AfterMethod(func, Inspections.Instrument, None))
Assert.That(output, Is.SameAs input)
let paired' = Seq.zip opcodes input.MethodBody.Instructions
Assert.That(paired' |> Seq.forall (fun (i, j) -> i = j.OpCode))
@@ -1545,7 +1546,7 @@ module AltCoverTests2 =
Mono.Cecil.AssemblyDefinition.ReadAssembly
(Assembly.GetExecutingAssembly().Location)
let state = InstrumentContext.Build [ "nunit.framework"; "nonesuch" ]
- let visited = Node.Assembly(def, Inspect.Ignore, [])
+ let visited = Node.Assembly(def, Inspections.Ignore, [])
let result =
Instrument.InstrumentationVisitor { state with RecordingAssembly = fake } visited
Assert.That(def.MainModule.AssemblyReferences, Is.EquivalentTo refs)
@@ -1571,7 +1572,7 @@ module AltCoverTests2 =
Mono.Cecil.AssemblyDefinition.ReadAssembly
(Assembly.GetExecutingAssembly().Location)
let state = InstrumentContext.Build [ "nunit.framework"; "nonesuch" ]
- let visited = Node.Assembly(def, Inspect.Instrument, [])
+ let visited = Node.Assembly(def, Inspections.Instrument, [])
let result =
Instrument.InstrumentationVisitor { state with RecordingAssembly = fake } visited
Assert.That
@@ -1584,7 +1585,7 @@ module AltCoverTests2 =
Path.Combine(Path.GetDirectoryName(where) + AltCoverTests.Hack(), "Sample2.dll")
let def = Mono.Cecil.AssemblyDefinition.ReadAssembly path
ProgramDatabase.ReadSymbols def
- let visited = Node.Module(def.MainModule, Inspect.Ignore)
+ let visited = Node.Module(def.MainModule, Inspections.Ignore)
let state = InstrumentContext.Build [ "nunit.framework"; "nonesuch" ]
let result = Instrument.InstrumentationVisitor state visited
Assert.That
@@ -1597,7 +1598,7 @@ module AltCoverTests2 =
Path.Combine(Path.GetDirectoryName(where) + AltCoverTests.Hack(), "Sample2.dll")
let def = Mono.Cecil.AssemblyDefinition.ReadAssembly path
ProgramDatabase.ReadSymbols def
- let visited = Node.Module(def.MainModule, Inspect.Instrument)
+ let visited = Node.Module(def.MainModule, Inspections.Instrument)
let state = InstrumentContext.Build [ "nunit.framework"; "nonesuch" ]
let path' =
Path.Combine
@@ -1703,7 +1704,7 @@ module AltCoverTests2 =
Path.Combine(Path.GetDirectoryName(where) + AltCoverTests.Hack(), "Sample2.dll")
let def = Mono.Cecil.AssemblyDefinition.ReadAssembly path
ProgramDatabase.ReadSymbols def
- let visited = Node.Module(def.MainModule, Inspect.Instrument)
+ let visited = Node.Module(def.MainModule, Inspections.Instrument)
let state = InstrumentContext.Build [ "nunit.framework"; "nonesuch" ]
let path' =
Path.Combine
@@ -1886,9 +1887,13 @@ module AltCoverTests2 =
[]
let OutputCanBeExercised() =
let sink = StringSink(ignore)
- Output.SetInfo sink
- Output.SetError sink
- Output.SetWarn sink
+ let SetInfo(x : StringSink) = Output.Info <- x.Invoke
+ let SetError(x : StringSink) = Output.Error <- x.Invoke
+ let SetWarn(x : StringSink) = Output.Warn <- x.Invoke
+
+ SetInfo sink
+ SetError sink
+ SetWarn sink
Output.Echo <- ignore
Output.Usage <- ignore
Assert.That(Output.Usage, Is.Not.Null)
@@ -1898,8 +1903,7 @@ module AltCoverTests2 =
|> Seq.collect (fun t -> t.GetNestedTypes(BindingFlags.NonPublic))
|> Seq.filter (fun t ->
let tokens =
- [ "Info"; "Echo"; "Error"; "Usage"; "Warn"; "ToConsole"; "SetInfo";
- "SetError"; "SetWarn" ]
+ [ "Info"; "Echo"; "Error"; "Usage"; "Warn"; "ToConsole" ]
let name = t.Name
tokens |> List.exists name.StartsWith)
|> Seq.iter (fun t ->
diff --git a/Tests/Tests3.fs b/Tests/Tests3.fs
index 618cf40b6..14adb77c0 100644
--- a/Tests/Tests3.fs
+++ b/Tests/Tests3.fs
@@ -2114,10 +2114,8 @@ module AltCoverTests3 =
let PreparingNewPlaceShouldCopyEverything() =
Main.init()
let monoRuntime =
- "Mono.Runtime"
- |> Type.GetType
- |> isNull
- |> not
+ ("Mono.Runtime"
+ |> Type.GetType).IsNotNull
// because mono symbol-writing is broken, work around trying to
// examine the instrumented files in a self-test run.
let here = if monoRuntime
@@ -2283,7 +2281,7 @@ module AltCoverTests3 =
use stderr = new StringWriter()
Console.SetError stderr
let empty = OptionSet()
- CommandLine.Usage { Intro = "UsageError"; Options = options; Options2 = empty }
+ CommandLine.UsageBase { Intro = "UsageError"; Options = options; Options2 = empty }
let result = stderr.ToString().Replace("\r\n", "\n")
let expected = """Error - usage is:
-i, --inputDirectory=VALUE Optional, multiple: A folder containing assemblies
diff --git a/Tests/XTests.fs b/Tests/XTests.fs
index 2c4d41b08..4d966fb1e 100644
--- a/Tests/XTests.fs
+++ b/Tests/XTests.fs
@@ -8,6 +8,7 @@ open System.Text.RegularExpressions
open System.Xml.Linq
open AltCover
+open AltCover.Augment
open Mono.Options
open Newtonsoft.Json.Linq
open Swensen.Unquote
@@ -158,7 +159,7 @@ module AltCoverXTests =
let instance = FSApi.CollectParams.Primitive subject
let scan = instance.Validate(false)
test <@ scan.Length = 0 @>
- test <@ instance.GetHashCode() :> obj |> isNull |> not @> // gratuitous coverage for coverlet
+ test <@ (instance.GetHashCode() :> obj).IsNotNull @> // gratuitous coverage for coverlet
test <@ (FSApi.CollectParams.Primitive subject)
|> FSApi.Args.Collect = [ "Runner"; "-t"; "23"; "--collect" ] @>
@@ -171,7 +172,7 @@ module AltCoverXTests =
Executable = TypeSafe.Tool "dotnet" }
let instance = FSApi.CollectParams.TypeSafe subject
- test <@ instance.GetHashCode() :> obj |> isNull |> not @> // gratuitous coverage for coverlet
+ test <@ (instance.GetHashCode() :> obj).IsNotNull @> // gratuitous coverage for coverlet
let scan = instance.Validate(false)
test <@ scan.Length = 0 @>
@@ -179,7 +180,7 @@ module AltCoverXTests =
<@ instance
|> FSApi.Args.Collect = [ "Runner"; "-x"; "dotnet"; "-t"; "23"; "--teamcity:+B" ] @>
let validate = instance.WhatIf(false)
- test <@ validate.GetHashCode() :> obj |> isNull |> not @> // gratuitous coverage for coverlet
+ test <@ (validate.GetHashCode() :> obj).IsNotNull @> // gratuitous coverage for coverlet
test <@ validate.ToString() = "altcover Runner -x dotnet -t 23 --teamcity:+B" @>
[]
@@ -237,7 +238,7 @@ module AltCoverXTests =
let instance = FSApi.PrepareParams.Primitive subject
let scan = instance.Validate()
test <@ scan.Length = 0 @>
- test <@ instance.GetHashCode() :> obj |> isNull |> not @> // gratuitous coverage for coverlet
+ test <@ (instance.GetHashCode() :> obj).IsNotNull @> // gratuitous coverage for coverlet
let rendered = (FSApi.PrepareParams.Primitive subject) |> FSApi.Args.Prepare
let location = Assembly.GetExecutingAssembly().Location
test
@@ -273,7 +274,7 @@ module AltCoverXTests =
TypeSafe.Filters [| TypeSafe.Raw "ok" |] }
let instance = FSApi.PrepareParams.TypeSafe subject
- test <@ instance.GetHashCode() :> obj |> isNull |> not @> // gratuitous coverage for coverlet
+ test <@ (instance.GetHashCode() :> obj).IsNotNull @> // gratuitous coverage for coverlet
let scan = instance.Validate()
test <@ scan.Length = 0 @>
diff --git a/WeakNameTests/Tests.fs b/WeakNameTests/Tests.fs
index ae8082db3..a85a81f0d 100644
--- a/WeakNameTests/Tests.fs
+++ b/WeakNameTests/Tests.fs
@@ -129,6 +129,7 @@ type AltCoverTests() =
member self.GratuitousCoverage() =
let l = Left 23
let r = Right true
+ test <@ (23).IsNotNull @>
let output =
[ r; l ]
diff --git a/altcover.core.sln b/altcover.core.sln
index 34829ce14..22e55d35b 100644
--- a/altcover.core.sln
+++ b/altcover.core.sln
@@ -50,6 +50,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Items", "Build Items"
Build\Apply-Xslt.ps1 = Build\Apply-Xslt.ps1
appveyor.yml = appveyor.yml
Build\build.fsx = Build\build.fsx
+ Build\common-rules.xml = Build\common-rules.xml
Build\get-token.fsx = Build\get-token.fsx
global.json = global.json
Build\Infrastructure.snk = Build\Infrastructure.snk
@@ -59,9 +60,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Items", "Build Items"
Build\powershell.ps1 = Build\powershell.ps1
Build\Recorder.snk = Build\Recorder.snk
ReleaseNotes.md = ReleaseNotes.md
- Build\rules-fake.xml = Build\rules-fake.xml
- Build\rules-posh.xml = Build\rules-posh.xml
- Build\rules.xml = Build\rules.xml
Build\SelfTest.snk = Build\SelfTest.snk
Build\setup.fsx = Build\setup.fsx
Build\targets.fsx = Build\targets.fsx