Skip to content

Conversation

@MarcoRossignoli
Copy link
Collaborator

@MarcoRossignoli MarcoRossignoli commented Aug 14, 2019

contributes to #387

Added report generator helper, in this way we can generate during debugging and testing full report to better understand if results are ok.

cc: @tonerdo @petli

@danielpalme I saw that report generator supports plugin...I would like "run generator" from my code base(adding core package) can you point me to some code sample?
I don't wan to create a custom report, only run, for instance ReportGenerator.Run(reportfile,reportdirectory)
BTW code below works well, but we could avoid global tool install.

@MarcoRossignoli MarcoRossignoli added the enhancement General enhancement request label Aug 14, 2019
@danielpalme
Copy link

@MarcoRossignoli
The following approach should work for you:

  1. Install package ReportGenerator.Core
  2. Use one of the following code snippets:
Palmmedia.ReportGenerator.Core.Program.Main($"-reports:\"{reportFile}\" \"-targetdir:{dir.FullName}\" {(string.IsNullOrEmpty(sourceFileFilter) ? string.Empty : $" -filefilters:{sourceFileFilter}")}");
new Palmmedia.ReportGenerator.Core.Generator().GenerateReport(new Palmmedia.ReportGenerator.Core.ReportConfiguration(
    new[] { reportFile },
    dir.FullName,
    new string[0],
    null,
    new string[0],
    new string[0],
    new string[0],
    new string[0],
    string.IsNullOrEmpty(sourceFileFilter) ? new string[0] : new[] { sourceFileFilter },
    null,
    null));

@MarcoRossignoli
Copy link
Collaborator Author

Great thank's!

@MarcoRossignoli MarcoRossignoli merged commit 4e02ab0 into coverlet-coverage:master Aug 14, 2019
@MarcoRossignoli MarcoRossignoli deleted the addreportgenerator branch August 14, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement General enhancement request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants