Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding unit tests to the Hopac solution #155

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = false
indent_style = space
indent_size = 2

[*.{csproj,fsproj}]
end_of_line = crlf
6 changes: 3 additions & 3 deletions Benchmarks/Streams/Streams.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="WindowsBase">
<Paket>True</Paket>
</Reference>
<Reference Include="System.Reactive.Windows.Threading">
<HintPath>..\..\packages\benchmarks\System.Reactive.Windows.Threading\lib\net45\System.Reactive.Windows.Threading.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="WindowsBase">
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
Expand Down
7 changes: 7 additions & 0 deletions Hopac.sln
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{C2B858
.nuget\Hopac.nuspec = .nuget\Hopac.nuspec
EndProjectSection
EndProject
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Hopac.Tests", "Tests\Hopac.Tests\Hopac.Tests.fsproj", "{48CAC076-B38A-4968-8BC4-7F4B57843C0B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -173,6 +175,10 @@ Global
{EFFC7C11-2D7F-4F8C-A20A-1085F8F4184E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFFC7C11-2D7F-4F8C-A20A-1085F8F4184E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFFC7C11-2D7F-4F8C-A20A-1085F8F4184E}.Release|Any CPU.Build.0 = Release|Any CPU
{48CAC076-B38A-4968-8BC4-7F4B57843C0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48CAC076-B38A-4968-8BC4-7F4B57843C0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48CAC076-B38A-4968-8BC4-7F4B57843C0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48CAC076-B38A-4968-8BC4-7F4B57843C0B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{36759B0E-103D-4985-815C-2ACFE9568334} = {0F31BE63-CB73-4207-94E8-158D3077F24A}
Expand All @@ -195,6 +201,7 @@ Global
{B285AEB6-FC96-4212-B7A2-6B73597CE607} = {43B5134E-89E6-411E-A492-6FDA8BD441FB}
{7A2F0650-E5F6-4DFB-975D-C9F8B10FF314} = {24B2ECA5-6A25-48E3-942E-D7559D4F8C3B}
{4E4BE430-1137-43D1-97EF-206BD6ACB2C1} = {43B5134E-89E6-411E-A492-6FDA8BD441F9}
{48CAC076-B38A-4968-8BC4-7F4B57843C0B} = {43B5134E-89E6-411E-A492-6FDA8BD441F9}
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 6 additions & 0 deletions Tests/Hopac.Tests/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
158 changes: 158 additions & 0 deletions Tests/Hopac.Tests/Hopac.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>48cac076-b38a-4968-8bc4-7f4b57843c0b</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Hopac.Tests</RootNamespace>
<AssemblyName>Hopac.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<Name>Hopac.Tests</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>$(Platform)</PlatformTarget>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>$(Platform)</PlatformTarget>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<ProjectReference Include="..\..\Libs\Hopac.Platform\Hopac.Platform.fsproj">
<Name>Hopac.Platform</Name>
<Project>{B285AEB6-FC96-4212-B7A2-6B73597CE607}</Project>
</ProjectReference>
<ProjectReference Include="..\..\Libs\Hopac\Hopac.fsproj">
<Name>Hopac</Name>
<Project>{898D8FE3-C9BE-4115-9A13-7615AF27C048}</Project>
</ProjectReference>
<ProjectReference Include="..\..\Libs\Hopac.Core\Hopac.Core.csproj">
<Name>Hopac.Core</Name>
<Project>{92AC6198-FA63-4458-AFEC-2BFBB2B0D914}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Tests.fs" />
<Compile Include="Main.fs" />
<None Include="App.config" />
</ItemGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">14</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="Argu">
<HintPath>..\..\packages\Argu\lib\net40\Argu.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="Expecto">
<HintPath>..\..\packages\Expecto\lib\net40\Expecto.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="Expecto.FsCheck">
<HintPath>..\..\packages\Expecto.FsCheck\lib\net40\Expecto.FsCheck.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="FsCheck">
<HintPath>..\..\packages\FsCheck\lib\portable-net45+netcore45\FsCheck.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5'">
<ItemGroup>
<Reference Include="Mono.Cecil">
<HintPath>..\..\packages\Mono.Cecil\lib\net45\Mono.Cecil.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="Mono.Cecil.Mdb">
<HintPath>..\..\packages\Mono.Cecil\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="Mono.Cecil.Pdb">
<HintPath>..\..\packages\Mono.Cecil\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="Mono.Cecil.Rocks">
<HintPath>..\..\packages\Mono.Cecil\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
</Project>
7 changes: 7 additions & 0 deletions Tests/Hopac.Tests/Main.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Hopac.Tests

open Expecto

[<EntryPoint>]
let main argv =
Tests.runTestsInAssembly defaultConfig argv
Loading