Skip to content

Commit 2bb1fb4

Browse files
committed
Automated test
1 parent 4ed382f commit 2bb1fb4

File tree

4 files changed

+214
-0
lines changed

4 files changed

+214
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ check_extractor:
1818
(cd testsuite/extractor && ../../.objs/test_extractor gnat.json records.ads | diff -u --strip-trailing-cr records.out -)
1919
(cd testsuite/extractor && ../../.objs/test_extractor gnat.json tasks.ads | diff -u --strip-trailing-cr tasks.out -)
2020
(cd testsuite/extractor && ../../.objs/test_extractor gnat.json protecteds.ads | diff -u --strip-trailing-cr protecteds.ads.out -)
21+
(cd testsuite/extractor && ../../.objs/test_extractor gnat.json protecteds.adb | diff -u --strip-trailing-cr protecteds.adb.out -)

testsuite/drivers/test_extractor.adb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ procedure Test_Extractor is
153153

154154
when Ada_Single_Task_Decl | Ada_Task_Type_Decl
155155
| Ada_Single_Protected_Decl | Ada_Protected_Type_Decl
156+
| Ada_Protected_Body
156157
=>
157158
Extract_And_Dump;
158159

testsuite/extractor/protecteds.adb

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
-- This package contains test cases of documentation extraction for protected
3+
-- bodies. Coverage of tests of procedures/functions/entries are limited to
4+
-- few cases only (this code is tested by subprograms tests).
5+
6+
package body Protecteds is
7+
8+
-- type IE is synchronized interface;
9+
--
10+
-- type IP is synchronized interface;
11+
--
12+
-- not overriding procedure Process (Self : IP) is abstract;
13+
14+
-- Leading description of the protected body P_Leading.
15+
protected body P_Leading is
16+
end P_Leading;
17+
18+
protected body P_Intermediate is
19+
-- Intermediate description of the protected body P_Intermediate.
20+
end P_Intermediate;
21+
22+
-- Leading description of the protected type PT_Leading.
23+
protected body PT_Leading is
24+
end PT_Leading;
25+
26+
protected body PT_Intermediate is
27+
-- Intermediate description of the protected type PT_Intermediate.
28+
end PT_Intermediate;
29+
30+
protected body PT_Discriminant_Component_Short is
31+
end PT_Discriminant_Component_Short;
32+
33+
protected body PT_Discriminant_Component_Longer is
34+
end PT_Discriminant_Component_Longer;
35+
36+
protected body PT_Discriminant_Longer is
37+
end PT_Discriminant_Longer;
38+
39+
protected body P_Private_Components_Subprograms is
40+
-- Protected type declaration with mix of components/subprograms in private part.
41+
42+
procedure P is null;
43+
-- Description of the procedure P body
44+
45+
function F return Integer is (0);
46+
-- Description of the function F body
47+
48+
entry E when False is
49+
-- Description of the entry E body
50+
begin
51+
null;
52+
end E;
53+
54+
end P_Private_Components_Subprograms;
55+
56+
end Protecteds;
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<CompilationUnit protecteds.adb:6:1-56:16>
2+
<AdaNodeList protecteds.adb:6:1-6:1>
3+
<LibraryItem protecteds.adb:6:1-56:16>
4+
<PrivateAbsent protecteds.adb:6:1-6:1>
5+
<PackageBody ["Protecteds"] protecteds.adb:6:1-56:16>
6+
<DefiningName protecteds.adb:6:14-6:24>
7+
<Id "Protecteds" protecteds.adb:6:14-6:24>
8+
<DeclarativePart protecteds.adb:6:27-56:1>
9+
<AdaNodeList protecteds.adb:15:4-54:41>
10+
<ProtectedBody ["P_Leading"] protecteds.adb:15:4-16:18>
11+
**************************
12+
\/ RAW <<LEADING>> () 0 0 0 0
13+
Leading description of the protected body P_Leading.
14+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
15+
\/ DESCRIPTION () 0 0 0 0
16+
Leading description of the protected body P_Leading.
17+
**************************
18+
<DefiningName protecteds.adb:15:19-15:28>
19+
<Id "P_Leading" protecteds.adb:15:19-15:28>
20+
<DeclarativePart protecteds.adb:15:31-16:4>
21+
<AdaNodeList protecteds.adb:15:31-15:31>
22+
<EndName protecteds.adb:16:8-16:17>
23+
<Id "P_Leading" protecteds.adb:16:8-16:17>
24+
<ProtectedBody ["P_Intermediate"] protecteds.adb:18:4-20:23>
25+
**************************
26+
\/ RAW <<LEADING>> () 0 0 0 0
27+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
28+
Intermediate description of the protected body P_Intermediate.
29+
\/ DESCRIPTION () 0 0 0 0
30+
Intermediate description of the protected body P_Intermediate.
31+
**************************
32+
<DefiningName protecteds.adb:18:19-18:33>
33+
<Id "P_Intermediate" protecteds.adb:18:19-18:33>
34+
<DeclarativePart protecteds.adb:18:36-20:4>
35+
<AdaNodeList protecteds.adb:18:36-18:36>
36+
<EndName protecteds.adb:20:8-20:22>
37+
<Id "P_Intermediate" protecteds.adb:20:8-20:22>
38+
<ProtectedBody ["PT_Leading"] protecteds.adb:23:4-24:19>
39+
**************************
40+
\/ RAW <<LEADING>> () 0 0 0 0
41+
Leading description of the protected type PT_Leading.
42+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
43+
\/ DESCRIPTION () 0 0 0 0
44+
Leading description of the protected type PT_Leading.
45+
**************************
46+
<DefiningName protecteds.adb:23:19-23:29>
47+
<Id "PT_Leading" protecteds.adb:23:19-23:29>
48+
<DeclarativePart protecteds.adb:23:32-24:4>
49+
<AdaNodeList protecteds.adb:23:32-23:32>
50+
<EndName protecteds.adb:24:8-24:18>
51+
<Id "PT_Leading" protecteds.adb:24:8-24:18>
52+
<ProtectedBody ["PT_Intermediate"] protecteds.adb:26:4-28:24>
53+
**************************
54+
\/ RAW <<LEADING>> () 0 0 0 0
55+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
56+
Intermediate description of the protected type PT_Intermediate.
57+
\/ DESCRIPTION () 0 0 0 0
58+
Intermediate description of the protected type PT_Intermediate.
59+
**************************
60+
<DefiningName protecteds.adb:26:19-26:34>
61+
<Id "PT_Intermediate" protecteds.adb:26:19-26:34>
62+
<DeclarativePart protecteds.adb:26:37-28:4>
63+
<AdaNodeList protecteds.adb:26:37-26:37>
64+
<EndName protecteds.adb:28:8-28:23>
65+
<Id "PT_Intermediate" protecteds.adb:28:8-28:23>
66+
<ProtectedBody ["PT_Discriminant_Component_Short"] protecteds.adb:30:4-31:40>
67+
**************************
68+
\/ RAW <<LEADING>> () 0 0 0 0
69+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
70+
\/ DESCRIPTION () 0 0 0 0
71+
**************************
72+
<DefiningName protecteds.adb:30:19-30:50>
73+
<Id "PT_Discriminant_Component_Short" protecteds.adb:30:19-30:50>
74+
<DeclarativePart protecteds.adb:30:53-31:4>
75+
<AdaNodeList protecteds.adb:30:53-30:53>
76+
<EndName protecteds.adb:31:8-31:39>
77+
<Id "PT_Discriminant_Component_Short" protecteds.adb:31:8-31:39>
78+
<ProtectedBody ["PT_Discriminant_Component_Longer"] protecteds.adb:33:4-34:41>
79+
**************************
80+
\/ RAW <<LEADING>> () 0 0 0 0
81+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
82+
\/ DESCRIPTION () 0 0 0 0
83+
**************************
84+
<DefiningName protecteds.adb:33:19-33:51>
85+
<Id "PT_Discriminant_Component_Longer" protecteds.adb:33:19-33:51>
86+
<DeclarativePart protecteds.adb:33:54-34:4>
87+
<AdaNodeList protecteds.adb:33:54-33:54>
88+
<EndName protecteds.adb:34:8-34:40>
89+
<Id "PT_Discriminant_Component_Longer" protecteds.adb:34:8-34:40>
90+
<ProtectedBody ["PT_Discriminant_Longer"] protecteds.adb:36:4-37:31>
91+
**************************
92+
\/ RAW <<LEADING>> () 0 0 0 0
93+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
94+
\/ DESCRIPTION () 0 0 0 0
95+
**************************
96+
<DefiningName protecteds.adb:36:19-36:41>
97+
<Id "PT_Discriminant_Longer" protecteds.adb:36:19-36:41>
98+
<DeclarativePart protecteds.adb:36:44-37:4>
99+
<AdaNodeList protecteds.adb:36:44-36:44>
100+
<EndName protecteds.adb:37:8-37:30>
101+
<Id "PT_Discriminant_Longer" protecteds.adb:37:8-37:30>
102+
<ProtectedBody ["P_Private_Components_Subprograms"] protecteds.adb:39:4-54:41>
103+
**************************
104+
\/ RAW <<LEADING>> () 0 0 0 0
105+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
106+
Protected type declaration with mix of components/subprograms in private part.
107+
\/ DESCRIPTION () 0 0 0 0
108+
Protected type declaration with mix of components/subprograms in private part.
109+
**************************
110+
<DefiningName protecteds.adb:39:19-39:51>
111+
<Id "P_Private_Components_Subprograms" protecteds.adb:39:19-39:51>
112+
<DeclarativePart protecteds.adb:39:54-54:4>
113+
<AdaNodeList protecteds.adb:42:7-52:13>
114+
<NullSubpDecl ["P"] protecteds.adb:42:7-42:27>
115+
**************************
116+
\/ RAW <<INTERMEDIATE UPPER>> () 42 0 0 0
117+
\/ RAW <<INTERMEDIATE LOWER>> () 0 0 0 0
118+
\/ RAW <<LEADING>> () 0 0 0 0
119+
\/ RAW <<TRAILING>> () 0 0 0 0
120+
Description of the procedure P body
121+
\/ SNIPPET ada () 0 0 0 0
122+
procedure P
123+
\/ DESCRIPTION () 0 0 0 0
124+
Description of the procedure P body
125+
**************************
126+
<ExprFunction ["F"] protecteds.adb:45:7-45:40>
127+
**************************
128+
\/ RAW <<INTERMEDIATE UPPER>> () 46 44 0 0
129+
\/ RAW <<INTERMEDIATE LOWER>> () 46 0 0 0
130+
\/ RETURNS () 45 45 0 0
131+
\/ RAW <<LEADING>> () 0 0 0 0
132+
\/ RAW <<TRAILING>> () 0 0 0 0
133+
Description of the function F body
134+
\/ SNIPPET ada () 0 0 0 0
135+
function F return Integer
136+
\/ DESCRIPTION () 0 0 0 0
137+
Description of the function F body
138+
**************************
139+
<EntryBody ["E"] protecteds.adb:48:7-52:13>
140+
<DefiningName protecteds.adb:48:13-48:14>
141+
<Id "E" protecteds.adb:48:13-48:14>
142+
<EntryCompletionFormalParams protecteds.adb:48:14-48:14>
143+
<Id "False" protecteds.adb:48:20-48:25>
144+
<DeclarativePart protecteds.adb:48:28-50:7>
145+
<AdaNodeList protecteds.adb:48:28-48:28>
146+
<HandledStmts protecteds.adb:50:12-52:7>
147+
<StmtList protecteds.adb:51:10-51:15>
148+
<NullStmt protecteds.adb:51:10-51:15>
149+
<AdaNodeList protecteds.adb:51:14-51:14>
150+
<EndName protecteds.adb:52:11-52:12>
151+
<Id "E" protecteds.adb:52:11-52:12>
152+
<EndName protecteds.adb:54:8-54:40>
153+
<Id "P_Private_Components_Subprograms" protecteds.adb:54:8-54:40>
154+
<EndName protecteds.adb:56:5-56:15>
155+
<Id "Protecteds" protecteds.adb:56:5-56:15>
156+
<PragmaNodeList protecteds.adb:56:16-56:16>

0 commit comments

Comments
 (0)