Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit faab0fe

Browse files
authored
Merge pull request #625 from lwasylow/feature/12cblockcoverage
12.2 coverage
2 parents e968f76 + 0f1d789 commit faab0fe

12 files changed

Lines changed: 128 additions & 90 deletions

source/api/ut.pkb

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

source/api/ut.pks

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,74 +49,74 @@ create or replace package ut authid current_user as
4949

5050
function run(
5151
a_reporter ut_reporter_base := null, a_color_console integer := 0,
52-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
53-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
52+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
53+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
5454
) return ut_varchar2_rows pipelined;
5555

5656
function run(
5757
a_reporter ut_reporter_base := null, a_color_console integer := 0,
58-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
59-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
58+
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
59+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
6060
) return ut_varchar2_rows pipelined;
6161

6262
function run(
6363
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console integer := 0,
64-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
65-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
64+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
65+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
6666
) return ut_varchar2_rows pipelined;
6767

6868
function run(
6969
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console integer := 0,
70-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
71-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
70+
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
71+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
7272
) return ut_varchar2_rows pipelined;
7373

7474
function run(
7575
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console integer := 0,
76-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
77-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
76+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
77+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
7878
) return ut_varchar2_rows pipelined;
7979

8080
function run(
8181
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console integer := 0,
82-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
83-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
82+
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
83+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
8484
) return ut_varchar2_rows pipelined;
8585

8686
procedure run(
8787
a_reporter ut_reporter_base := null, a_color_console boolean := false,
88-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
89-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
88+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
89+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
9090
);
9191

9292
procedure run(
9393
a_reporter ut_reporter_base := null, a_color_console boolean := false,
94-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
95-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
94+
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
95+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
9696
);
9797

9898
procedure run(
9999
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console boolean := false,
100-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
101-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
100+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
101+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
102102
);
103103

104104
procedure run(
105105
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console boolean := false,
106-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
107-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
106+
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
107+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
108108
);
109109

110110
procedure run(
111111
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console boolean := false,
112-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
113-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
112+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
113+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
114114
);
115115

116116
procedure run(
117117
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console boolean := false,
118-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
119-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
118+
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
119+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
120120
);
121121

122122
/**

source/api/ut_runner.pkb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ create or replace package body ut_runner is
6666

6767
procedure run(
6868
a_paths ut_varchar2_list, a_reporters ut_reporters, a_color_console boolean := false,
69-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2 := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
70-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_fail_on_errors boolean default false
69+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
70+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_fail_on_errors boolean default false,a_coverage_type varchar2 := null
7171
) is
7272
l_items_to_run ut_run;
7373
l_listener ut_event_listener;

source/api/ut_runner.pks

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ create or replace package ut_runner authid current_user is
5757
*/
5858
procedure run(
5959
a_paths ut_varchar2_list, a_reporters ut_reporters, a_color_console boolean := false,
60-
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2 := null , a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
61-
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_fail_on_errors boolean default false
60+
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
61+
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null,
62+
a_fail_on_errors boolean default false, a_coverage_type varchar2 := null
6263
);
6364

6465
/**

source/core/coverage/ut_block_helper.pkb renamed to source/core/coverage/ut_block_coverage_helper.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
create or replace package body ut_block_helper is
1+
create or replace package body ut_block_coverage_helper is
22
/*
33
utPLSQL - Version 3
44
Copyright 2016 - 2017 utPLSQL Project

source/core/coverage/ut_block_helper.pks renamed to source/core/coverage/ut_block_coverage_helper.pks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
create or replace package ut_block_helper authid definer is
1+
create or replace package ut_block_coverage_helper authid definer is
22
/*
33
utPLSQL - Version 3
44
Copyright 2016 - 2017 utPLSQL Project

source/core/coverage/ut_coverage_block.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ create or replace package body ut_coverage_block is
104104
exit when l_source_objects_crsr%notfound;
105105

106106
--get coverage data
107-
l_line_calls := ut_block_helper.get_raw_coverage_data_block(l_source_object.owner, l_source_object.name);
107+
l_line_calls := ut_block_coverage_helper.get_raw_coverage_data_block(l_source_object.owner, l_source_object.name);
108108

109109
--if there is coverage, we need to filter out the garbage (badly indicated data)
110110
if l_line_calls.count > 0 then

source/core/coverage/ut_coverage_helper.pkb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ create or replace package body ut_coverage_helper is
7070
set_coverage_type(a_coverage_type);
7171
if get_coverage_type = ut_coverage.c_block_coverage then
7272
$if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then
73-
ut_block_helper.coverage_start(a_run_comment => a_run_comment ,a_coverage_id => g_coverage_id );
73+
ut_block_coverage_helper.coverage_start(a_run_comment => a_run_comment ,a_coverage_id => g_coverage_id );
7474
$else
75-
null;
75+
raise_application_error(ut_utils.gc_invalid_coverage_type,'Invalid coverage type requested. Please validate your Oracle install');
7676
$end
7777
else
7878
ut_proftab_helper.coverage_start(a_run_comment => a_run_comment, a_coverage_id => g_coverage_id);
@@ -123,7 +123,7 @@ create or replace package body ut_coverage_helper is
123123
g_is_started := false;
124124
if get_coverage_type = ut_coverage.c_block_coverage then
125125
$if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then
126-
ut_block_helper.coverage_stop();
126+
ut_block_coverage_helper.coverage_stop();
127127
$else
128128
null;
129129
$end
@@ -139,7 +139,7 @@ create or replace package body ut_coverage_helper is
139139
g_is_started := false;
140140
if get_coverage_type = ut_coverage.c_block_coverage then
141141
$if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then
142-
ut_block_helper.coverage_stop();
142+
ut_block_coverage_helper.coverage_stop();
143143
$else
144144
null;
145145
$end

source/core/ut_utils.pks

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ create or replace package ut_utils authid definer is
9090
gc_invalid_version_no constant pls_integer := -20214;
9191
pragma exception_init(ex_invalid_version_no, -20214);
9292

93+
-- Invalid coverage type
94+
ex_invalid_coverage_type exception;
95+
gc_invalid_coverage_type constant pls_integer := -20215;
96+
pragma exception_init(ex_invalid_coverage_type, -20215);
97+
9398
gc_max_storage_varchar2_len constant integer := 4000;
9499
gc_max_output_string_length constant integer := 4000;
95100
gc_max_input_string_length constant integer := gc_max_output_string_length - 2; --we need to remove 2 chars for quotes around string

source/install.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ prompt Installing DBMSPLSQL Tables objects into &&ut3_owner schema
127127
--gathering coverage
128128
@@install_component.sql 'core/coverage/ut_coverage_sources_tmp.sql'
129129
@@install_component.sql 'core/coverage/ut_coverage_helper.pks'
130-
@@install_above_12_1.sql 'core/coverage/ut_block_helper.pks'
130+
@@install_above_12_1.sql 'core/coverage/ut_block_coverage_helper.pks'
131131
@@install_component.sql 'core/coverage/ut_proftab_helper.pks'
132132
@@install_component.sql 'core/coverage/ut_coverage.pks'
133133
@@install_above_12_1.sql 'core/coverage/ut_coverage_block.pks'
134134
@@install_component.sql 'core/coverage/ut_coverage_proftab.pks'
135135
@@install_component.sql 'core/coverage/ut_coverage_reporter_base.tps'
136136
@@install_component.sql 'core/coverage/ut_coverage_helper.pkb'
137-
@@install_above_12_1.sql 'core/coverage/ut_block_helper.pkb'
137+
@@install_above_12_1.sql 'core/coverage/ut_block_coverage_helper.pkb'
138138
@@install_component.sql 'core/coverage/ut_proftab_helper.pkb'
139139
@@install_component.sql 'core/coverage/ut_coverage.pkb'
140140
@@install_above_12_1.sql 'core/coverage/ut_coverage_block.pkb'

0 commit comments

Comments
 (0)