Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addreportgeneratorhistorydir #1003

Merged
merged 4 commits into from
Nov 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/app/FakeLib/ReportGeneratorHelper.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Contains a task which can be used to run [ReportGenerator](https://reportgenerator.codeplex.com),
/// Contains a task which can be used to run [ReportGenerator](https://github.com/danielpalme/ReportGenerator),
/// which converts XML reports generated by PartCover, OpenCover or NCover into a readable report in various formats.
module Fake.ReportGeneratorHelper

Expand Down Expand Up @@ -29,6 +29,9 @@ type ReportGeneratorParams =
ReportTypes : ReportGeneratorReportType list
/// Optional directories which contain the corresponding source code.
SourceDirs : string list
/// Optional directory for storing persistent coverage information.
/// Can be used in future reports to show coverage evolution.
HistoryDir : string
/// Optional list of assemblies that should be included or excluded
/// in the report. Exclusion filters take precedence over inclusion
/// filters. Wildcards are allowed.
Expand All @@ -46,6 +49,7 @@ let ReportGeneratorDefaultParams =
TargetDir = currentDirectory
ReportTypes = [ ReportGeneratorReportType.Html ]
SourceDirs = []
HistoryDir = String.Empty
Filters = []
LogVerbosity = ReportGeneratorLogVerbosity.Verbose
WorkingDir = currentDirectory
Expand All @@ -63,6 +67,7 @@ let buildReportGeneratorArgs parameters (reports : string seq) =
|> append (sprintf "-targetdir:%s" parameters.TargetDir)
|> appendWithoutQuotes (sprintf "-reporttypes:%s" (String.Join(";", reportTypes)))
|> appendIfTrue (parameters.SourceDirs.Length > 0) sourceDirs
|> appendStringIfValueIsNotNullOrEmpty (parameters.HistoryDir) (sprintf "-historydir:%s" parameters.HistoryDir)
|> appendIfTrue (parameters.Filters.Length > 0) filters
|> appendWithoutQuotes (sprintf "-verbosity:%s" (parameters.LogVerbosity.ToString()))
|> toText
Expand Down
9 changes: 9 additions & 0 deletions src/test/Test.FAKECore/ReportGeneratorHelperSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ internal class when_executing_with_default_arguments : BuildReportArgumentsSpecs
};
It should_not_append_source_dirs = () => Arguments.ShouldNotContain("-sourcedirs:");
It should_not_append_filters = () => Arguments.ShouldNotContain("-filters:");
It should_not_append_history_dir = () => Arguments.ShouldNotContain("-historydir:");
It should_have_a_log_verbosity_of_verbose = () => Arguments.ShouldContain("-verbosity:Verbose");
}

Expand Down Expand Up @@ -104,4 +105,12 @@ internal class when_given_one_or_more_filters : BuildReportArgumentsSpecs

It should_append_filters_with_quotes = () => Arguments.ShouldContain("\"-filters:+Included;-Excluded\"");
}

internal class when_given_history_directory : BuildReportArgumentsSpecs
{
Establish context =
() => Parameters = Parameters.With(p => p.HistoryDir, "./history/");

It should_append_history_dir = () => Arguments.ShouldContain("-historydir:./history/");
}
}