Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
106 changes: 53 additions & 53 deletions source/api/ut.pkb

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions source/api/ut.pks
Original file line number Diff line number Diff line change
Expand Up @@ -49,74 +49,74 @@ create or replace package ut authid current_user as

function run(
a_reporter ut_reporter_base := null, a_color_console integer := 0,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
) return ut_varchar2_rows pipelined;

function run(
a_reporter ut_reporter_base := null, a_color_console integer := 0,
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
) return ut_varchar2_rows pipelined;

function run(
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console integer := 0,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
) return ut_varchar2_rows pipelined;

function run(
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console integer := 0,
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
) return ut_varchar2_rows pipelined;

function run(
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console integer := 0,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
) return ut_varchar2_rows pipelined;

function run(
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console integer := 0,
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
) return ut_varchar2_rows pipelined;

procedure run(
a_reporter ut_reporter_base := null, a_color_console boolean := false,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
);

procedure run(
a_reporter ut_reporter_base := null, a_color_console boolean := false,
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
);

procedure run(
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console boolean := false,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
);

procedure run(
a_paths ut_varchar2_list, a_reporter ut_reporter_base := null, a_color_console boolean := false,
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
);

procedure run(
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console boolean := false,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
);

procedure run(
a_path varchar2, a_reporter ut_reporter_base := null, a_color_console boolean := false,
a_coverage_schemes ut_varchar2_list := null,a_coverage_type varchar2:=null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null
a_coverage_schemes ut_varchar2_list := null, a_source_files ut_varchar2_list, a_test_files ut_varchar2_list,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_coverage_type varchar2:=null
);

