Skip to content

Instantly share code, notes, and snippets.

@jamescrowley
Created April 22, 2014 20:53
Show Gist options
  • Save jamescrowley/11193916 to your computer and use it in GitHub Desktop.
Save jamescrowley/11193916 to your computer and use it in GitHub Desktop.
Target "TestCoverage" (fun _ ->
let filters = "-:*.Tests;" # exclude test assemblies from coverage stats
# run NUnit tests via dotCover
!! testAssemblies
|> DotCoverNUnit (fun p -> { p with
Output = artifactsDir @@ "NUnitDotCover.snapshot"
Filters = filters }) nunitOptions
# run the MSpec tests via dotCover
!! testAssemblies
|> DotCoverMSpec (fun p -> { p with
Output = artifactsDir @@ "MSpecDotCover.snapshot"
Filters = filters }) mSpecOptions
# merge the code coverage files
DotCoverMerge (fun p -> { p with
Source = [artifactsDir @@ "NUnitDotCover.snapshot";artifactsDir @@ "MSpecDotCover.snapshot"]
Output = artifactsDir @@ "DotCover.snapshot" })
# generate a HTML report
# you could also generate other report types here (such as NDepend)
DotCoverReport (fun p -> { p with
Source = artifactsDir @@ "DotCover.snapshot"
Output = artifactsDir @@ "DotCover.htm"
ReportType = DotCoverReportType.Html })
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment