Skip to content

Commit

Permalink
Display source code in the html reports
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Aug 7, 2024
1 parent 6be8f4f commit 64762f0
Show file tree
Hide file tree
Showing 44 changed files with 1,023 additions and 119 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ This is an example of the summary report of a test session:
- [Reporting](#reporting)
- [Report generation](#report-generation)
- [Content of the reports](#content-of-the-reports)
- [Include the source code](#include-the-source-code)
- [Contributing and Architecture](#contributing-and-architecture)

## Quick Start
Expand Down Expand Up @@ -260,12 +261,14 @@ where:
- count: number of coverage rules generated.
- error: number of coverage rules that have not been evaluated because some error.

Class name is clickable to display a report that contains the details for queries that have been evaluated,
identified by the method name and line number:
Each class name is clickable to display a report that contains the details for queries that have been evaluated:

![Example of a summary report](docs/image-class.png)
![Example of a summary report](docs/image-class-1.png)
...
![Example of a summary report](docs/image-class-2.png)

Method name is clickable to show the detail of each coverage rule (covered in green, uncovered in yellow):
Clicking the down arrow near the percent coverage and the query executed
shows the details of each coverage rule (covered in green, uncovered in yellow):
- A textual message that explains the test situation that the coverage rule represents.
If a coverage rule is not covered, a test and/or the appropriate test data may be added in order to cover it.
- The SQL representation of the coverage rule.
Expand All @@ -275,6 +278,35 @@ Method name is clickable to show the detail of each coverage rule (covered in gr
- count: number of times that the coverage rule has been executed.
- category, type, subtype, location: A classification about where the coverage rule comes from.

### Include the source code

The general syntax of the report generator has four parameters, only the two first ones are required
if you do not include the source code of the classes under test:
```
<rules-folder> <reports-folder> [<source-folders> [project-folder]]
```

On Java, if you want to include the source code in the reports, you have to set a value for the third parameter
`<source-folders>` to include a comma-separate list of the path(s) to locate the sources. For example:
- If executing the reports from the root of a maven Java project,
set `src/main/java`.
- If executing the reports form the root of a multimodule Java project (parent project) with two modules,
set `module1/src/main/java,module2/src/main/java`.

On .NET, you have to set a value for the third and fourth parameter.
The reason is that the location of source files does not exactly match the namespaces, so that,
the FPC coverage rules store the absolute path of the class source files that has to be
resolved to a relative path before report generation. For example:
- If executing the reports from a solution folder that contains a project, set both parameters to `.`
- If executing the reports from the unit tests in a solution that contains a project,
set both parameters to `../../../..` (because the default directory where the tests run
is four levels down the solution folder)
- If executing the reports from a solution folder that contains a project,
but the reports where generated inside a container that runs a server application under the `/app` folder,
set the parameters as `.` `/app` (The `/app` value allows to resolve the relative path of each source file
from the project folder).


## Contributing and Architecture

See the general contribution policies and guidelines for *giis-uniovi* at
Expand Down
Binary file added docs/image-class-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/image-class-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/image-class.png
Binary file not shown.
Binary file modified docs/image-index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion net/QACover/QACover.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PortableCs" Version="2.2.3" />
<PackageReference Include="PortableCs" Version="2.3.0" />

<PackageReference Include="TdRules" Version="4.3.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion net/QACover/QACoverReport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PortableCs" Version="2.2.3" />
<PackageReference Include="PortableCs" Version="2.3.0" />

<PackageReference Include="TdRules" Version="4.3.0" />
</ItemGroup>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion net/QACover/Translated/Giis.Qacover.Core/Controller.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion net/QACover/Translated/Giis.Qacover.Model/QueryModel.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 92 additions & 0 deletions net/QACover/Translated/Giis.Qacover.Reader/SourceCodeCollection.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions net/QACover/Translated/Giis.Qacover.Reader/SourceCodeLine.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions net/QACover/Translated/Giis.Qacover.Report/ClassHtmlWriter.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion net/QACover/Translated/Giis.Qacover.Report/ReportMain.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 64762f0

Please sign in to comment.