Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 169a965

Browse files
Run unit tests in build
1 parent 4f7f713 commit 169a965

File tree

7 files changed

+240
-100
lines changed

7 files changed

+240
-100
lines changed

FsUno.Persistence.EventStore/FsUno.Persistence.EventStore.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@
492492
</When>
493493
</Choose>
494494
<Choose>
495-
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6')">
495+
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And $(TargetFrameworkVersion) == 'v1.6'">
496496
<ItemGroup>
497497
<Reference Include="System.Reflection.Emit.Lightweight">
498498
<HintPath>..\packages\System.Reflection.Emit.Lightweight\ref\netstandard1.0\System.Reflection.Emit.Lightweight.dll</HintPath>

FsUno.Tests/FsUno.Tests.fsproj

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
</PropertyGroup>
102102
</When>
103103
</Choose>
104-
<Import Project="..\packages\xunit.core\build\$(__paket__xunit_core_props).props" Condition="Exists('..\packages\xunit.core\build\$(__paket__xunit_core_props).props')" Label="Paket" />
104+
<Import Project="..\packages\test\xunit.core\build\$(__paket__xunit_core_props).props" Condition="Exists('..\packages\test\xunit.core\build\$(__paket__xunit_core_props).props')" Label="Paket" />
105105
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
106106
Other similar extension points exist, see Microsoft.Common.targets.
107107
<Target Name="BeforeBuild">
@@ -175,22 +175,6 @@
175175
</ItemGroup>
176176
</When>
177177
</Choose>
178-
<Choose>
179-
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')">
180-
<ItemGroup>
181-
<Reference Include="FsUnit.Xunit">
182-
<HintPath>..\packages\FsUnit.xUnit\lib\net45\FsUnit.Xunit.dll</HintPath>
183-
<Private>True</Private>
184-
<Paket>True</Paket>
185-
</Reference>
186-
<Reference Include="NHamcrest">
187-
<HintPath>..\packages\FsUnit.xUnit\lib\net45\NHamcrest.dll</HintPath>
188-
<Private>True</Private>
189-
<Paket>True</Paket>
190-
</Reference>
191-
</ItemGroup>
192-
</When>
193-
</Choose>
194178
<Choose>
195179
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6')">
196180
<ItemGroup>
@@ -530,7 +514,7 @@
530514
</When>
531515
</Choose>
532516
<Choose>
533-
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6')">
517+
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And $(TargetFrameworkVersion) == 'v1.6'">
534518
<ItemGroup>
535519
<Reference Include="System.Reflection.Emit.Lightweight">
536520
<HintPath>..\packages\System.Reflection.Emit.Lightweight\ref\netstandard1.0\System.Reflection.Emit.Lightweight.dll</HintPath>
@@ -871,11 +855,27 @@
871855
</ItemGroup>
872856
</When>
873857
</Choose>
858+
<Choose>
859+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')">
860+
<ItemGroup>
861+
<Reference Include="FsUnit.Xunit">
862+
<HintPath>..\packages\test\FsUnit.xUnit\lib\net45\FsUnit.Xunit.dll</HintPath>
863+
<Private>True</Private>
864+
<Paket>True</Paket>
865+
</Reference>
866+
<Reference Include="NHamcrest">
867+
<HintPath>..\packages\test\FsUnit.xUnit\lib\net45\NHamcrest.dll</HintPath>
868+
<Private>True</Private>
869+
<Paket>True</Paket>
870+
</Reference>
871+
</ItemGroup>
872+
</When>
873+
</Choose>
874874
<Choose>
875875
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')">
876876
<ItemGroup>
877877
<Reference Include="xunit.abstractions">
878-
<HintPath>..\packages\xunit.abstractions\lib\net35\xunit.abstractions.dll</HintPath>
878+
<HintPath>..\packages\test\xunit.abstractions\lib\net35\xunit.abstractions.dll</HintPath>
879879
<Private>True</Private>
880880
<Paket>True</Paket>
881881
</Reference>
@@ -884,7 +884,7 @@
884884
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.2')) Or ($(TargetFrameworkIdentifier) == '.NETCore' And $(TargetFrameworkVersion) == 'v4.5') Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And $(TargetFrameworkVersion) == 'v8.0') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile259')">
885885
<ItemGroup>
886886
<Reference Include="xunit.abstractions">
887-
<HintPath>..\packages\xunit.abstractions\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.abstractions.dll</HintPath>
887+
<HintPath>..\packages\test\xunit.abstractions\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.abstractions.dll</HintPath>
888888
<Private>True</Private>
889889
<Paket>True</Paket>
890890
</Reference>
@@ -895,7 +895,7 @@
895895
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And $(TargetFrameworkVersion) == 'v1.0') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')) Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile259')">
896896
<ItemGroup>
897897
<Reference Include="xunit.assert">
898-
<HintPath>..\packages\xunit.assert\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
898+
<HintPath>..\packages\test\xunit.assert\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
899899
<Private>True</Private>
900900
<Paket>True</Paket>
901901
</Reference>
@@ -906,7 +906,7 @@
906906
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.2')) Or ($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')) Or ($(TargetFrameworkIdentifier) == '.NETCore' And $(TargetFrameworkVersion) == 'v4.5') Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And $(TargetFrameworkVersion) == 'v8.0') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile259')">
907907
<ItemGroup>
908908
<Reference Include="xunit.core">
909-
<HintPath>..\packages\xunit.extensibility.core\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll</HintPath>
909+
<HintPath>..\packages\test\xunit.extensibility.core\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll</HintPath>
910910
<Private>True</Private>
911911
<Paket>True</Paket>
912912
</Reference>
@@ -917,7 +917,7 @@
917917
<When Condition="$(TargetFrameworkIdentifier) == 'MonoAndroid'">
918918
<ItemGroup>
919919
<Reference Include="xunit.execution.dotnet">
920-
<HintPath>..\packages\xunit.extensibility.execution\lib\monoandroid\xunit.execution.dotnet.dll</HintPath>
920+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\monoandroid\xunit.execution.dotnet.dll</HintPath>
921921
<Private>True</Private>
922922
<Paket>True</Paket>
923923
</Reference>
@@ -926,7 +926,7 @@
926926
<When Condition="$(TargetFrameworkIdentifier) == 'MonoTouch'">
927927
<ItemGroup>
928928
<Reference Include="xunit.execution.dotnet">
929-
<HintPath>..\packages\xunit.extensibility.execution\lib\monotouch\xunit.execution.dotnet.dll</HintPath>
929+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\monotouch\xunit.execution.dotnet.dll</HintPath>
930930
<Private>True</Private>
931931
<Paket>True</Paket>
932932
</Reference>
@@ -935,7 +935,7 @@
935935
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')">
936936
<ItemGroup>
937937
<Reference Include="xunit.execution.desktop">
938-
<HintPath>..\packages\xunit.extensibility.execution\lib\net45\xunit.execution.desktop.dll</HintPath>
938+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\net45\xunit.execution.desktop.dll</HintPath>
939939
<Private>True</Private>
940940
<Paket>True</Paket>
941941
</Reference>
@@ -944,7 +944,7 @@
944944
<When Condition="($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.2')) Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile259')">
945945
<ItemGroup>
946946
<Reference Include="xunit.execution.dotnet">
947-
<HintPath>..\packages\xunit.extensibility.execution\lib\portable-net45+win8+wp8+wpa81\xunit.execution.dotnet.dll</HintPath>
947+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\portable-net45+win8+wp8+wpa81\xunit.execution.dotnet.dll</HintPath>
948948
<Private>True</Private>
949949
<Paket>True</Paket>
950950
</Reference>
@@ -953,7 +953,7 @@
953953
<When Condition="$(TargetFrameworkIdentifier) == '.NETCore' And $(TargetFrameworkVersion) == 'v4.5'">
954954
<ItemGroup>
955955
<Reference Include="xunit.execution.dotnet">
956-
<HintPath>..\packages\xunit.extensibility.execution\lib\win8\xunit.execution.dotnet.dll</HintPath>
956+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\win8\xunit.execution.dotnet.dll</HintPath>
957957
<Private>True</Private>
958958
<Paket>True</Paket>
959959
</Reference>
@@ -962,7 +962,7 @@
962962
<When Condition="$(TargetFrameworkIdentifier) == 'WindowsPhone' And $(TargetFrameworkVersion) == 'v8.0'">
963963
<ItemGroup>
964964
<Reference Include="xunit.execution.dotnet">
965-
<HintPath>..\packages\xunit.extensibility.execution\lib\wp8\xunit.execution.dotnet.dll</HintPath>
965+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\wp8\xunit.execution.dotnet.dll</HintPath>
966966
<Private>True</Private>
967967
<Paket>True</Paket>
968968
</Reference>
@@ -971,7 +971,7 @@
971971
<When Condition="$(TargetFrameworkIdentifier) == 'WindowsPhoneApp'">
972972
<ItemGroup>
973973
<Reference Include="xunit.execution.dotnet">
974-
<HintPath>..\packages\xunit.extensibility.execution\lib\wpa81\xunit.execution.dotnet.dll</HintPath>
974+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\wpa81\xunit.execution.dotnet.dll</HintPath>
975975
<Private>True</Private>
976976
<Paket>True</Paket>
977977
</Reference>
@@ -980,7 +980,7 @@
980980
<When Condition="$(TargetFrameworkIdentifier) == 'Xamarin.iOS'">
981981
<ItemGroup>
982982
<Reference Include="xunit.execution.dotnet">
983-
<HintPath>..\packages\xunit.extensibility.execution\lib\xamarinios\xunit.execution.dotnet.dll</HintPath>
983+
<HintPath>..\packages\test\xunit.extensibility.execution\lib\xamarinios\xunit.execution.dotnet.dll</HintPath>
984984
<Private>True</Private>
985985
<Paket>True</Paket>
986986
</Reference>

