-
Notifications
You must be signed in to change notification settings - Fork 81
/
TestTasks.fs
59 lines (53 loc) · 1.9 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
module TestTasks
open BlackFox.Fake
open Fake.DotNet
open ProjectInfo
open BasicTasks
let buildTests = BuildTask.create "BuildTests" [clean; build] {
testProjects
|> List.iter (fun pInfo ->
let proj = pInfo.ProjFile
proj
|> DotNet.build (fun p ->
p
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
)
)
}
/// runs the individual test projects via `dotnet test`
let runTests =
BuildTask.create "RunTests" [ clean; build; buildTests ] {
testProjects
|> Seq.iter (fun testProjectInfo ->
Fake.DotNet.DotNet.test
(fun testParams ->
{ testParams with
Logger = Some "console;verbosity=detailed"
Configuration = DotNet.BuildConfiguration.fromString configuration
NoBuild = true
})
testProjectInfo.ProjFile)
}
// to do: use this once we have actual tests
let runTestsWithCodeCov =
BuildTask.create "RunTestsWithCodeCov" [ clean; build ] {
let standardParams =
Fake.DotNet.MSBuild.CliArguments.Create()
testProjects
|> Seq.iter (fun testProjectInfo ->
Fake.DotNet.DotNet.test
(fun testParams ->
{ testParams with
MSBuildParams =
{ standardParams with
Properties =
[
"AltCover", "true"
"AltCoverCobertura", "../../codeCov.xml"
"AltCoverForce", "true"
]
}
Logger = Some "console;verbosity=detailed"
})
testProjectInfo.ProjFile)
}