Fake.Testing.ReportGenerator

INFO

This documentation is for FAKE version 5.0 or later. The old documentation can be found here

ReportGenerator converts XML reports generated by OpenCover, PartCover, dotCover, Visual Studio, NCover or Cobertura into human readable reports in various formats.

he reports do not only show the coverage quota, but also include the source code and visualize which lines have been covered.

ReportGenerator supports merging several reports into one. It is also possible to pass one XML file containing several reports to ReportGenerator (e.g. a build log file).

See https://github.com/danielpalme/ReportGenerator

API-Reference

Minimal working example

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
"#r paket:
nuget Fake.Core.Target
nuget Fake.Testing.ReportGenerator"

open Fake.Core
open Fake.Core.TargetOperators
open Fake.Testing

Target.create "Generate Reports" (fun _ ->
   !! "**/opencover.xml"
   |> Seq.toList
   |> ReportGenerator.generateReports (fun p -> { p with TargetDir = "c:/reports/" })
 )


Target.runOrDefault "Generate Reports"
module Seq

from Microsoft.FSharp.Collections
val toList : source:seq<'T> -> 'T list