/**
Expand Down
4 changes: 2 additions & 2 deletions source/api/ut_runner.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ create or replace package body ut_runner is

procedure run(
a_paths ut_varchar2_list, a_reporters ut_reporters, a_color_console boolean := false,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_fail_on_errors boolean default false
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
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
) is
l_items_to_run ut_run;
l_listener ut_event_listener;
Expand Down
5 changes: 3 additions & 2 deletions source/api/ut_runner.pks
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ create or replace package ut_runner authid current_user is
*/
procedure run(
a_paths ut_varchar2_list, a_reporters ut_reporters, a_color_console boolean := false,
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,
a_include_objects ut_varchar2_list := null, a_exclude_objects ut_varchar2_list := null, a_fail_on_errors boolean default false
a_coverage_schemes ut_varchar2_list := null, a_source_file_mappings ut_file_mappings := null, a_test_file_mappings ut_file_mappings := null,
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
);

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
create or replace package body ut_block_helper is
create or replace package body ut_block_coverage_helper is
/*
utPLSQL - Version 3
Copyright 2016 - 2017 utPLSQL Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
create or replace package ut_block_helper authid definer is
create or replace package ut_block_coverage_helper authid definer is
/*
utPLSQL - Version 3
Copyright 2016 - 2017 utPLSQL Project
Expand Down
2 changes: 1 addition & 1 deletion source/core/coverage/ut_coverage_block.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ create or replace package body ut_coverage_block is
exit when l_source_objects_crsr%notfound;

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

--if there is coverage, we need to filter out the garbage (badly indicated data)
if l_line_calls.count > 0 then
Expand Down
8 changes: 4 additions & 4 deletions source/core/coverage/ut_coverage_helper.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ create or replace package body ut_coverage_helper is
set_coverage_type(a_coverage_type);
if get_coverage_type = ut_coverage.c_block_coverage then
$if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then
ut_block_helper.coverage_start(a_run_comment => a_run_comment ,a_coverage_id => g_coverage_id );
ut_block_coverage_helper.coverage_start(a_run_comment => a_run_comment ,a_coverage_id => g_coverage_id );
$else
null;
raise_application_error(ut_utils.gc_invalid_coverage_type,'Invalid coverage type requested. Please validate your Oracle install');
$end
else
ut_proftab_helper.coverage_start(a_run_comment => a_run_comment, a_coverage_id => g_coverage_id);
Expand Down Expand Up @@ -123,7 +123,7 @@ create or replace package body ut_coverage_helper is
g_is_started := false;
if get_coverage_type = ut_coverage.c_block_coverage then
$if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then
ut_block_helper.coverage_stop();
ut_block_coverage_helper.coverage_stop();
$else
null;
$end
Expand All @@ -139,7 +139,7 @@ create or replace package body ut_coverage_helper is
g_is_started := false;
if get_coverage_type = ut_coverage.c_block_coverage then
$if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then
ut_block_helper.coverage_stop();
ut_block_coverage_helper.coverage_stop();
$else
null;
$end
Expand Down
5 changes: 5 additions & 0 deletions source/core/ut_utils.pks
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ create or replace package ut_utils authid definer is
gc_invalid_version_no constant pls_integer := -20214;
pragma exception_init(ex_invalid_version_no, -20214);

-- Invalid coverage type
ex_invalid_coverage_type exception;
gc_invalid_coverage_type constant pls_integer := -20215;
pragma exception_init(ex_invalid_coverage_type, -20215);

gc_max_storage_varchar2_len constant integer := 4000;
gc_max_output_string_length constant integer := 4000;
gc_max_input_string_length constant integer := gc_max_output_string_length - 2; --we need to remove 2 chars for quotes around string
Expand Down
4 changes: 2 additions & 2 deletions source/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ prompt Installing DBMSPLSQL Tables objects into &&ut3_owner schema
--gathering coverage
@@install_component.sql 'core/coverage/ut_coverage_sources_tmp.sql'
@@install_component.sql 'core/coverage/ut_coverage_helper.pks'
@@install_above_12_1.sql 'core/coverage/ut_block_helper.pks'
@@install_above_12_1.sql 'core/coverage/ut_block_coverage_helper.pks'
@@install_component.sql 'core/coverage/ut_proftab_helper.pks'
@@install_component.sql 'core/coverage/ut_coverage.pks'
@@install_above_12_1.sql 'core/coverage/ut_coverage_block.pks'
@@install_component.sql 'core/coverage/ut_coverage_proftab.pks'
@@install_component.sql 'core/coverage/ut_coverage_reporter_base.tps'
@@install_component.sql 'core/coverage/ut_coverage_helper.pkb'
@@install_above_12_1.sql 'core/coverage/ut_block_helper.pkb'
@@install_above_12_1.sql 'core/coverage/ut_block_coverage_helper.pkb'
@@install_component.sql 'core/coverage/ut_proftab_helper.pkb'
@@install_component.sql 'core/coverage/ut_coverage.pkb'
@@install_above_12_1.sql 'core/coverage/ut_coverage_block.pkb'
Expand Down
28 changes: 28 additions & 0 deletions test/install_below_12_2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
set termout off
set echo off
spool dummy.sql
prompt whenever sqlerror exit failure rollback
spool off


def FILE_NAME = '&&1'
column SCRIPT_NAME new_value SCRIPT_NAME noprint

VAR V_FILE_NAME VARCHAR2(1000);
begin
if dbms_db_version.version = 12 and dbms_db_version.release < 2
or dbms_db_version.version < 12
then
:V_FILE_NAME := '&&FILE_NAME';
else
:V_FILE_NAME := 'dummy.sql';
end if;
end;
/
set verify off
select :V_FILE_NAME as SCRIPT_NAME from dual;
set termout on


@@&&SCRIPT_NAME

4 changes: 4 additions & 0 deletions test/install_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ whenever oserror exit failure rollback
@@core/test_suite_manager.pks
@@core/reporters/test_coverage.pks
set define on
@@install_below_12_2.sql 'core/reporters/test_not_existing_block.pks'
@@install_below_12_2.sql 'core/reporters/test_not_existing_block.pkb'
set define off
set define on
@@install_above_12_1.sql 'core/reporters/test_block_coverage.pks'
@@install_above_12_1.sql 'core/reporters/test_coverage/test_html_block_reporter.pks'
@@install_above_12_1.sql 'core/reporters/test_coverage/test_coveralls_reporter_block.pks'
Expand Down