Skip to content

Commit

Permalink
Merge branch 'develop/Habu' into release/Habu
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Nov 27, 2021
2 parents 3236ac5 + b202535 commit 2ae70ce
Show file tree
Hide file tree
Showing 166 changed files with 8,659 additions and 7,095 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "4.8.13",
"version": "5.0.0",
"commands": [
"reportgenerator"
]
Expand All @@ -27,7 +27,7 @@
]
},
"dotnet-fsharplint": {
"version": "0.20.2",
"version": "0.21.0",
"commands": [
"dotnet-fsharplint"
]
Expand Down
7 changes: 1 addition & 6 deletions AltCover.Api.Tests/AltCover.Api.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
<GenerateProgramFile>false</GenerateProgramFile>
<OutputType Condition="'$(TargetFramework)' != 'net472'">Exe</OutputType>
<OutputType Condition="'$(TargetFramework)' == 'net472'">Library</OutputType>
<!-- NO!! SolutionDir Condition="'$(SolutionDir)' == '$(ProjectDir)'">$(ProjectDir)../</SolutionDir -->
<AssemblySearchPaths Condition="'$(TargetFramework)' == 'net472'">$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
<OutputPath>$(SolutionDir)_Binaries/$(AssemblyName)/$(Configuration)+$(Platform)/</OutputPath>
<IntermediateOutputPath>$(SolutionDir)_Intermediate/$(AssemblyName)/$(Configuration)+$(Platform)/</IntermediateOutputPath>
<OtherFlags>--keyfile:$(ProjectDir)..\Build\Infrastructure.snk</OtherFlags>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<RollForward>Major</RollForward>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -72,7 +67,7 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.12.12" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.12.13" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
</ItemGroup>

Expand Down
69 changes: 48 additions & 21 deletions AltCover.Api.Tests/FSApiTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -309,7 +315,7 @@ module FSApiTests =
.Trim([| '\u00FF' |]) @>

[<Test>]
let JsonFromCoverletShouldHaveBranchExitValuesOK() =
let JsonFromCoverletShouldHaveBranchExitValuesOK () =
use stream =
Assembly
.GetExecutingAssembly()
Expand All @@ -319,8 +325,9 @@ module FSApiTests =
use reader = new StreamReader(stream)
reader.ReadToEnd()

let result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\u00FF" +
(OpenCover.JsonToXml doc).ToString()
let result =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\u00FF"
+ (OpenCover.JsonToXml doc).ToString()

use stream3 =
Assembly
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -735,6 +745,9 @@ module FSApiTests =
Visitor.visit
visitors
[ { AssemblyPath = sample
Identity =
{ Assembly = String.Empty
Configuration = String.Empty }
Destinations = [] } ]

let document =
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
21 changes: 14 additions & 7 deletions AltCover.Api.Tests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 0 additions & 21 deletions AltCover.Avalonia.FuncUI/AltCover.Avalonia.FuncUI.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,13 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackAsTool>True</PackAsTool>
<ToolCommandName>altcover.visualizer</ToolCommandName>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GlobalDefineConstants>AVALONIA</GlobalDefineConstants>
<OutputPath>$(ProjectDir)..\_Binaries/$(AssemblyName).FuncUI/$(Configuration)+$(Platform)/</OutputPath>
<IntermediateOutputPath>$(ProjectDir)..\_Intermediate/$(AssemblyName).FuncUI/$(Configuration)+$(Platform)/</IntermediateOutputPath>
<OtherFlags>--keyfile:$(ProjectDir)..\Build\Infrastructure.snk</OtherFlags>
<RollForward>Major</RollForward>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DeterministicSourcePaths>false</DeterministicSourcePaths>
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DeterministicSourcePaths>true</DeterministicSourcePaths>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS;$(GlobalDefineConstants)</DefineConstants>
<Tailcalls>true</Tailcalls>
<WarningLevel>5</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<NoWarn>52</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<DefineConstants>TRACE;$(GlobalDefineConstants)</DefineConstants>
</PropertyGroup>

Expand Down
24 changes: 1 addition & 23 deletions AltCover.Avalonia/AltCover.Avalonia.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,17 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>AltCover.Visualizer</RootNamespace>
<AssemblyName>AltCover.Visualizer</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackAsTool>True</PackAsTool>
<ToolCommandName>altcover.visualizer</ToolCommandName>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GlobalDefineConstants>AVALONIA</GlobalDefineConstants>
<OutputPath>$(ProjectDir)..\_Binaries/$(AssemblyName).Avalonia/$(Configuration)+$(Platform)/</OutputPath>
<IntermediateOutputPath>$(ProjectDir)..\_Intermediate/$(AssemblyName).Avalonia/$(Configuration)+$(Platform)/</IntermediateOutputPath>
<OtherFlags>--keyfile:$(ProjectDir)..\Build\Infrastructure.snk</OtherFlags>
<GlobalDefineConstants>AVALONIA;$(TOGGLE)</GlobalDefineConstants>
<UseStandardResourceNames>True</UseStandardResourceNames>
<Win32Resource>$(ProjectDir)../AltCover.Visualizer/Resource.res</Win32Resource>
<RollForward>Major</RollForward>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DeterministicSourcePaths>false</DeterministicSourcePaths>
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DeterministicSourcePaths>true</DeterministicSourcePaths>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS;$(GlobalDefineConstants)</DefineConstants>
<Tailcalls>true</Tailcalls>
<WarningLevel>5</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<NoWarn>52</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<DefineConstants>TRACE;$(GlobalDefineConstants)</DefineConstants>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 2ae70ce

Please sign in to comment.