source:
rtems/c/src/ada-tests/support/test_support.ads
@
ba3e1a4f
Last change on this file since ba3e1a4f was ba3e1a4f, checked in by Glenn Humphrey <glenn.humphrey@…>, on 10/10/07 at 20:58:48 | |
---|---|
|
|
File size: 3.9 KB |
Line | |
---|---|
1 | -- |
2 | -- Test_Support / SPECIFICATION |
3 | -- |
4 | -- DESCRIPTION: |
5 | -- |
6 | -- This package provides routines which aid the Test Suites |
7 | -- and simplify their design and operation. |
8 | -- |
9 | -- DEPENDENCIES: |
10 | -- |
11 | -- |
12 | -- |
13 | -- COPYRIGHT (c) 1989-2007. |
14 | -- On-Line Applications Research Corporation (OAR). |
15 | -- |
16 | -- The license and distribution terms for this file may in |
17 | -- the file LICENSE in this distribution or at |
18 | -- http://www.rtems.com/license/LICENSE. |
19 | -- |
20 | -- $Id$ |
21 | -- |
22 | |
23 | with Interfaces; use Interfaces; |
24 | with RTEMS; |
25 | with Text_IO; |
26 | |
27 | package Test_Support is |
28 | |
29 | -- |
30 | -- Fatal_Directive_Status |
31 | -- |
32 | -- DESCRIPTION: |
33 | -- |
34 | -- This subprogram checks if Status is equal to Desired. If so, it |
35 | -- returns immediately. Otherwise, it prints the Message along with |
36 | -- the Status and Desired status and invokes the Fatal_Error_Occurred |
37 | -- directive. |
38 | -- |
39 | |
40 | procedure Fatal_Directive_Status ( |
41 | Status : in RTEMS.Status_Codes; |
42 | Desired : in RTEMS.Status_Codes; |
43 | Message : in STRING |
44 | ); |
45 | pragma Inline ( Fatal_Directive_Status ); |
46 | |
47 | -- Directive_Failed |
48 | -- |
49 | -- DESCRIPTION: |
50 | -- |
51 | -- This subprogram checks if Status is equal to Successful. If so, it |
52 | -- returns immediately. Otherwise, it prints the Message along with |
53 | -- the Status and Desired status and invokes the Fatal_Error_Occurred |
54 | -- |
55 | |
56 | procedure Directive_Failed ( |
57 | Status : in RTEMS.Status_Codes; |
58 | Message : in STRING |
59 | ); |
60 | pragma Inline ( Directive_Failed ); |
61 | |
62 | -- |
63 | -- Print_Time |
64 | -- |
65 | -- DESCRIPTION: |
66 | -- |
67 | -- This subprogram prints the Prefix string, following by the |
68 | -- time of day in Time_Buffer, followed by the Suffix. |
69 | -- |
70 | |
71 | procedure Print_Time ( |
72 | Prefix : in STRING; |
73 | Time_Buffer : in RTEMS.Time_Of_Day; |
74 | Suffix : in STRING |
75 | ); |
76 | pragma Inline ( Print_Time ); |
77 | |
78 | -- |
79 | -- Put_Dot |
80 | -- |
81 | -- DESCRIPTION: |
82 | -- |
83 | -- This subprogram prints a single character without a carriage return. |
84 | -- |
85 | |
86 | procedure Put_Dot ( |
87 | Buffer : in STRING |
88 | ); |
89 | pragma Inline ( Put_Dot ); |
90 | |
91 | -- |
92 | -- Pause |
93 | -- |
94 | -- DESCRIPTION: |
95 | -- |
96 | -- This subprogram is used to pause screen output in the Test Suites |
97 | -- until the user presses carriage return. |
98 | -- |
99 | |
100 | procedure Pause; |
101 | |
102 | -- |
103 | -- Pause_And_Screen_Number |
104 | -- |
105 | -- DESCRIPTION: |
106 | -- |
107 | -- This subprogram is used to pause screen output and print the current |
108 | -- number in the Test Suites until the user presses carriage return. |
109 | -- |
110 | |
111 | procedure Pause_And_Screen_Number ( |
112 | SCREEN : in RTEMS.Unsigned32 |
113 | ); |
114 | |
115 | -- |
116 | -- Put_Name |
117 | -- |
118 | -- DESCRIPTION: |
119 | -- |
120 | -- This subprogram prints the RTEMS object Name. If New_Line is TRUE, |
121 | -- then a carriage return is printed after the Name. |
122 | -- |
123 | |
124 | procedure Put_Name ( |
125 | Name : in RTEMS.Name; |
126 | New_Line : in Boolean |
127 | ); |
128 | |
129 | -- |
130 | -- Task_Number |
131 | -- |
132 | -- DESCRIPTION: |
133 | -- |
134 | -- This function returns the task index which the test should use |
135 | -- for TID. |
136 | -- |
137 | |
138 | function Task_Number ( |
139 | TID : in RTEMS.ID |
140 | ) return RTEMS.Unsigned32; |
141 | pragma Inline ( Task_Number ); |
142 | |
143 | -- |
144 | -- Do_Nothing |
145 | -- |
146 | -- DESCRIPTION: |
147 | -- |
148 | -- This procedure is called when a test wishes to use a delay |
149 | -- loop and insure that the compiler does not optimize it away. |
150 | -- |
151 | |
152 | procedure Do_Nothing; |
153 | |
154 | -- |
155 | -- Ticks_Per_Second is the number of RTEMS clock ticks which |
156 | -- occur each second. |
157 | -- |
158 | |
159 | function Ticks_Per_Second |
160 | return RTEMS.Interval; |
161 | |
162 | -- |
163 | -- Milliseconds_Per_Tick is the number of milliseconds which |
164 | -- occur between each RTEMS clock tick. |
165 | -- |
166 | |
167 | function Milliseconds_Per_Tick |
168 | return RTEMS.Unsigned32; |
169 | |
170 | -- |
171 | -- Return the size of the RTEMS Workspace |
172 | -- |
173 | |
174 | function Work_Space_Size |
175 | return RTEMS.Unsigned32; |
176 | |
177 | -- |
178 | -- Return an indication of whether multiprocessing is configured |
179 | -- |
180 | |
181 | function Is_Configured_Multiprocessing |
182 | return Boolean; |
183 | |
184 | -- |
185 | -- Node is the node number in a multiprocessor configuration |
186 | -- |
187 | |
188 | function Node |
189 | return RTEMS.Unsigned32; |
190 | |
191 | -- |
192 | -- Longest time in seconds to run a test |
193 | -- |
194 | |
195 | MAXIMUM_LONG_TEST_DURATION : RTEMS.UNSIGNED32; |
196 | |
197 | private |
198 | |
199 | end Test_Support; |
Note: See TracBrowser
for help on using the repository browser.