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

Skip to content

Commit d888a8d

Browse files
authored
Merge pull request #136 from Pazus/feature/tests_order
Sorted tests in suites in the order they appear in package
2 parents 661efac + f59ffb4 commit d888a8d

7 files changed

Lines changed: 154 additions & 136 deletions

source/core/annotations/ut_annotations.pkb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ create or replace package body ut_annotations as
146146
end;
147147
end;
148148

149-
function get_procedure_annotations(a_source clob, a_comments tt_comment_list) return tt_procedure_annotations is
149+
function get_procedure_list(a_source clob, a_comments tt_comment_list) return tt_procedure_list is
150150
l_proc_comments varchar2(32767);
151151
l_proc_name t_annotation_name;
152152
l_annot_proc_ind number;
153153
l_annot_proc_block varchar2(32767);
154154
l_procedure_annotations tt_procedure_annotations;
155+
l_procedure_list tt_procedure_list;
155156
begin
156157
-- loop through procedures and functions of the package and get all the comment blocks just before it's declaration
157158
l_annot_proc_ind := 1;
@@ -183,15 +184,18 @@ create or replace package body ut_annotations as
183184
,subexpression => 5));
184185

185186
-- parse the comment block for the syntactically correct annotations and store them as an array
186-
l_procedure_annotations(l_proc_name) := get_annotations(l_proc_comments, a_comments);
187+
l_procedure_annotations.name := l_proc_name;
188+
l_procedure_annotations.annotations := get_annotations(l_proc_comments, a_comments);
189+
190+
l_procedure_list(l_procedure_list.count+1) := l_procedure_annotations;
187191

188192
--l_annot_proc_ind := l_annot_proc_ind + length(l_annot_proc_block);
189193
l_annot_proc_ind := regexp_instr(srcstr => a_source
190194
,pattern => ';'
191195
,occurrence => 1
192196
,position => l_annot_proc_ind + length(l_annot_proc_block));
193197
end loop;
194-
return l_procedure_annotations;
198+
return l_procedure_list;
195199
end;
196200

197201
function extract_and_replace_comments(a_source in out nocopy clob) return tt_comment_list is
@@ -307,7 +311,7 @@ create or replace package body ut_annotations as
307311

308312
l_annotated_pkg.package_annotations := get_package_annotations(l_source, l_comments);
309313

310-
l_annotated_pkg.procedure_annotations := get_procedure_annotations(l_source, l_comments);
314+
l_annotated_pkg.procedure_annotations := get_procedure_list(l_source, l_comments);
311315

312316
-- printing out parsed structure for debugging
313317
$if $$ut_trace $then

source/core/annotations/ut_annotations.pks

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ create or replace package ut_annotations authid definer as
3939
type: tt_procedure_annotations
4040
a list of tt_annotations index by the procedure name
4141
*/
42-
type tt_procedure_annotations is table of tt_annotations index by t_procedure_name;
42+
type tt_procedure_annotations is record(name t_procedure_name, annotations tt_annotations);
43+
44+
type tt_procedure_list is table of tt_procedure_annotations index by pls_integer;
4345

4446
/*
4547
type: typ_annotated_package
4648
a structure containing a list of package level annotations and a list of procedure level annotations
4749

4850
*/
4951
type typ_annotated_package is record(
50-
procedure_annotations tt_procedure_annotations
52+
procedure_annotations tt_procedure_list
5153
,package_annotations tt_annotations);
5254

5355
/*

0 commit comments

Comments
 (0)