Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Feature - include/exclude objects and schemas by regex #1186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
…ture/1053_exclude_include_cov_by_regex

Adding supporting tests
  • Loading branch information
lwasylow committed Feb 23, 2022
commit fc7bee9490c025b8b48db755584c03eb7df6d11a
2 changes: 1 addition & 1 deletion 2 source/core/coverage/ut_coverage.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ create or replace package body ut_coverage is
if a_coverage_options.file_mappings is not empty then
open l_cursor for l_sql using a_coverage_options.file_mappings, l_skip_objects;
elsif a_coverage_options.include_objects is not empty then
open l_cursor for l_sql using a_coverage_options.include_objects, a_coverage_options.include_objects, l_skip_objects;
open l_cursor for l_sql using a_coverage_options.include_objects, l_skip_objects;
elsif a_coverage_options.include_schema_expr is not null or a_coverage_options.include_object_expr is not null then
open l_cursor for l_sql using l_skip_objects;
else
Expand Down
91 changes: 91 additions & 0 deletions 91 test/ut3_tester_helper/coverage_helper.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,97 @@ create or replace package body coverage_helper is

end;

procedure create_regex_dummy_cov is
pragma autonomous_transaction;
begin
execute immediate q'[create or replace package ut3_develop.regex_dummy_cov is
procedure do_stuff(i_input in number);
end;]';

execute immediate q'[create or replace package body ut3_develop.regex_dummy_cov is
procedure do_stuff(i_input in number) is
begin
if i_input = 2 then dbms_output.put_line('should not get here'); elsif i_input = 1 then dbms_output.put_line('should get here');
else
dbms_output.put_line('should not get here');
end if;
end;
end;]';

execute immediate q'[create or replace package ut3_develop.test_regex_dummy_cov is
--%suite(dummy coverage test)
--%suitepath(coverage_testing)

--%test
procedure test_do_stuff;

end;]';

execute immediate q'[create or replace package body ut3_develop.test_regex_dummy_cov is
procedure test_do_stuff is
begin
regex_dummy_cov.do_stuff(1);
ut.expect(1).to_equal(1);
end;
end;]';
end;

procedure drop_regex_dummy_cov is
pragma autonomous_transaction;
begin
begin execute immediate q'[drop package ut3_develop.regex_dummy_cov]'; exception when others then null; end;
begin execute immediate q'[drop package ut3_develop.test_regex_dummy_cov]'; exception when others then null; end;
end;

procedure create_regex_dummy_cov_schema is
pragma autonomous_transaction;
begin
execute immediate q'[create or replace package ut3_develop.]'||covered_package_name||q'[ is
procedure do_stuff(i_input in number);
end;]';

execute immediate q'[create or replace package body ut3_develop.]'||covered_package_name||q'[ is
procedure do_stuff(i_input in number) is
begin
if i_input = 2 then dbms_output.put_line('should not get here'); elsif i_input = 1 then dbms_output.put_line('should get here');
else
dbms_output.put_line('should not get here');
end if;
end;
end;]';

execute immediate q'[create or replace package ut3_develop.test_dummy_coverage is
--%suite(dummy coverage test)
--%suitepath(coverage_testing)

--%test
procedure test_do_stuff;

--%test
procedure zero_coverage;
end;]';

execute immediate q'[create or replace package body ut3_develop.test_dummy_coverage is
procedure test_do_stuff is
begin
]'||covered_package_name||q'[.do_stuff(1);
ut.expect(1).to_equal(1);
end;
procedure zero_coverage is
begin
null;
end;
end;]';
end;

procedure drop_regex_dummy_cov_schema is
pragma autonomous_transaction;
begin
begin execute immediate q'[drop package ut3_helper.regex_dummy_cov_schema]'; exception when others then null; end;
begin execute immediate q'[drop package ut3_develop.test_regex_dummy_cov_schema]'; exception when others then null; end;
end;


procedure drop_cov_with_dbms_stats is
pragma autonomous_transaction;
begin
Expand Down
6 changes: 6 additions & 0 deletions 6 test/ut3_tester_helper/coverage_helper.pks
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ create or replace package coverage_helper is
procedure create_dummy_coverage_1;
procedure drop_dummy_coverage_1;

procedure create_regex_dummy_cov;
procedure drop_regex_dummy_cov;

procedure create_regex_dummy_cov_schema;
procedure drop_regex_dummy_cov_schema;

procedure create_cov_with_dbms_stats;
procedure drop_cov_with_dbms_stats;

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.