You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/userguide/coverage.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ If you have `execute` privilege on the code that are tested, but do not have `cr
29
29
If you have `execute` privilege only on the unit tests, but do not have `execute` privilege on the code that is tested, the code will not be reported by coverage - as if it did not exist in the database.
30
30
If the code that is testes is complied as NATIVE, the code coverage will not be reported as well.
31
31
32
-
## Running unite tests with coverage
32
+
## Running unit tests with coverage
33
33
Using code coverage functionality is as easy as using any other [reporter](reporters.md) for utPLSQL project. All you need to do is run your tests from your preferred SQL tool and save the outcomes of reporter to a file.
34
34
All you need to do, is pass the constructor of the reporter to your `ut.run`
35
35
@@ -40,6 +40,8 @@ begin
40
40
end;
41
41
/
42
42
```
43
+
44
+
43
45
Executes all unit tests in current schema, gather information about code coverage and output the html text into DBMS_OUTPUT.
44
46
The `ut_coverage_html_reporter` will produce a interactive HTML report. You may see a sample of code coverage for utPLSQL project [here](https://utplsql.github.io/utPLSQL-coverage-html/)
45
47
@@ -52,6 +54,20 @@ The report allow to navigate to every source and inspect line by line coverage.
In Oracle 12.2 new functionality was released which supports native [block coverage](https://docs.oracle.com/en/database/oracle/oracle-database/12.2/arpls/DBMS_PLSQL_CODE_COVERAGE.html#GUID-55A9E502-9EC2-4118-B292-DC79E6DC465E).
59
+
This has been enabled in utPLSQL code coverage as a separate option. It can be invoked by passing a argument a_coverage_type with value 'block'. By default profiler option is enabled ('proftab').
In this mode html reporter will show additionally number of lines that been partially covered and highlight them in orange. Number of blocks in code, blocks covered and missed.
70
+
55
71
## Coverage reporting options
56
72
By default the database schema/schemes containing the tests that were executed during the run, are fully reported by coverage reporter.
57
73
All valid unit tests are excluded from the report regardless if they were invoked or not. This way the coverage report is not affected by presence of tests and contains only the tested code.
0 commit comments