-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathTestTasks.fs
70 lines (54 loc) · 3.2 KB
/
TestTasks.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module TestTasks
open BlackFox.Fake
open Fake.DotNet
open ProjectInfo
open BasicTasks
let createTestBuildTask (name: string) (deps: BuildTask.TaskInfo list) (projects: ProjectInfo list) =
BuildTask.create name deps {
projects
|> List.iter (fun pInfo ->
let proj = pInfo.ProjFile
proj
|> DotNet.build (fun p ->
{
p with
MSBuildParams = { p.MSBuildParams with DisableInternalBinLog = true}
}
|> DotNet.Options.withCustomParams (Some "--no-dependencies -tl")
)
)
}
let buildTestsAll = createTestBuildTask "BuildTestsAll" [clean; build] (testBaseProjects @ testProjectsCore @ testProjectsExtensionsLibs @ testProjectsNetFX)
let buildTestsAllNoNetFX = createTestBuildTask "BuildTestsAllNoNetFX" [clean; build] (testBaseProjects @ testProjectsCore @ testProjectsExtensionsLibs)
let buildTestsCore = createTestBuildTask "BuildTestsCore" [clean; build] (testBaseProjects @ testProjectsCore)
let buildTestsNetFX = createTestBuildTask "BuildTestsNetFX" [clean; build] (testBaseProjects @ testProjectsNetFX)
let buildTestsExtensionsLibs = createTestBuildTask "BuildTestsExtensionsLibs" [clean; build] (testBaseProjects @ testProjectsExtensionsLibs)
let createRunTestTask (name: string) (deps: BuildTask.TaskInfo list) (projects: ProjectInfo list) =
BuildTask.create name deps {
projects
|> Seq.iter (fun testProjectInfo ->
Fake.DotNet.DotNet.test
(fun testParams ->
{ testParams with
Logger = Some "console;verbosity=detailed"
Configuration = DotNet.BuildConfiguration.fromString configuration
NoBuild = true
MSBuildParams = { testParams.MSBuildParams with DisableInternalBinLog = true }
}
|> DotNet.Options.withCustomParams (Some "-tl")
)
testProjectInfo.ProjFile
)
}
/// runs the all test projects via `dotnet test`
let runTestsAll = createRunTestTask "RunTestsAll" [ clean; build; buildTestsAll ] (testProjectsCore @ testProjectsExtensionsLibs @ testProjectsNetFX)
/// runs the all test projects except those targeting netfx via `dotnet test`
let runTestsAllNoNetFX = createRunTestTask "RunTestsAllNoNetFX" [ clean; build; buildTestsAllNoNetFX ] (testProjectsCore @ testProjectsExtensionsLibs)
/// runs the core test projects via `dotnet test`
let runTestsCore = createRunTestTask "RunTestsCore" [ clean; build; buildTestsCore; buildTestsCore] testProjectsCore
/// runs the core netfx test projects via `dotnet test`
let runTestsNetFX = createRunTestTask "RunTestsNetFX" [ clean; build; buildTestsNetFX;] testProjectsNetFX
/// runs the core and core netfx test projects via `dotnet test`
let runTestsCoreWithNetFX = createRunTestTask "RunTestsCoreWithNetFX" [ clean; build; buildTestsCore; buildTestsNetFX;] (testProjectsCore @ testProjectsNetFX)
/// runs the extension lib test projects via `dotnet test`
let runTestsExtensionLibs = createRunTestTask "RunTestsExtensionLibs" [ clean; build; buildTestsExtensionsLibs] testProjectsExtensionsLibs