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-2009. |
---|
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 | |
---|
21 | with RTEMS; |
---|
22 | |
---|
23 | package Test_Support is |
---|
24 | |
---|
25 | -- |
---|
26 | -- Fatal_Directive_Status |
---|
27 | -- |
---|
28 | -- DESCRIPTION: |
---|
29 | -- |
---|
30 | -- This subprogram checks if Status is equal to Desired. If so, it |
---|
31 | -- returns immediately. Otherwise, it prints the Message along with |
---|
32 | -- the Status and Desired status and invokes the Fatal_Error_Occurred |
---|
33 | -- directive. |
---|
34 | -- |
---|
35 | |
---|
36 | procedure Fatal_Directive_Status ( |
---|
37 | Status : in RTEMS.Status_Codes; |
---|
38 | Desired : in RTEMS.Status_Codes; |
---|
39 | Message : in STRING |
---|
40 | ); |
---|
41 | pragma Inline ( Fatal_Directive_Status ); |
---|
42 | |
---|
43 | -- Directive_Failed |
---|
44 | -- |
---|
45 | -- DESCRIPTION: |
---|
46 | -- |
---|
47 | -- This subprogram checks if Status is equal to Successful. If so, it |
---|
48 | -- returns immediately. Otherwise, it prints the Message along with |
---|
49 | -- the Status and Desired status and invokes the Fatal_Error_Occurred |
---|
50 | -- |
---|
51 | |
---|
52 | procedure Directive_Failed ( |
---|
53 | Status : in RTEMS.Status_Codes; |
---|
54 | Message : in STRING |
---|
55 | ); |
---|
56 | pragma Inline ( Directive_Failed ); |
---|
57 | |
---|
58 | -- |
---|
59 | -- Print_Time |
---|
60 | -- |
---|
61 | -- DESCRIPTION: |
---|
62 | -- |
---|
63 | -- This subprogram prints the Prefix string, following by the |
---|
64 | -- time of day in Time_Buffer, followed by the Suffix. |
---|
65 | -- |
---|
66 | |
---|
67 | procedure Print_Time ( |
---|
68 | Prefix : in STRING; |
---|
69 | Time_Buffer : in RTEMS.Time_Of_Day; |
---|
70 | Suffix : in STRING |
---|
71 | ); |
---|
72 | pragma Inline ( Print_Time ); |
---|
73 | |
---|
74 | -- |
---|
75 | -- Put_Dot |
---|
76 | -- |
---|
77 | -- DESCRIPTION: |
---|
78 | -- |
---|
79 | -- This subprogram prints a single character without a carriage return. |
---|
80 | -- |
---|
81 | |
---|
82 | procedure Put_Dot ( |
---|
83 | Buffer : in STRING |
---|
84 | ); |
---|
85 | pragma Inline ( Put_Dot ); |
---|
86 | |
---|
87 | -- |
---|
88 | -- Pause |
---|
89 | -- |
---|
90 | -- DESCRIPTION: |
---|
91 | -- |
---|
92 | -- This subprogram is used to pause screen output in the Test Suites |
---|
93 | -- until the user presses carriage return. |
---|
94 | -- |
---|
95 | |
---|
96 | procedure Pause; |
---|
97 | |
---|
98 | -- |
---|
99 | -- Pause_And_Screen_Number |
---|
100 | -- |
---|
101 | -- DESCRIPTION: |
---|
102 | -- |
---|
103 | -- This subprogram is used to pause screen output and print the current |
---|
104 | -- number in the Test Suites until the user presses carriage return. |
---|
105 | -- |
---|
106 | |
---|
107 | procedure Pause_And_Screen_Number ( |
---|
108 | SCREEN : in RTEMS.Unsigned32 |
---|
109 | ); |
---|
110 | |
---|
111 | -- |
---|
112 | -- Put_Name |
---|
113 | -- |
---|
114 | -- DESCRIPTION: |
---|
115 | -- |
---|
116 | -- This subprogram prints the RTEMS object Name. If New_Line is TRUE, |
---|
117 | -- then a carriage return is printed after the Name. |
---|
118 | -- |
---|
119 | |
---|
120 | procedure Put_Name ( |
---|
121 | Name : in RTEMS.Name; |
---|
122 | New_Line : in Boolean |
---|
123 | ); |
---|
124 | |
---|
125 | -- |
---|
126 | -- Task_Number |
---|
127 | -- |
---|
128 | -- DESCRIPTION: |
---|
129 | -- |
---|
130 | -- This function returns the task index which the test should use |
---|
131 | -- for TID. |
---|
132 | -- |
---|
133 | |
---|
134 | function Task_Number ( |
---|
135 | TID : in RTEMS.ID |
---|
136 | ) return RTEMS.Unsigned32; |
---|
137 | pragma Inline ( Task_Number ); |
---|
138 | |
---|
139 | -- |
---|
140 | -- Do_Nothing |
---|
141 | -- |
---|
142 | -- DESCRIPTION: |
---|
143 | -- |
---|
144 | -- This procedure is called when a test wishes to use a delay |
---|
145 | -- loop and insure that the compiler does not optimize it away. |
---|
146 | -- |
---|
147 | |
---|
148 | procedure Do_Nothing; |
---|
149 | |
---|
150 | -- |
---|
151 | -- Ticks_Per_Second is the number of RTEMS clock ticks which |
---|
152 | -- occur each second. |
---|
153 | -- |
---|
154 | |
---|
155 | function Ticks_Per_Second |
---|
156 | return RTEMS.Interval; |
---|
157 | |
---|
158 | -- |
---|
159 | -- Milliseconds_Per_Tick is the number of milliseconds which |
---|
160 | -- occur between each RTEMS clock tick. |
---|
161 | -- |
---|
162 | |
---|
163 | function Milliseconds_Per_Tick |
---|
164 | return RTEMS.Unsigned32; |
---|
165 | |
---|
166 | -- |
---|
167 | -- Return the size of the RTEMS Workspace |
---|
168 | -- |
---|
169 | |
---|
170 | function Work_Space_Size |
---|
171 | return RTEMS.Unsigned32; |
---|
172 | |
---|
173 | -- |
---|
174 | -- Return an indication of whether multiprocessing is configured |
---|
175 | -- |
---|
176 | |
---|
177 | function Is_Configured_Multiprocessing |
---|
178 | return Boolean; |
---|
179 | |
---|
180 | -- |
---|
181 | -- Node is the node number in a multiprocessor configuration |
---|
182 | -- |
---|
183 | |
---|
184 | function Node |
---|
185 | return RTEMS.Unsigned32; |
---|
186 | |
---|
187 | -- |
---|
188 | -- Longest time in seconds to run a test |
---|
189 | -- |
---|
190 | |
---|
191 | MAXIMUM_LONG_TEST_DURATION : RTEMS.UNSIGNED32; |
---|
192 | |
---|
193 | private |
---|
194 | |
---|
195 | end Test_Support; |
---|