Skip to content

Commit 1644557

Browse files
committed
V721-009 Automated test for task objects/types.
1 parent ffb3e63 commit 1644557

File tree

4 files changed

+486
-0
lines changed

4 files changed

+486
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ check_extractor:
1616
(cd testsuite/extractor && ../../.objs/test_extractor pattern.json documentation_pattern.ads | diff -u --strip-trailing-cr documentation_pattern.out -)
1717
(cd testsuite/extractor && ../../.objs/test_extractor gnat.json exceptions.ads | diff -u --strip-trailing-cr exceptions.out -)
1818
(cd testsuite/extractor && ../../.objs/test_extractor gnat.json records.ads | diff -u --strip-trailing-cr records.out -)
19+
(cd testsuite/extractor && ../../.objs/test_extractor gnat.json tasks.ads | diff -u --strip-trailing-cr tasks.out -)

testsuite/drivers/test_extractor.adb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ procedure Test_Extractor is
140140
| Ada_Expr_Function
141141
| Ada_Concrete_Type_Decl
142142
| Ada_Exception_Decl
143+
| Ada_Entry_Decl
143144
=>
144145
Extract_And_Dump;
145146

@@ -150,6 +151,11 @@ procedure Test_Extractor is
150151

151152
return Over;
152153

154+
when Ada_Single_Task_Decl | Ada_Task_Type_Decl =>
155+
Extract_And_Dump;
156+
157+
return Into;
158+
153159
when others =>
154160
return Into;
155161
end case;

testsuite/extractor/tasks.ads

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
-- Test extraction of the documentation for tasks and task types.
3+
-- Note, documentation extraction code is almost common for subprograms and
4+
-- entries, thus, number of test cases for entries are minimal to check that
5+
-- it works and cover entries specific cases.
6+
7+
package Tasks is
8+
9+
type IE is synchronized interface;
10+
11+
type IP is synchronized interface;
12+
13+
not overriding procedure Process (Self : IP) is abstract;
14+
15+
task T_Entryless_Empty_Trailing;
16+
-- This is trailing section of description of the task
17+
-- T_Entryless_Empty_Trailing.
18+
19+
-- This is leading section of the description of the task
20+
-- T_Entryless_Leading.
21+
task T_Entryless_Leading is
22+
end T_Entryless_Leading;
23+
24+
task T_Entryless_Intermediate is
25+
-- This is intermediate section of the description of the task
26+
-- T_Entryless_Intermediate.
27+
end T_Entryless_Intermediate;
28+
29+
-- This is leading section of the description of the task
30+
-- T_Entryless_Inherited_Leading
31+
task T_Entryless_Inherited_Leading is new IE with
32+
end T_Entryless_Inherited_Leading;
33+
34+
task T_Entryless_Inherited_Intermediate is new IE with
35+
-- This is intermediate section of the description of the task
36+
-- T_Entryless_Inherited_Intermediate.
37+
end T_Entryless_Inherited_Intermediate;
38+
39+
task T_1 is
40+
entry E;
41+
-- Trailing comment for the entry
42+
end T_1;
43+
44+
task T_2 is
45+
-- Leading comment for the entry
46+
entry E;
47+
end T_2;
48+
49+
task T_3 is
50+
entry E;
51+
-- Trailing comment for the entry
52+
end T_3;
53+
54+
task type TT_Entryless_Empty_Trailing;
55+
-- This is trailing section of description of the task
56+
-- TT_Entryless_Empty_Trailing.
57+
58+
-- This is leading section of the description of the task
59+
-- TT_Entryless_Leading.
60+
task type TT_Entryless_Leading is
61+
end TT_Entryless_Leading;
62+
63+
task type TT_Entryless_Intermediate is
64+
-- This is intermediate section of the description of the task
65+
-- TT_Entryless_Intermediate.
66+
end TT_Entryless_Intermediate;
67+
68+
-- This is leading section of the description of the task
69+
-- TT_Entryless_Inherited_Leading
70+
task type TT_Entryless_Inherited_Leading is new IE with
71+
end TT_Entryless_Inherited_Leading;
72+
73+
task type TT_Entryless_Inherited_Intermediate is new IE with
74+
-- This is intermediate section of the description of the task
75+
-- TT_Entryless_Inherited_Intermediate.
76+
end TT_Entryless_Inherited_Intermediate;
77+
78+
task type TT_1 is
79+
entry E;
80+
-- Trailing comment for the entry
81+
end TT_1;
82+
83+
task type TT_2 is
84+
-- Leading comment for the entry
85+
entry E;
86+
end TT_2;
87+
88+
task type TT_3 is
89+
entry E;
90+
-- Trailing comment for the entry
91+
end TT_3;
92+
93+
end Tasks;

0 commit comments

Comments
 (0)