FsUno.Tests/paket.references

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FsUnit.xUnit
21
Newtonsoft.Json
2+
FSharp.Core
3+
group Test
4+
FsUnit.xUnit
35
xunit
4-
FSharp.Core

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ if not exist .paket\paket.exe (
66
.paket\paket.exe install
77

88
set encoding=utf-8
9-
packages\FAKE\tools\FAKE.exe build.fsx %*
9+
packages\build\FAKE\tools\FAKE.exe build.fsx %*
1010

build.fsx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
#r "packages/Fake/tools/FakeLib.dll"
1+
#r "packages/build/Fake/tools/FakeLib.dll"
22
#r "System.Xml.Linq"
33

44
open System
55
open System.Xml.Linq
66
open Fake
77
open NuGetHelper
88
open Fake.Git
9+
open Fake.Testing
10+
911

1012
let title = "FsUno.Prod"
1113
let authors = [ "Jérémie Chassaing" ]
@@ -74,16 +76,29 @@ Target "CleanBuild" <| fun _ ->
7476
CleanDir "bin\Release"
7577

7678
Target "Build" <| fun _ ->
77-
!! "FsUno.Prod.sln"
78-
|> MSBuildRelease @"bin\Release" "Build"
79+
!! "FSUno/*.fsproj"
80+
++ "FSUno.Domain/*.fsproj"
81+
++ "FsUno.Persistence.EventStore/*.fsproj"
82+
|> MSBuildRelease @"bin\Release" "Rebuild"
83+
|> Log "MsBuild"
84+
85+
86+
Target "BuildTests" <| fun _ ->
87+
!! "FSUno.Tests/*.fsproj"
88+
|> MSBuildRelease @"bin\tests" "Rebuild"
7989
|> Log "MsBuild"
8090

91+
Target "Tests" <| fun _ ->
92+
!! "bin/tests/*.Tests.dll"
93+
|> xUnit2 (fun p -> { p with ToolPath = "packages/test/xunit.runner.console/tools/xunit.console.exe" })
94+
8195
Target "All" DoNothing
8296

83-
"CleanBuild" ==> "Build"
97+
"CleanBuild" ==> "Build" ==> "BuildTests" ==> "Tests"
8498
"CleanJourney" ==> "Journey" ==> "ReleaseJourney"
8599

86-
"Build" ==> "All"
100+
101+
"Tests" ==> "All"
87102
"Journey" ==> "All"
88103

89104
RunTargetOrDefault "All"

paket.dependencies

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
source http://nuget.org/api/v2
2-
nuget Fake
1+
source https://api.nuget.org/v3/index.json
32
nuget FSharp.Core
43
nuget FSharp.Formatting.CommandTool
54
nuget EventStore.Client
65
nuget Newtonsoft.Json
6+
7+
group Build
8+
source https://api.nuget.org/v3/index.json
9+
nuget Fake
10+
11+
group Test
12+
source https://api.nuget.org/v3/index.json
713
nuget FsUnit.xUnit
8-
nuget xunit
14+
nuget xunit
15+
nuget xunit.runner.console

0 commit comments

Comments
 (0)