Skip to content

Commit

Permalink
Merge 3500aca into 96c733a
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] committed Sep 11, 2023
2 parents 96c733a + 3500aca commit 7bc8a28
Show file tree
Hide file tree
Showing 11 changed files with 272 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .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": "5.1.12",
"version": "5.1.25",
"commands": [
"reportgenerator"
]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.101'
dotnet-version: '7.0.400'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand All @@ -36,10 +36,10 @@ jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.101'
dotnet-version: '7.0.400'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down
2 changes: 1 addition & 1 deletion Build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ module Build =
Targets.initTargets ()
Target.runOrDefault <| Targets.defaultTarget ()

0 // return an integer exit code
0
8 changes: 8 additions & 0 deletions Build/setup.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ module Setup =
"dotnet"
|> Fake.Core.ProcessUtils.tryFindFileOnPath

let cliArguments =
{ MSBuild.CliArguments.Create() with
ConsoleLogParameters = []
DistributedLoggers = None
Properties = []
DisableInternalBinLog = true }

let dotnetOptions (o: DotNet.Options) =
match dotnetPath with
| Some f -> { o with DotNetCliPath = f }
Expand All @@ -27,5 +34,6 @@ module Setup =
(fun o ->
{ o with
Packages = [ "./packages" ]
MSBuildParams = cliArguments
Common = dotnetOptions o.Common })
"./Build/NuGet.csproj"
104 changes: 53 additions & 51 deletions Build/targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module Targets =
AssemblyFilter =
"FSharp"
:: @"\.Placeholder"
:: (p.AssemblyFilter |> Seq.toList)
:: (p.AssemblyFilter |> Seq.toList)
LocalSource = true
TypeFilter =
[ @"System\."
Expand Down Expand Up @@ -115,6 +115,7 @@ module Targets =
{ MSBuild.CliArguments.Create() with
ConsoleLogParameters = []
DistributedLoggers = None
Properties = []
DisableInternalBinLog = true }

let withWorkingDirectoryVM dir o =
Expand All @@ -123,7 +124,8 @@ module Targets =
Verbosity = Some DotNet.Verbosity.Minimal }

let withWorkingDirectoryOnly dir o =
{ dotnetOptions o with WorkingDirectory = Path.getFullName dir }
{ dotnetOptions o with
WorkingDirectory = Path.getFullName dir }

let withCLIArgs (o: Fake.DotNet.DotNet.TestOptions) =
{ o with MSBuildParams = cliArguments }
Expand Down Expand Up @@ -228,7 +230,8 @@ module Targets =
let dotnetBuildDebug proj =
DotNet.build
(fun p ->
{ p.WithCommon dotnetOptions with Configuration = DotNet.BuildConfiguration.Debug }
{ p.WithCommon dotnetOptions with
Configuration = DotNet.BuildConfiguration.Debug }
|> buildWithCLIArguments
|> withEnvironment)
(Path.GetFullPath proj)
Expand Down Expand Up @@ -356,7 +359,6 @@ module Targets =
"./altcode.test/altcode.test.sln"
|> dotnetBuildDebug)


let Validation =
(fun _ ->
DotNet.test
Expand All @@ -380,52 +382,53 @@ module Targets =
let coverage =
!!(@"./**/validation.fsproj")
|> Seq.fold
(fun l test ->
printfn "%A" test

let tname =
test |> Path.GetFileNameWithoutExtension

let testDirectory =
test |> Path.getFullName |> Path.GetDirectoryName

let altReport =
reports @@ ("Coverage." + tname + ".xml")

let collect =
AltCover.CollectOptions.Primitive(Primitive.CollectOptions.Create()) // FSApi

let prepare =
AltCover.PrepareOptions.Primitive(
{ Primitive.PrepareOptions.Create() with
Report = altReport
SingleVisit = true }
|> AltCoverFilter
)

let forceTrue = DotNet.CLIOptions.Force true

let setBaseOptions (o: DotNet.Options) =
{ o with
WorkingDirectory = Path.getFullName testDirectory
Verbosity = Some DotNet.Verbosity.Minimal }

try
DotNet.test
(fun to' ->
{ (to'.WithCommon(setBaseOptions).WithAltCoverOptions
prepare
collect
forceTrue) with
MSBuildParams = cliArguments
NoBuild = true })
test
with x ->
printfn "%A" x
// reraise()) // while fixing

altReport :: l)
[]
(fun l test ->
printfn "%A" test

let tname =
test |> Path.GetFileNameWithoutExtension

let testDirectory =
test |> Path.getFullName |> Path.GetDirectoryName

let altReport =
reports @@ ("Coverage." + tname + ".xml")

let collect =
AltCover.CollectOptions.Primitive(Primitive.CollectOptions.Create()) // FSApi

let prepare =
AltCover.PrepareOptions.Primitive(
{ Primitive.PrepareOptions.Create() with
Report = altReport
SingleVisit = true }
|> AltCoverFilter
)

let forceTrue = DotNet.CLIOptions.Force true

let setBaseOptions (o: DotNet.Options) =
{ o with
WorkingDirectory = Path.getFullName testDirectory
Verbosity = Some DotNet.Verbosity.Minimal }

try
DotNet.test
(fun to' ->
{ to'.WithCommon(setBaseOptions) with
MSBuildParams = cliArguments
NoBuild = true }
.WithAltCoverOptions
prepare
collect
forceTrue)
test
with x ->
printfn "%A" x
// reraise()) // while fixing

altReport :: l)
[]

ReportGenerator.generateReports
(fun p ->
Expand Down Expand Up @@ -486,7 +489,6 @@ module Targets =
// printfn "%A" (u.GetType().FullName)
Assert.That(u, Is.EqualTo [ 0 ], "All lines should be covered")))


