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

Skip to content

Commit 171d876

Browse files
authored
Merge branch 'develop' into bugfix/coverage_filtering
2 parents 453fbff + 00d2fce commit 171d876

4 files changed

Lines changed: 43 additions & 46 deletions

File tree

source/core/types/ut_logical_suite.tpb

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,13 @@ create or replace type body ut_logical_suite as
6262
a_listener.fire_before_event(ut_utils.gc_suite,self);
6363
self.start_time := current_timestamp;
6464

65-
if self.get_disabled_flag() then
66-
self.result := ut_utils.tr_disabled;
67-
self.end_time := self.start_time;
68-
ut_utils.debug_log('ut_logical_suite.execute - disabled');
69-
else
70-
71-
self.start_time := current_timestamp;
72-
73-
for i in 1 .. self.items.count loop
74-
-- execute the item (test or suite)
75-
self.items(i).do_execute(a_listener);
76-
end loop;
77-
78-
self.calc_execution_result();
79-
self.end_time := current_timestamp;
65+
for i in 1 .. self.items.count loop
66+
-- execute the item (test or suite)
67+
self.items(i).do_execute(a_listener);
68+
end loop;
8069

81-
end if;
70+
self.calc_execution_result();
71+
self.end_time := current_timestamp;
8272

8373
a_listener.fire_after_event(ut_utils.gc_suite,self);
8474

source/core/types/ut_suite.tpb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ create or replace type body ut_suite as
5757
self.start_time := current_timestamp;
5858

5959
if self.get_disabled_flag() then
60-
self.result := ut_utils.tr_disabled;
61-
self.end_time := self.start_time;
60+
for i in 1 .. self.items.count loop
61+
self.items(i).do_execute(a_listener);
62+
end loop;
6263
ut_utils.debug_log('ut_suite.execute - disabled');
6364
else
6465

@@ -87,11 +88,9 @@ create or replace type body ut_suite as
8788
else
8889
propagate_error(ut_utils.table_to_clob(self.get_error_stack_traces()));
8990
end if;
90-
91-
self.calc_execution_result();
92-
self.end_time := current_timestamp;
93-
9491
end if;
92+
self.calc_execution_result();
93+
self.end_time := current_timestamp;
9594
a_listener.fire_after_event(ut_utils.gc_suite,self);
9695

9796
return l_suite_step_without_errors;

source/core/ut_suite_manager.pkb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ create or replace package body ut_suite_manager is
170170
,a_description => l_displayname
171171
,a_path => l_suite.path || '.' || l_proc_name
172172
,a_rollback_type => l_rollback_type
173-
,a_disabled_flag => l_proc_annotations.exists('disabled')
173+
,a_disabled_flag => l_annotation_data.package_annotations.exists('disabled') or l_proc_annotations.exists('disabled')
174174
,a_before_test_proc_name => l_beforetest_procedure
175175
,a_after_test_proc_name => l_aftertest_procedure
176176
,a_before_each_proc_name => l_default_setup_proc
@@ -422,8 +422,6 @@ create or replace package body ut_suite_manager is
422422
l_item_name varchar2(32767);
423423

424424
begin
425-
a_suite.set_disabled_flag(false);
426-
427425
if a_path is not null and a_suite is not null and a_suite is of (ut_logical_suite) then
428426
l_suite := treat(a_suite as ut_logical_suite);
429427

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
1-
PROMPT Disable whole suite by disabled flag
2-
31
--Arrange
2+
create or replace package test_disabled_suite as
3+
--%suite
4+
--%disabled
5+
gv_glob_val number := 0;
6+
--%beforeall
7+
procedure before_all;
8+
--%test
9+
procedure test1;
10+
--%test
11+
procedure test2;
12+
end;
13+
/
14+
415
declare
5-
l_suite ut_logical_suite;
6-
l_test ut_test;
7-
l_parsing_result ut_annotations.typ_annotated_package;
8-
l_expected ut_annotations.typ_annotated_package;
9-
l_ann_param ut_annotations.typ_annotation_param;
10-
l_cnt number;
11-
l_listener ut_event_listener := ut_event_listener(ut_reporters());
16+
l_lines ut_varchar2_list;
17+
l_results clob;
1218
begin
13-
14-
delete from ut$test_table;
15-
16-
l_test := ut_test(a_object_name => 'ut_transaction_control',a_name => 'test', a_rollback_type => ut_utils.gc_rollback_auto);
17-
l_suite := ut_suite (a_description => 'Suite name', a_name => 'UT_TRANSACTION_CONTROL', a_object_name => 'UT_TRANSACTION_CONTROL', a_rollback_type => ut_utils.gc_rollback_auto,a_path => 'ut_transaction_control');
18-
l_suite.add_item(l_test);
19-
l_suite.set_disabled_flag(true);
20-
2119
--Act
22-
l_suite.do_execute(l_listener);
20+
select * bulk collect into l_lines from table(ut.run('test_disabled_suite'));
2321

24-
ut_expectation_processor.clear_expectations;
22+
l_results := ut_utils.table_to_clob(l_lines);
2523

2624
--Assert
27-
ut.expect(ut_transaction_control.count_rows('t')).to_equal(0);
25+
ut.expect(l_results).to_be_like('%test1 [0 sec] (IGNORED)%');
26+
ut.expect(l_results).to_be_like('%test2 [0 sec] (IGNORED)%');
27+
ut.expect(l_results).to_be_like('%2 tests, 0 failed, 0 errored, 2 disabled, 0 warning(s)%');
2828

2929
if ut_expectation_processor.get_status = ut_utils.tr_success then
3030
:test_result := ut_utils.tr_success;
31+
else
32+
dbms_output.put_line(
33+
xmltype(
34+
anydata.convertcollection(
35+
ut_expectation_processor.get_expectations_results()
36+
)
37+
).getclobval()
38+
);
3139
end if;
32-
3340
end;
3441
/
42+
43+
drop package test_disabled_suite
44+
/

0 commit comments

Comments
 (0)