Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
287590b
12.2 Stable :
lwasylow Mar 11, 2018
68768f8
12.2 Stable :
lwasylow Mar 13, 2018
76bf869
12.2 Stable :
lwasylow Mar 13, 2018
1f4f5f0
Tests 12.2 Coverage:
lwasylow Mar 14, 2018
90858eb
Added 12.2 coverage
lwasylow Mar 14, 2018
d77cf9a
Test 12.2 coverage
lwasylow Mar 14, 2018
4f83357
Added 12.2 Coverage
lwasylow Mar 14, 2018
ac40332
Added 12.2 Coverage
lwasylow Mar 14, 2018
5f74db9
Merge pull request #602 from lwasylow/12coveragestab2
lwasylow Mar 14, 2018
9d7f16c
Added conditional install of tests for 12.2 only - when block coverag…
jgebal Mar 15, 2018
20541b5
Refactoring coverage:
lwasylow Mar 18, 2018
ab7eb93
Coverage Refactoring:
lwasylow Mar 23, 2018
8dbb1a1
Merge pull request #614 from lwasylow/feature/12cblockcoverage
lwasylow Mar 25, 2018
e0b220d
Merge branch 'develop' into feature/12cblockcoverage
lwasylow Mar 25, 2018
2560f5b
Revert "Feature/12cblockcoverage"
lwasylow Mar 25, 2018
6fe32c5
Merge pull request #615 from utPLSQL/revert-614-feature/12cblockcoverage
lwasylow Mar 25, 2018
8235848
Refactor Coverage:
lwasylow Mar 25, 2018
78fdab5
Refactor Coverage:
lwasylow Mar 25, 2018
3a19341
Merge branch 'feature/12cblockcoverage' of github.com:lwasylow/utPLSQ…
lwasylow Mar 25, 2018
466e126
Update test local
lwasylow Mar 25, 2018
e968f76
Merge pull request #616 from lwasylow/feature/12cblockcoverage
lwasylow Mar 25, 2018
0f1d789
12.2 coverage
lwasylow Apr 3, 2018
faab0fe
Merge pull request #625 from lwasylow/feature/12cblockcoverage
lwasylow Apr 3, 2018
35e5e13
12.2 coverage
lwasylow Apr 3, 2018
1289e99
Merge branch 'feature/12cblockcoverage' of github.com:lwasylow/utPLSQ…
lwasylow Apr 3, 2018
d3ce10c
Merge pull request #626 from lwasylow/feature/12cblockcoverage
lwasylow Apr 3, 2018
c0ca9d3
Fixing error in package name
lwasylow Apr 3, 2018
f151a6e
Update test
lwasylow Apr 4, 2018
28f7653
Statement Coverage First Commit
lwasylow Apr 7, 2018
1f51049
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
lwasylow Apr 7, 2018
9c87b06
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/12c…
lwasylow Apr 7, 2018
d8b8e87
Updated coverage with statement level information
lwasylow Apr 7, 2018
49b1b84
Move get_cov_sql function into common package to remove code duplication
lwasylow Apr 8, 2018
ab7eb24
Refactor Coverage to now enrich profile for partially covered lines u…
lwasylow Apr 8, 2018
36279fa
Update tests and fixed typo in original coverage reporter
lwasylow Apr 10, 2018
661ef74
Merge branch 'feature/12cblockcoverage' of https://github.com/utPLSQL…
lwasylow Apr 10, 2018
57f7a4f
Updated coverage
lwasylow Apr 11, 2018
3a2ff00
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
lwasylow Apr 11, 2018
e6c2be2
Merge pull request #640 from lwasylow/feature/12cov_extended
lwasylow Apr 11, 2018
c9cb004
Fixes to conditional compilation
lwasylow Apr 11, 2018
a862b95
Fixes to new asso array during mock coverage id.
lwasylow Apr 11, 2018
57ee184
Merge pull request #641 from lwasylow/feature/12cblockcoverage
lwasylow Apr 11, 2018
4561795
Update test
lwasylow Apr 11, 2018
0556fbe
Update test
lwasylow Apr 11, 2018
b91e51d
Merge branch 'feature/12cblockcoverage' of github.com:utPLSQL/utPLSQL…
lwasylow Apr 11, 2018
d19f941
Update test/core/reporters/test_extended_coverage.pkb
lwasylow Apr 11, 2018
e2e1437
Updated html reporter to show a information about the partially cover…
lwasylow Apr 11, 2018
a112e36
Added support for block coverage in sonar and cobertura reporters.
jgebal Apr 14, 2018
f0e2653
Clean-up and removal of unnecessary reporters
lwasylow Apr 15, 2018
4458dff
Unify reporters
lwasylow Apr 15, 2018
2027421
Update test
lwasylow Apr 15, 2018
924eb9b
Update issue with part covered being zero.
lwasylow Apr 15, 2018
a111c6d
Update for test with timestamp
lwasylow Apr 15, 2018
2d6c7d3
Merge branch 'develop' into feature/12cblockcoverage
lwasylow Apr 16, 2018
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
145 changes: 145 additions & 0 deletions test/core/reporters/test_not_existing_block.pkb
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
create or replace package body test_coverage is