// Code Analysis

//_Target "Analysis" ignore
Expand Down
46 changes: 23 additions & 23 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<ItemGroup>
<PackageVersion Include="AltCode.Dixon" Version="2022.1.8.13182" />
<PackageVersion Include="altcode.gendarme" Version="2022.12.6.7345" />
<PackageVersion Include="altcover" Version="8.5.841" />
<PackageVersion Include="AltCover.Api" Version="8.5.841" />
<PackageVersion Include="AltCover.Fake" Version="8.5.841" />
<PackageVersion Include="altcover" Version="8.6.68" />
<PackageVersion Include="AltCover.Api" Version="8.6.68" />
<PackageVersion Include="AltCover.Fake" Version="8.6.68" />
<PackageVersion Include="BlackFox.CommandLine" Version="1.0.0" />
<PackageVersion Include="BlackFox.VsWhere" Version="1.1.0" />
<PackageVersion Include="CommunityToolkit.Diagnostics" Version="8.0.0" />
Expand All @@ -15,37 +15,37 @@
<PackageVersion Include="Expecto" Version="9.0.4" />
<PackageVersion Include="Expecto.FsCheck" Version="9.0.4" />
<PackageVersion Include="Expecto.TestResults" Version="8.13.2" />
<PackageVersion Include="FAKE.Core.Environment" Version="5.23.1" />
<PackageVersion Include="FAKE.Core.Process" Version="5.23.1" />
<PackageVersion Include="FAKE.Core.Target" Version="5.23.1" />
<PackageVersion Include="FAKE.Core.Environment" Version="6.0.0" />
<PackageVersion Include="FAKE.Core.Process" Version="6.0.0" />
<PackageVersion Include="FAKE.Core.Target" Version="6.0.0" />
<PackageVersion Include="FAKE.Core.Trace" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.AssemblyInfoFile" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.Cli" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.FxCop" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.MSBuild" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.Nuget" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.Testing.NUnit" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.Testing.OpenCover" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.Testing.XUnit2" Version="5.23.1" />
<PackageVersion Include="FAKE.IO.FileSystem" Version="5.23.1" />
<PackageVersion Include="FAKE.Tools.Git" Version="5.23.1" />
<PackageVersion Include="FAKE.Testing.ReportGenerator" Version="5.23.1" />
<PackageVersion Include="FAKE.DotNet.AssemblyInfoFile" Version="6.0.0" />
<PackageVersion Include="FAKE.DotNet.Cli" Version="6.0.0" />
<PackageVersion Include="FAKE.DotNet.FxCop" Version="6.0.0" />
<PackageVersion Include="FAKE.DotNet.MSBuild" Version="6.0.0" />
<PackageVersion Include="FAKE.DotNet.Nuget" Version="6.0.0" />
<PackageVersion Include="FAKE.DotNet.Testing.NUnit" Version="6.0.0" />
<PackageVersion Include="FAKE.DotNet.Testing.OpenCover" Version="6.0.0" />
<PackageVersion Include="FAKE.DotNet.Testing.XUnit2" Version="6.0.0" />
<PackageVersion Include="FAKE.IO.FileSystem" Version="6.0.0" />
<PackageVersion Include="FAKE.Tools.Git" Version="6.0.0" />
<PackageVersion Include="FAKE.Testing.ReportGenerator" Version="6.0.0" />
<PackageVersion Include="FsCheck" Version="2.16.5" />
<PackageVersion Include="FSharp.Core" Version="6.0.0" />
<PackageVersion Include="FSharp.Core" Version="7.0.400" />
<PackageVersion Include="FsUnit" Version="5.1.0" />
<!-- PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" / -->
<PackageVersion Include="Markdig" Version="0.30.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageVersion Include="Markdig" Version="0.33.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="16.0.0" />
<PackageVersion Include="Mono.Cecil" Version="0.11.4" />
<PackageVersion Include="Mono.Options" Version="6.12.0.148" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" />
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="NuGet.CommandLine" Version="6.3.1" />
<PackageVersion Include="NuGet.CommandLine" Version="6.7.0" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.3.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<!-- This one w/just net20/net40 agents works as before on Linux for the AltCoverRunner test -->
<PackageVersion Include="NUnit.ConsoleRunner" Condition="'$(OS)' != 'Windows_NT'" Version="3.12.0" />
<!-- This one w/extra netcore3.1 agent causes mono vs framework problems for some reason on the AltCoverRunner test -->
Expand All @@ -62,7 +62,7 @@
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
<PackageVersion Include="xunit.analyzers" Version="1.0.0" />
<PackageVersion Include="xunit.assert" Version="2.4.2" />
<PackageVersion Include="xunit.assert" Version="2.5.0" />
<PackageVersion Include="xunit.core" Version="2.4.2" />
<PackageVersion Include="xunit.extensibility.core" Version="2.4.2" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.4.2" />
Expand Down
44 changes: 39 additions & 5 deletions altcode.test/altcode.test.xunit/XUnit.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,22 @@ type AltAssert =
static member Equal(x: AssertionMatch<#IEnumerable<'a>>) =
Assert.Equal<'a>(x.Expected, x.Actual)

static member Equal(x: AssertionMatch<#IEnumerable<'a>>, comparer) =
static member Equal
(
x: AssertionMatch<#IEnumerable<'a>>,
comparer: IEqualityComparer<'a>
) =
Assert.Equal<'a>(x.Expected, x.Actual, comparer)

static member Equal(x: AssertionMatch<#IEnumerable<'a>>, comparer: Func<'a, 'a, bool>) =
Assert.Equal<'a>(x.Expected, x.Actual, comparer)

static member Equal<'a>(x: AssertionMatch<'a>) = Assert.Equal<'a>(x.Expected, x.Actual)

static member Equal<'a>(x: AssertionMatch<'a>, comparer) =
static member Equal<'a>(x: AssertionMatch<'a>, comparer: IEqualityComparer<'a>) =
Assert.Equal<'a>(x.Expected, x.Actual, comparer)

static member Equal<'a>(x: AssertionMatch<'a>, comparer: Func<'a, 'a, bool>) =
Assert.Equal<'a>(x.Expected, x.Actual, comparer)

