Skip to content

Commit

Permalink
Updated coveralls and sonar reporters to report on files uncovered as…
Browse files Browse the repository at this point in the history
… 100% uncovered.
  • Loading branch information
jgebal committed Mar 6, 2017
1 parent a0e14c9 commit c2b670c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions source/reporters/ut_coverage_sonar_reporter.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ create or replace type body ut_coverage_sonar_reporter is
function get_lines_xml(a_unit_coverage ut_coverage.t_unit_coverage) return clob is
l_file_part varchar2(32767);
l_result clob;
c_no_lines constant varchar2(100) := '<lineToCover lineNumber="1" covered="false"/>'||chr(10);
l_line_no binary_integer;
begin
dbms_lob.createtemporary(l_result, true);
l_line_no := a_unit_coverage.lines.first;
if l_line_no is null then
dbms_lob.writeappend(l_result, length(c_no_lines), c_no_lines);
for i in 1 .. a_unit_coverage.total_lines loop
l_file_part := '<lineToCover lineNumber="'||i||'" covered="false"/>'||chr(10);
dbms_lob.writeappend(l_result, length(l_file_part), l_file_part);
end loop;
else
while l_line_no is not null loop
l_file_part :=
Expand Down
8 changes: 7 additions & 1 deletion source/reporters/ut_coveralls_reporter.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ create or replace type body ut_coveralls_reporter is
dbms_lob.writeappend(l_result, length(c_coverage_header), c_coverage_header);

l_last_line_no := a_unit_coverage.lines.last;
if l_last_line_no is not null then
if l_last_line_no is null then
l_last_line_no := a_unit_coverage.total_lines - 1;
for i in 1 .. l_last_line_no loop
dbms_lob.writeappend(l_result, 2, '0,');
end loop;
dbms_lob.writeappend(l_result, 1, '0');
else
for line_no in 1 .. l_last_line_no loop
l_file_part :=
case
Expand Down

0 comments on commit c2b670c

Please sign in to comment.