g_run_id integer;

function get_mock_run_id return integer is
v_result integer;
begin
select nvl(min(runid),0) - 1 into v_result
from ut3.plsql_profiler_runs;
return v_result;
end;

procedure create_dummy_coverage_package is
pragma autonomous_transaction;
begin
execute immediate q'[create or replace package UT3.DUMMY_COVERAGE is
procedure do_stuff;
end;]';
execute immediate q'[create or replace package body UT3.DUMMY_COVERAGE is
procedure do_stuff is
begin
if 1 = 2 then
dbms_output.put_line('should not get here');
else
dbms_output.put_line('should get here');
end if;
end;
end;]';
end;

procedure create_dummy_coverage_test is
pragma autonomous_transaction;
begin
execute immediate q'[create or replace package UT3.TEST_DUMMY_COVERAGE is
--%suite(dummy coverage test)
--%suitepath(coverage_testing)

--%test
procedure test_do_stuff;
end;]';
execute immediate q'[create or replace package body UT3.TEST_DUMMY_COVERAGE is
procedure test_do_stuff is
begin
dummy_coverage.do_stuff;
end;
end;]';
end;

procedure create_dummy_coverage_test_1 is
pragma autonomous_transaction;
begin
execute immediate q'[create or replace package UT3.DUMMY_COVERAGE_1 is
procedure do_stuff;
end;]';
execute immediate q'[create or replace package body UT3.DUMMY_COVERAGE_1 is
procedure do_stuff is
begin
if 1 = 2 then
dbms_output.put_line('should not get here');
else
dbms_output.put_line('should get here');
end if;
end;
end;]';
execute immediate q'[create or replace package UT3.TEST_DUMMY_COVERAGE_1 is
--%suite(dummy coverage test 1)
--%suitepath(coverage_testing)

--%test
procedure test_do_stuff;
end;]';
execute immediate q'[create or replace package body UT3.TEST_DUMMY_COVERAGE_1 is
procedure test_do_stuff is
begin
dummy_coverage_1.do_stuff;
end;
end;]';
end;

procedure drop_dummy_coverage_test_1 is
pragma autonomous_transaction;
begin
execute immediate q'[drop package UT3.DUMMY_COVERAGE_1]';
execute immediate q'[drop package UT3.TEST_DUMMY_COVERAGE_1]';
end;


procedure mock_coverage_data(a_run_id integer) is
c_unit_id constant integer := 1;
begin
insert into ut3.plsql_profiler_runs ( runid, run_owner, run_date, run_comment)
values(a_run_id, user, sysdate, 'unit testing utPLSQL');

insert into ut3.plsql_profiler_units ( runid, unit_number, unit_type, unit_owner, unit_name)
values(a_run_id, c_unit_id, 'PACKAGE BODY', 'UT3', 'DUMMY_COVERAGE');

insert into ut3.plsql_profiler_data ( runid, unit_number, line#, total_occur, total_time)
select a_run_id, c_unit_id, 4, 1, 1 from dual union all
select a_run_id, c_unit_id, 5, 0, 0 from dual union all
select a_run_id, c_unit_id, 7, 1, 1 from dual;
end;

procedure setup_dummy_coverage is
pragma autonomous_transaction;
begin
create_dummy_coverage_package();
create_dummy_coverage_test();
g_run_id := get_mock_run_id();
ut3.ut_coverage_helper.mock_coverage_id(g_run_id);
mock_coverage_data(g_run_id);
commit;
end;

procedure cleanup_dummy_coverage is
pragma autonomous_transaction;
begin
begin execute immediate q'[drop package ut3.test_dummy_coverage]'; exception when others then null; end;
begin execute immediate q'[drop package ut3.dummy_coverage]'; exception when others then null; end;
delete from ut3.plsql_profiler_data where runid = g_run_id;
delete from ut3.plsql_profiler_units where runid = g_run_id;
delete from ut3.plsql_profiler_runs where runid = g_run_id;
commit;
end;

procedure invalid_coverage_type is
l_expected clob;
l_actual clob;
l_results ut3.ut_varchar2_list;
begin
--Arrange
l_expected := '%<file path="ut3.dummy_coverage">%';
--Act
select *
bulk collect into l_results
from table(
ut3.ut.run(
a_path => 'ut3.test_dummy_coverage',
a_reporter=> ut3.ut_coverage_sonar_reporter( ),
a_include_objects => ut3.ut_varchar2_list( 'ut3.dummy_coverage' )
)
);
end;

end;
/
18 changes: 18 additions & 0 deletions test/core/reporters/test_not_existing_block.pks
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
create or replace package test_coverage is

--%suite
--%suitepath(utplsql.core.reporters)

--%beforeall
procedure setup_dummy_coverage;

--%afterall
procedure cleanup_dummy_coverage;


--%test(Coverage is requested for invalid type of coverage)
--%throws(-20215)
procedure invalid_coverage_type;

end;
/