static member Equal(x: AssertionMatch<double>, (precision: int)) =
Expand Down Expand Up @@ -81,18 +91,42 @@ type AltAssert =
static member NotEqual(x: AssertionMatch<#IEnumerable<'a>>) =
Assert.NotEqual<'a>(x.Expected, x.Actual)

static member NotEqual(x: AssertionMatch<#IEnumerable<'a>>, comparer) =
static member NotEqual
(
x: AssertionMatch<#IEnumerable<'a>>,
comparer: Func<'a, 'a, bool>
) =
Assert.NotEqual<'a>(x.Expected, x.Actual, comparer)

static member NotEqual
(
x: AssertionMatch<#IEnumerable<'a>>,
comparer: IEqualityComparer<'a>
) =
Assert.NotEqual<'a>(x.Expected, x.Actual, comparer)

static member NotEqual<'a>(x: AssertionMatch<'a>) =
Assert.NotEqual<'a>(x.Expected, x.Actual)

static member NotEqual<'a>(x: AssertionMatch<'a>, comparer) =
static member NotEqual<'a>(x: AssertionMatch<'a>, comparer: Func<'a, 'a, bool>) =
Assert.NotEqual<'a>(x.Expected, x.Actual, comparer)

static member NotEqual<'a>(x: AssertionMatch<'a>, comparer: IEqualityComparer<'a>) =
Assert.NotEqual<'a>(x.Expected, x.Actual, comparer)

static member NotEqual(x: AssertionMatch<double>, precision) =
static member NotEqual(x: AssertionMatch<double>, precision: int) =
Assert.NotEqual(x.Expected, x.Actual, precision)

static member NotEqual
(
x: AssertionMatch<double>,
comparer: Func<double, double, bool>
) =
Assert.NotEqual(x.Expected, x.Actual, comparer)

static member NotEqual(x: AssertionMatch<double>, comparer: IEqualityComparer<double>) =
Assert.NotEqual(x.Expected, x.Actual, comparer)

static member NotEqual(x: AssertionMatch<decimal>, precision) =
Assert.NotEqual(x.Expected, x.Actual, precision)

Expand Down

0 comments on commit 7bc8a28

Please sign in to comment.