Skip to content

Commit

Permalink
Support C# record types.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtschelfthout committed Aug 13, 2021
1 parent d7e4ba7 commit 23b7e48
Show file tree
Hide file tree
Showing 26 changed files with 1,637 additions and 1,425 deletions.
8 changes: 4 additions & 4 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"isRoot": true,
"tools": {
"fake-cli": {
"version": "5.20.3",
"commands": [
"fake"
]
"version": "5.20.4-alpha.1642",
"commands": [
"fake"
]
},
"fsharp.formatting.commandtool": {
"version": "9.0.1",
Expand Down
4 changes: 4 additions & 0 deletions FsCheck Release Notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2.16.0 - To be released

* Support generating C# record types.

### 2.15.3 - 8 May 2021

* Allow shrinking private unions. (by Sander van Dijk)
Expand Down
6 changes: 6 additions & 0 deletions FsCheck.sln
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FsCheck.XUnit.CSharpExample
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp.DocSnippets", "examples\CSharp.DocSnippets\CSharp.DocSnippets.csproj", "{6AB84678-E55F-4387-A040-67312735D089}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FsCheck.Test.CSharp", "tests\FsCheck.Test.CSharp\FsCheck.Test.CSharp.csproj", "{86955D54-4D54-4D4C-A7DC-F98F4CCFE498}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -101,6 +103,10 @@ Global
{6AB84678-E55F-4387-A040-67312735D089}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AB84678-E55F-4387-A040-67312735D089}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AB84678-E55F-4387-A040-67312735D089}.Release|Any CPU.Build.0 = Release|Any CPU
{86955D54-4D54-4D4C-A7DC-F98F4CCFE498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86955D54-4D54-4D4C-A7DC-F98F4CCFE498}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86955D54-4D54-4D4C-A7DC-F98F4CCFE498}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86955D54-4D54-4D4C-A7DC-F98F4CCFE498}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
22 changes: 12 additions & 10 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let releaseNotes = "FsCheck Release Notes.md"
let solution = "FsCheck.sln"

/// Pattern specifying assemblies to be tested
let testAssemblies = "tests/**/bin/Release/net452/*.Test.dll"
let testAssemblies = "tests/**/bin/Release/net5.0/*.Test.dll"

// Git configuration (used for publishing documentation in gh-pages branch)
// The profile where the project is posted
Expand Down Expand Up @@ -116,15 +116,17 @@ Target.create "Build" (fun _ ->
// Run the unit tests using test runner

Target.create "RunTests" (fun _ ->
!! testAssemblies
|> XUnit2.run (fun p ->
{ p with
//ToolPath = "packages/build/xunit.runner.console/tools/xunit.console.exe"
//The NoAppDomain setting requires care.
//On mono, it needs to be true otherwise xunit won't work due to a Mono bug.
//On .NET, it needs to be false otherwise Unquote won't work because it won't be able to load the FsCheck assembly.
NoAppDomain = Environment.isMono
ShadowCopy = false })
"tests/FsCheck.Test/"
|> DotNet.test (fun opt -> opt)
// !! testAssemblies
// |> XUnit2.run (fun p ->
// { p with
// //ToolPath = "packages/build/xunit.runner.console/tools/xunit.console.exe"
// //The NoAppDomain setting requires care.
// //On mono, it needs to be true otherwise xunit won't work due to a Mono bug.
// //On .NET, it needs to be false otherwise Unquote won't work because it won't be able to load the FsCheck assembly.
// NoAppDomain = Environment.isMono
// ShadowCopy = false })
)

// --------------------------------------------------------------------------------------
Expand Down
18 changes: 8 additions & 10 deletions examples/FsCheck.MsTest.Examples/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding></runtime></configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>FsCheck.MsTest.Examples</AssemblyName>
<TargetFrameworks>net452</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<WarningLevel>3</WarningLevel>
Expand Down
6 changes: 3 additions & 3 deletions examples/FsCheck.MsTest.Examples/paket.references
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FSharp.Core framework: net452
MSTest.TestFramework framework: net452
MSTest.TestAdapter framework: net452
FSharp.Core
MSTest.TestFramework
MSTest.TestAdapter
Microsoft.NETFramework.ReferenceAssemblies
18 changes: 8 additions & 10 deletions examples/FsCheck.NUnit.CSharpExamples/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding></runtime></configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>FsCheck.NUnit.CSharpExamples</AssemblyName>
<TargetFramework>net452</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<WarningLevel>3</WarningLevel>
Expand Down
6 changes: 3 additions & 3 deletions examples/FsCheck.NUnit.CSharpExamples/paket.references
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NUnit framework: net452
NUnit3TestAdapter framework: net452
FSharp.Core framework: net452
FSharp.Core
NUnit
NUnit3TestAdapter
Microsoft.NETFramework.ReferenceAssemblies
18 changes: 8 additions & 10 deletions examples/FsCheck.NUnit.Examples/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding></runtime></configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>FsCheck.NUnit.Examples</AssemblyName>
<TargetFramework>net452</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Content Include="App.config" />
Expand Down
6 changes: 3 additions & 3 deletions examples/FsCheck.NUnit.Examples/paket.references
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NUnit framework: net452
NUnit3TestAdapter framework: net452
FSharp.Core framework: net452
FSharp.Core
NUnit
NUnit3TestAdapter
Microsoft.NETFramework.ReferenceAssemblies
18 changes: 8 additions & 10 deletions examples/FsCheck.XUnit.CSharpExamples/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
</dependentAssembly>
</assemblyBinding></runtime></configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>FsCheck.Xunit.CSharpExamples</AssemblyName>
<TargetFramework>net452</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<WarningLevel>3</WarningLevel>
Expand Down
6 changes: 3 additions & 3 deletions examples/FsCheck.XUnit.CSharpExamples/paket.references
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xunit framework: net452
xunit.runner.visualstudio framework: net452
FSharp.Core framework: net452
FSharp.Core
xunit
xunit.runner.visualstudio
Microsoft.NETFramework.ReferenceAssemblies
16 changes: 12 additions & 4 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
source https://www.nuget.org/api/v2

version 5.249.0
version 6.0.0-rc001

framework: auto-detect

nuget FSharp.Core = 4.2.3

nuget Unquote
nuget xunit = 2.2
nuget xunit.runner.visualstudio version_in_path: true
nuget NUnit = 3.13.1
Expand All @@ -19,13 +17,23 @@ nuget MSTest.TestAdapter version_in_path: true
// but it looks like paket can not yet do this.
nuget Microsoft.NETFramework.ReferenceAssemblies

group Tests
framework: auto-detect
source https://www.nuget.org/api/v2

nuget FSharp.Core
nuget Unquote
nuget xunit
nuget xunit.runner.visualstudio version_in_path: true
nuget Microsoft.NET.Test.Sdk

// [ FAKE GROUP ]
group Build
framework: auto-detect
source https://www.nuget.org/api/v2
source https://api.nuget.org/v3/index.json

nuget FSharp.Core 4.7.0.0
nuget FSharp.Core
nuget Octokit
nuget Fake.Api.GitHub
nuget Fake.BuildServer.AppVeyor
Expand Down
Loading

0 comments on commit 23b7e48

Please sign in to comment.