Note: This API documentation is for FAKE version 4. The migration API documentation can be found here. The API documentation for the new fake 5 modules can be found here

DotCover

Contains a task which can be used to run DotCover on .NET assemblies.

Nested types and modules

TypeDescription
DotCoverMergeParams
DotCoverParams

The dotCover parameter type for running coverage

DotCoverReportParams
DotCoverReportType

Functions and values

Function or valueDescription
buildDotCoverArgs(parameters)
Signature: parameters:DotCoverParams -> string
buildDotCoverMergeArgs(parameters)
Signature: parameters:DotCoverMergeParams -> string
buildDotCoverReportArgs(parameters)
Signature: parameters:DotCoverReportParams -> string
buildParamsAndExecute(...)
Signature: parameters:'?10014 -> buildArguments:('?10014 -> string) -> toolPath:string -> workingDir:string -> failBuild:bool -> unit
Type parameters: '?10014
DotCover(setParams)
Signature: setParams:(DotCoverParams -> DotCoverParams) -> unit

Runs the dotCover "cover" command, using a target executable (such as NUnit or MSpec) and generates a snapshot file.

Parameters

  • setParams - Function used to overwrite the dotCover default parameters.
DotCoverDefaults
Signature: DotCoverParams

The dotCover default parameters

DotCoverMerge(setParams)
Signature: setParams:(DotCoverMergeParams -> DotCoverMergeParams) -> unit

Runs the dotCover "merge" command. This combines dotCover snaphots into a single snapshot, enabling you to merge test coverage from multiple test running frameworks

Parameters

  • setParams - Function used to overwrite the dotCover merge default parameters.

Sample

1: 
2: 
3: 
4: 
DotCoverMerge (fun p -> { p with 
                    Source = [artifactsDir @@ "NUnitDotCoverSnapshot.dcvr"
                              artifactsDir @@ "MSpecDotCoverSnapshot.dcvr"]
                    Output = artifactsDir @@ "dotCoverSnapshot.dcvr" }) 
DotCoverMergeDefaults
Signature: DotCoverMergeParams
DotCoverMSpec(...)
Signature: setDotCoverParams:(DotCoverParams -> DotCoverParams) -> setMSpecParams:(MSpecParams -> MSpecParams) -> assemblies:seq<string> -> unit

Runs the dotCover "cover" command against the MSpec test runner.

Parameters

  • setDotCoverParams - Function used to overwrite the dotCover report default parameters.
  • setMSpecParams - Function used to overwrite the MSpec default parameters.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
!! (buildDir @@ buildMode @@ "/*.Unit.Tests.dll") 
    |> DotCoverMSpec 
        (fun dotCoverOptions -> { dotCoverOptions with 
                Output = artifactsDir @@ "MSpecDotCoverSnapshot.dcvr" }) 
        (fun mSpecOptions -> { mSpecOptions with
                Silent = true })
DotCoverMSTest(...)
Signature: setDotCoverParams:(DotCoverParams -> DotCoverParams) -> setMSTestParams:(MSTestParams -> MSTestParams) -> assemblies:seq<string> -> unit

Runs the dotCover "cover" command against the MSTest test runner.

Parameters

  • setDotCoverParams - Function used to overwrite the dotCover report default parameters.
  • setMSTestParams - Function used to overwrite the MSTest default parameters.

Sample

1: 
2: 
3: 
4: 
!! (buildDir @@ buildMode @@ "/*.Unit.Tests.dll") 
    |> MSTest 
        (fun  -> dotCoverOptions )
        (fun MSTestOptions -> MSTestOptions) 
DotCoverNUnit(...)
Signature: setDotCoverParams:(DotCoverParams -> DotCoverParams) -> setNUnitParams:(NUnitParams -> NUnitParams) -> assemblies:seq<string> -> unit

Runs the dotCover "cover" command against the NUnit test runner.

Parameters

  • setDotCoverParams - Function used to overwrite the dotCover report default parameters.
  • setNUnitParams - Function used to overwrite the NUnit default parameters.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
!! (buildDir @@ buildMode @@ "/*.Unit.Tests.dll") 
    |> DotCoverNUnit 
        (fun dotCoverOptions -> { dotCoverOptions with 
                Output = artifactsDir @@ "NUnitDotCoverSnapshot.dcvr" }) 
        (fun nUnitOptions -> { nUnitOptions with
                DisableShadowCopy = true })
DotCoverNUnit3(...)
Signature: setDotCoverParams:(DotCoverParams -> DotCoverParams) -> setNUnitParams:(NUnit3Params -> NUnit3Params) -> assemblies:seq<string> -> unit

Runs the dotCover "cover" command against the NUnit test runner.

Parameters

  • setDotCoverParams - Function used to overwrite the dotCover report default parameters.
  • setNUnitParams - Function used to overwrite the NUnit default parameters.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
!! (buildDir @@ buildMode @@ "/*.Unit.Tests.dll") 
    |> DotCoverNUnit 
        (fun dotCoverOptions -> { dotCoverOptions with 
                Output = artifactsDir @@ "NUnitDotCoverSnapshot.dcvr" }) 
        (fun nUnitOptions -> { nUnitOptions with
                DisableShadowCopy = true })
DotCoverReport(setParams)
Signature: setParams:(DotCoverReportParams -> DotCoverReportParams) -> bool -> unit

Runs the dotCover "report" command. This generates a report from a dotCover snapshot

Parameters

  • setParams - Function used to overwrite the dotCover report default parameters.

Sample

1: 
2: 
3: 
4: 
DotCoverReport (fun p -> { p with 
                    Source = artifactsDir @@ "dotCoverSnapshot.dcvr"
                    Output = artifactsDir @@ "dotCoverReport.xml"
                    ReportType = DotCoverReportType.Xml })
DotCoverReportDefaults
Signature: DotCoverReportParams
DotCoverXUnit2(...)
Signature: setDotCoverParams:(DotCoverParams -> DotCoverParams) -> setXUnit2Params:(XUnit2Params -> XUnit2Params) -> assemblies:seq<string> -> unit

Runs the dotCover "cover" command against the XUnit2 test runner.

Parameters

  • setDotCoverParams - Function used to overwrite the dotCover report default parameters.
  • setXUnit2Params - Function used to overwrite the XUnit2 default parameters.

Sample

1: 
2: 
3: 
4: 
!! (buildDir @@ buildMode @@ "/*.Unit.Tests.dll") 
    |> DotCoverXUnit2 
        (fun  -> dotCoverOptions )
        (fun nUnitOptions -> nUnitOptions) 
getWorkingDir(workingDir)
Signature: workingDir:string -> string