diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 490aff5fb..590a70919 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
- "version": "4.8.13",
+ "version": "5.0.0",
"commands": [
"reportgenerator"
]
@@ -27,7 +27,7 @@
]
},
"dotnet-fsharplint": {
- "version": "0.20.2",
+ "version": "0.21.0",
"commands": [
"dotnet-fsharplint"
]
diff --git a/AltCover.Api.Tests/AltCover.Api.Tests.fsproj b/AltCover.Api.Tests/AltCover.Api.Tests.fsproj
index b1561e51e..f7e4049ba 100644
--- a/AltCover.Api.Tests/AltCover.Api.Tests.fsproj
+++ b/AltCover.Api.Tests/AltCover.Api.Tests.fsproj
@@ -7,13 +7,8 @@
false
Exe
Library
-
$(AssemblySearchPaths);{GAC}
- $(SolutionDir)_Binaries/$(AssemblyName)/$(Configuration)+$(Platform)/
- $(SolutionDir)_Intermediate/$(AssemblyName)/$(Configuration)+$(Platform)/
- --keyfile:$(ProjectDir)..\Build\Infrastructure.snk
DEBUG;TRACE
- Major
@@ -72,7 +67,7 @@
-
+
diff --git a/AltCover.Api.Tests/FSApiTests.fs b/AltCover.Api.Tests/FSApiTests.fs
index 177b616c6..a134c7207 100644
--- a/AltCover.Api.Tests/FSApiTests.fs
+++ b/AltCover.Api.Tests/FSApiTests.fs
@@ -161,7 +161,10 @@ module FSApiTests =
let doc = XDocument.Load(stream)
use stream2 = new MemoryStream()
CoverageFormats.ConvertToLcov doc stream2
- use stream2a = new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
+ use stream2a =
+ new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
use rdr = new StreamReader(stream2a)
let result =
@@ -190,7 +193,10 @@ module FSApiTests =
let doc = XDocument.Load(stream)
use stream2 = new MemoryStream()
CoverageFormats.ConvertToLcov doc stream2
- use stream2a = new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
+ use stream2a =
+ new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
use rdr = new StreamReader(stream2a)
let result =
@@ -252,8 +258,8 @@ module FSApiTests =
.Replace('\r', '\u00FF')
.Replace('\n', '\u00FF')
.Replace("\u00FF\u00FF", "\u00FF")
- .Replace("8.12", "8.13") // CRAP score rounding
- .Replace("4.12", "4.13") // CRAP score rounding
+ .Replace("8.12", "8.13") // CRAP score rounding
+ .Replace("4.12", "4.13") // CRAP score rounding
.Trim([| '\u00FF' |]) = expected
.Replace('\r', '\u00FF')
.Replace('\n', '\u00FF')
@@ -309,7 +315,7 @@ module FSApiTests =
.Trim([| '\u00FF' |]) @>
[]
- let JsonFromCoverletShouldHaveBranchExitValuesOK() =
+ let JsonFromCoverletShouldHaveBranchExitValuesOK () =
use stream =
Assembly
.GetExecutingAssembly()
@@ -319,8 +325,9 @@ module FSApiTests =
use reader = new StreamReader(stream)
reader.ReadToEnd()
- let result = "\u00FF" +
- (OpenCover.JsonToXml doc).ToString()
+ let result =
+ "\u00FF"
+ + (OpenCover.JsonToXml doc).ToString()
use stream3 =
Assembly
@@ -613,8 +620,10 @@ module FSApiTests =
use rdr = new StreamReader(mstream2)
let result =
- rdr.ReadToEnd().Replace("\r", String.Empty)
- .Replace("ID0ES", "ID0ET") // flakiness in label autogenerator
+ rdr
+ .ReadToEnd()
+ .Replace("\r", String.Empty)
+ .Replace("ID0ES", "ID0ET") // flakiness in label autogenerator
use stream2 =
Assembly
@@ -687,6 +696,7 @@ module FSApiTests =
// fix up file path
let exe =
Path.Combine(SolutionRoot.location, "AltCover.Tests/SimpleMix.exe")
+
doc.Descendants("ModulePath".X)
|> Seq.iter (fun x -> x.Value <- exe |> Canonical.canonicalPath)
@@ -735,6 +745,9 @@ module FSApiTests =
Visitor.visit
visitors
[ { AssemblyPath = sample
+ Identity =
+ { Assembly = String.Empty
+ Configuration = String.Empty }
Destinations = [] } ]
let document =
@@ -758,12 +771,12 @@ module FSApiTests =
let exe =
Path.Combine(SolutionRoot.location, "AltCover.Tests/SimpleMix.exe")
- let document =
- XDocument.Load stream
+ let document = XDocument.Load stream
let now = DateTime.UtcNow.ToLongDateString()
let rewrite =
CoverageFormats.ConvertFromNCover document [ exe ]
+
rewrite.Descendants("ModuleTime".X)
|> Seq.iter (fun x -> x.Value <- now)
@@ -781,12 +794,16 @@ module FSApiTests =
use stream2 =
Assembly
.GetExecutingAssembly()
- .GetManifestResourceStream("AltCover.Api.Tests.OpenCoverFromNCoverWithPartials.xml")
+ .GetManifestResourceStream(
+ "AltCover.Api.Tests.OpenCoverFromNCoverWithPartials.xml"
+ )
use rdr2 = new StreamReader(stream2)
let doc2 = XDocument.Load rdr2
+
doc2.Descendants("ModulePath".X)
|> Seq.iter (fun x -> x.Value <- exe |> Canonical.canonicalPath)
+
doc2.Descendants("ModuleTime".X)
|> Seq.iter (fun x -> x.Value <- now)
@@ -797,9 +814,7 @@ module FSApiTests =
use rdr3 = new StreamReader(stream3)
let expected =
- rdr3
- .ReadToEnd()
- .Replace("\r", String.Empty)
+ rdr3.ReadToEnd().Replace("\r", String.Empty)
//printfn "%A" result
NUnit.Framework.Assert.That(result, NUnit.Framework.Is.EqualTo expected)
@@ -903,7 +918,10 @@ module FSApiTests =
let cob = CoverageFormats.ConvertToCobertura doc
use stream2 = new MemoryStream()
cob.Save stream2
- use stream2a = new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
+ use stream2a =
+ new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
use rdr = new StreamReader(stream2a)
let result =
@@ -953,13 +971,17 @@ module FSApiTests =
let cob = CoverageFormats.ConvertToCobertura doc
use stream2 = new MemoryStream()
cob.Save stream2
- use stream2a = new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
+ use stream2a =
+ new MemoryStream(stream2.GetBuffer(), 0, int stream2.Length)
+
use rdr = new StreamReader(stream2a)
let result =
- rdr.ReadToEnd()
- .Replace("\r", String.Empty)
- .Replace("\\", "/")
+ rdr
+ .ReadToEnd()
+ .Replace("\r", String.Empty)
+ .Replace("\\", "/")
//printfn "FSApi.NCoverToCobertura\r\n%s" result
@@ -1346,7 +1368,12 @@ module FSApiTests =
let doc2 = XDocument.Load stream2
- let merge = AltCover.OpenCover.Merge [ doc1; doc2; doc1; doc2 ]
+ let merge =
+ AltCover.OpenCover.Merge [ doc1
+ doc2
+ doc1
+ doc2 ]
+
let summary = merge.Root.Element(XName.Get "Summary")
//printfn "%A" merge
diff --git a/AltCover.Api.Tests/Program.fs b/AltCover.Api.Tests/Program.fs
index d29c4a97c..b634d1397 100644
--- a/AltCover.Api.Tests/Program.fs
+++ b/AltCover.Api.Tests/Program.fs
@@ -13,23 +13,30 @@ module ExpectoMain =
Tests.FSApiTests.PostprocessShouldRestoreBranchOnlyOpenCoverState,
"FSApiTests.PostprocessShouldRestoreBranchOnlyOpenCoverState"
Tests.FSApiTests.JsonToOpenCover, "FSApiTests.JsonToOpenCover"
- Tests.FSApiTests.JsonWithPartialsToOpenCover, "FSApiTests.JsonWithPartialsToOpenCover"
- Tests.FSApiTests.JsonFromCoverletShouldHaveBranchExitValuesOK, "FSApiTests.JsonFromCoverletShouldHaveBranchExitValuesOK"
+ Tests.FSApiTests.JsonWithPartialsToOpenCover,
+ "FSApiTests.JsonWithPartialsToOpenCover"
+ Tests.FSApiTests.JsonFromCoverletShouldHaveBranchExitValuesOK,
+ "FSApiTests.JsonFromCoverletShouldHaveBranchExitValuesOK"
Tests.FSApiTests.OpenCoverToJson, "FSApiTests.OpenCoverToJson"
- Tests.FSApiTests.OpenCoverWithPartialsToJson, "FSApiTests.OpenCoverWithPartialsToJson"
+ Tests.FSApiTests.OpenCoverWithPartialsToJson,
+ "FSApiTests.OpenCoverWithPartialsToJson"
Tests.FSApiTests.OpenCoverToLcov, "FSApiTests.OpenCoverToLcov"
- Tests.FSApiTests.OpenCoverWithPartialsToLcov, "FSApiTests.OpenCoverWithPartialsToLcov"
+ Tests.FSApiTests.OpenCoverWithPartialsToLcov,
+ "FSApiTests.OpenCoverWithPartialsToLcov"
Tests.FSApiTests.OpenCoverToBarChart, "FSApiTests.OpenCoverToBarChart"
Tests.FSApiTests.OpenCoverToNCover, "FSApiTests.OpenCoverToNCover"
- Tests.FSApiTests.OpenCoverWithPartialsToNCover, "FSApiTests.OpenCoverWithPartialsToNCover"
+ Tests.FSApiTests.OpenCoverWithPartialsToNCover,
+ "FSApiTests.OpenCoverWithPartialsToNCover"
Tests.FSApiTests.OpenCoverFromNCover, "FSApiTests.OpenCoverFromNCover"
- Tests.FSApiTests.OpenCoverFromNCoverWithPartials, "FSApiTests.OpenCoverFromNCoverWithPartials"
+ Tests.FSApiTests.OpenCoverFromNCoverWithPartials,
+ "FSApiTests.OpenCoverFromNCoverWithPartials"
Tests.FSApiTests.FormatsConvertToXmlDocument,
"FSApiTests.FormatsConvertToXmlDocument"
Tests.FSApiTests.FormatsConvertToXDocument, "FSApiTests.FormatsConvertToXDocument"
Tests.FSApiTests.FormatsRoundTripSimply, "FSApiTests.FormatsRoundTripSimply"
Tests.FSApiTests.NCoverToCobertura, "FSApiTests.NCoverToCobertura"
- Tests.FSApiTests.NCoverWithPartialsToCobertura, "FSApiTests.NCoverWithPartialsToCobertura"
+ Tests.FSApiTests.NCoverWithPartialsToCobertura,
+ "FSApiTests.NCoverWithPartialsToCobertura"
Tests.FSApiTests.NCoverToJson, "FSApiTests.NCoverToJson"
Tests.FSApiTests.NCoverWithPartialsToJson, "FSApiTests.NCoverWithPartialsToJson"
Tests.FSApiTests.NCoverToJsonWithEmbeds, "FSApiTests.NCoverToJsonWithEmbeds"
diff --git a/AltCover.Avalonia.FuncUI/AltCover.Avalonia.FuncUI.fsproj b/AltCover.Avalonia.FuncUI/AltCover.Avalonia.FuncUI.fsproj
index c1eeeb210..1bbbb7494 100644
--- a/AltCover.Avalonia.FuncUI/AltCover.Avalonia.FuncUI.fsproj
+++ b/AltCover.Avalonia.FuncUI/AltCover.Avalonia.FuncUI.fsproj
@@ -8,34 +8,13 @@
false
True
altcover.visualizer
- true
AVALONIA
- $(ProjectDir)..\_Binaries/$(AssemblyName).FuncUI/$(Configuration)+$(Platform)/
- $(ProjectDir)..\_Intermediate/$(AssemblyName).FuncUI/$(Configuration)+$(Platform)/
- --keyfile:$(ProjectDir)..\Build\Infrastructure.snk
- Major
- false
-
-
-
- false
- false
-
-
- true
- true
TRACE;DEBUG;CODE_ANALYSIS;$(GlobalDefineConstants)
- true
- 5
- true
-
- 52
- true
TRACE;$(GlobalDefineConstants)
diff --git a/AltCover.Avalonia/AltCover.Avalonia.fsproj b/AltCover.Avalonia/AltCover.Avalonia.fsproj
index 41da1f31c..9602c37df 100644
--- a/AltCover.Avalonia/AltCover.Avalonia.fsproj
+++ b/AltCover.Avalonia/AltCover.Avalonia.fsproj
@@ -5,39 +5,17 @@
netcoreapp2.1
AltCover.Visualizer
AltCover.Visualizer
- false
True
altcover.visualizer
- true
- AVALONIA
- $(ProjectDir)..\_Binaries/$(AssemblyName).Avalonia/$(Configuration)+$(Platform)/
- $(ProjectDir)..\_Intermediate/$(AssemblyName).Avalonia/$(Configuration)+$(Platform)/
- --keyfile:$(ProjectDir)..\Build\Infrastructure.snk
+ AVALONIA;$(TOGGLE)
True
$(ProjectDir)../AltCover.Visualizer/Resource.res
- Major
- false
-
-
-
- false
- false
-
-
- true
- true
TRACE;DEBUG;CODE_ANALYSIS;$(GlobalDefineConstants)
- true
- 5
- true
-
- 52
- true
TRACE;$(GlobalDefineConstants)
diff --git a/AltCover.Avalonia/MainWindow.fs b/AltCover.Avalonia/MainWindow.fs
index 1542db99b..a0a5a26d2 100644
--- a/AltCover.Avalonia/MainWindow.fs
+++ b/AltCover.Avalonia/MainWindow.fs
@@ -23,7 +23,7 @@ type MainWindow() as this =
inherit Window()
let mutable armed = false
let mutable justOpened = String.Empty
- let mutable coverageFiles : string list = []
+ let mutable coverageFiles: string list = []
let ofd = OpenFileDialog()
let iconMaker (x: Stream) = new Bitmap(x)
let icons = Icons(iconMaker)
@@ -41,15 +41,34 @@ type MainWindow() as this =
let notVisited = SolidColorBrush.Parse "#DC143C" // "#F5F5F5"// Crimson on White Smoke
let excluded = SolidColorBrush.Parse "#87CEEB" // "#F5F5F5" // Sky Blue on White Smoke
- let makeTreeNode leaf name icon =
+ let makeTreeNode pc leaf name icon =
let tree = Image()
- tree.Source <- if leaf
- then icons.Blank.Force()
- else icons.TreeExpand.Force()
+
+ tree.Source <-
+ if leaf then
+ icons.Blank.Force()
+ else
+ icons.TreeExpand.Force()
+
tree.Margin <- Thickness.Parse("2")
let text = TextBlock()
text.Text <- name
text.Margin <- Thickness.Parse("2")
+#if !VIS_PERCENT
+ pc |> ignore
+#else
+ let note = TextBlock()
+ note.Text <- pc
+ note.HorizontalAlignment <- Avalonia.Layout.HorizontalAlignment.Right
+ note.VerticalAlignment <- Avalonia.Layout.VerticalAlignment.Bottom
+ text.VerticalAlignment <- Avalonia.Layout.VerticalAlignment.Bottom
+ note.Margin <- Thickness.Parse("2")
+
+ let logfont =
+ LogFont.TryParse(Persistence.readFont ()) |> snd
+
+ note.FontFamily <- FontFamily(logfont.faceName)
+#endif
let image = Image()
image.Source <- icon
image.Margin <- Thickness.Parse("2")
@@ -57,6 +76,9 @@ type MainWindow() as this =
display.Orientation <- Avalonia.Layout.Orientation.Horizontal
display.Children.Add tree
display.Children.Add image
+#if VIS_PERCENT
+ display.Children.Add note
+#endif
display.Children.Add text
display.Tag <- name
display
@@ -312,7 +334,8 @@ type MainWindow() as this =
}
|> Async.Start
- with x ->
+ with
+ | x ->
let caption = Resource.GetResourceString "LoadError"
this.ShowMessageBox MessageType.Error caption x.Message
@@ -489,7 +512,7 @@ type MainWindow() as this =
this.FindControl