[f3f06f79] | 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 | -- |
---|
[196a6b9] | 13 | -- COPYRIGHT (c) 1989-1997. |
---|
[f3f06f79] | 14 | -- On-Line Applications Research Corporation (OAR). |
---|
[196a6b9] | 15 | -- Copyright assigned to U.S. Government, 1994. |
---|
[f3f06f79] | 16 | -- |
---|
[196a6b9] | 17 | -- The license and distribution terms for this file may in |
---|
| 18 | -- the file LICENSE in this distribution or at |
---|
| 19 | -- http://www.OARcorp.com/rtems/license.html. |
---|
[f3f06f79] | 20 | -- |
---|
[196a6b9] | 21 | -- $Id$ |
---|
[f3f06f79] | 22 | -- |
---|
| 23 | |
---|
| 24 | with Interfaces; use Interfaces; |
---|
| 25 | with RTEMS; |
---|
| 26 | with Text_IO; |
---|
| 27 | |
---|
| 28 | package Test_Support is |
---|
| 29 | |
---|
| 30 | -- |
---|
| 31 | -- Fatal_Directive_Status |
---|
| 32 | -- |
---|
| 33 | -- DESCRIPTION: |
---|
| 34 | -- |
---|
| 35 | -- This subprogram checks if Status is equal to Desired. If so, it |
---|
| 36 | -- returns immediately. Otherwise, it prints the Message along with |
---|
| 37 | -- the Status and Desired status and invokes the Fatal_Error_Occurred |
---|
| 38 | -- directive. |
---|
| 39 | -- |
---|
| 40 | |
---|
| 41 | procedure Fatal_Directive_Status ( |
---|
| 42 | Status : in RTEMS.Status_Codes; |
---|
| 43 | Desired : in RTEMS.Status_Codes; |
---|
| 44 | Message : in STRING |
---|
| 45 | ); |
---|
| 46 | pragma Inline ( Fatal_Directive_Status ); |
---|
| 47 | |
---|
| 48 | -- Directive_Failed |
---|
| 49 | -- |
---|
| 50 | -- DESCRIPTION: |
---|
| 51 | -- |
---|
| 52 | -- This subprogram checks if Status is equal to Successful. If so, it |
---|
| 53 | -- returns immediately. Otherwise, it prints the Message along with |
---|
| 54 | -- the Status and Desired status and invokes the Fatal_Error_Occurred |
---|
| 55 | -- |
---|
| 56 | |
---|
| 57 | procedure Directive_Failed ( |
---|
| 58 | Status : in RTEMS.Status_Codes; |
---|
| 59 | Message : in STRING |
---|
| 60 | ); |
---|
| 61 | pragma Inline ( Directive_Failed ); |
---|
| 62 | |
---|
| 63 | -- |
---|
| 64 | -- Print_Time |
---|
| 65 | -- |
---|
| 66 | -- DESCRIPTION: |
---|
| 67 | -- |
---|
| 68 | -- This subprogram prints the Prefix string, following by the |
---|
| 69 | -- time of day in Time_Buffer, followed by the Suffix. |
---|
| 70 | -- |
---|
| 71 | |
---|
| 72 | procedure Print_Time ( |
---|
| 73 | Prefix : in STRING; |
---|
| 74 | Time_Buffer : in RTEMS.Time_Of_Day; |
---|
| 75 | Suffix : in STRING |
---|
| 76 | ); |
---|
| 77 | pragma Inline ( Print_Time ); |
---|
| 78 | |
---|
| 79 | -- |
---|
| 80 | -- Put_Dot |
---|
| 81 | -- |
---|
| 82 | -- DESCRIPTION: |
---|
| 83 | -- |
---|
| 84 | -- This subprogram prints a single character without a carriage return. |
---|
| 85 | -- |
---|
| 86 | |
---|
| 87 | procedure Put_Dot ( |
---|
| 88 | Buffer : in STRING |
---|
| 89 | ); |
---|
| 90 | pragma Inline ( Put_Dot ); |
---|
| 91 | |
---|
| 92 | -- |
---|
| 93 | -- Pause |
---|
| 94 | -- |
---|
| 95 | -- DESCRIPTION: |
---|
| 96 | -- |
---|
| 97 | -- This subprogram is used to pause screen output in the Test Suites |
---|
| 98 | -- until the user presses carriage return. |
---|
| 99 | -- |
---|
| 100 | |
---|
| 101 | procedure Pause; |
---|
| 102 | |
---|
| 103 | -- |
---|
| 104 | -- Pause_And_Screen_Number |
---|
| 105 | -- |
---|
| 106 | -- DESCRIPTION: |
---|
| 107 | -- |
---|
| 108 | -- This subprogram is used to pause screen output and print the current |
---|
| 109 | -- number in the Test Suites until the user presses carriage return. |
---|
| 110 | -- |
---|
| 111 | |
---|
| 112 | procedure Pause_And_Screen_Number ( |
---|
| 113 | SCREEN : in RTEMS.Unsigned32 |
---|
| 114 | ); |
---|
| 115 | |
---|
| 116 | -- |
---|
| 117 | -- Put_Name |
---|
| 118 | -- |
---|
| 119 | -- DESCRIPTION: |
---|
| 120 | -- |
---|
| 121 | -- This subprogram prints the RTEMS object Name. If New_Line is TRUE, |
---|
| 122 | -- then a carriage return is printed after the Name. |
---|
| 123 | -- |
---|
| 124 | |
---|
| 125 | procedure Put_Name ( |
---|
| 126 | Name : in RTEMS.Name; |
---|
| 127 | New_Line : in Boolean |
---|
| 128 | ); |
---|
| 129 | |
---|
| 130 | -- |
---|
| 131 | -- Task_Number |
---|
| 132 | -- |
---|
| 133 | -- DESCRIPTION: |
---|
| 134 | -- |
---|
| 135 | -- This function returns the task index which the test should use |
---|
| 136 | -- for TID. |
---|
| 137 | -- |
---|
| 138 | |
---|
| 139 | function Task_Number ( |
---|
| 140 | TID : in RTEMS.ID |
---|
| 141 | ) return RTEMS.Unsigned32; |
---|
| 142 | pragma Inline ( Task_Number ); |
---|
| 143 | |
---|
| 144 | -- |
---|
| 145 | -- Do_Nothing |
---|
| 146 | -- |
---|
| 147 | -- DESCRIPTION: |
---|
| 148 | -- |
---|
| 149 | -- This procedure is called when a test wishes to use a delay |
---|
| 150 | -- loop and insure that the compiler does not optimize it away. |
---|
| 151 | -- |
---|
| 152 | |
---|
| 153 | procedure Do_Nothing; |
---|
| 154 | |
---|
| 155 | -- |
---|
| 156 | -- Ticks_Per_Second is the number of RTEMS clock ticks which |
---|
| 157 | -- occur each second. |
---|
| 158 | -- |
---|
| 159 | |
---|
| 160 | Ticks_Per_Second : RTEMS.Interval; |
---|
| 161 | pragma Import (C, Ticks_Per_Second, "_TOD_Ticks_per_second"); |
---|
| 162 | |
---|
| 163 | -- |
---|
| 164 | -- Milliseconds_Per_Tick is the number of milliseconds which |
---|
| 165 | -- occur between each RTEMS clock tick. |
---|
| 166 | -- |
---|
| 167 | |
---|
| 168 | function Milliseconds_Per_Tick |
---|
| 169 | return RTEMS.Unsigned32; |
---|
| 170 | |
---|
| 171 | private |
---|
| 172 | |
---|
| 173 | end Test_Support; |
---|