Back to home page

LXR

 
 

    


Warning, /testsuites/ada/support/test_support.ads is written in an unsupported language. File is not indexed.

0001 -- SPDX-License-Identifier: BSD-2-Clause
0002 
0003 --
0004 --  Test_Support / SPECIFICATION
0005 --
0006 --  DESCRIPTION:
0007 --
0008 --  This package provides routines which aid the Test Suites
0009 --  and simplify their design and operation.
0010 --
0011 --  DEPENDENCIES: 
0012 --
0013 --  
0014 --
0015 --  COPYRIGHT (c) 1989-2009.
0016 --  On-Line Applications Research Corporation (OAR).
0017 --
0018 --  Redistribution and use in source and binary forms, with or without
0019 --  modification, are permitted provided that the following conditions
0020 --  are met:
0021 --  1. Redistributions of source code must retain the above copyright
0022 --     notice, this list of conditions and the following disclaimer.
0023 --  2. Redistributions in binary form must reproduce the above copyright
0024 --     notice, this list of conditions and the following disclaimer in the
0025 --     documentation and/or other materials provided with the distribution.
0026 --
0027 --  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0028 --  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0029 --  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0030 --  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0031 --  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0032 --  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0033 --  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0034 --  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0035 --  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0036 --  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0037 --  POSSIBILITY OF SUCH DAMAGE.
0038 --
0039 
0040 with RTEMS;
0041 
0042 package Test_Support is
0043 
0044    procedure Ada_Test_Begin;
0045    pragma Import (C, Ada_Test_Begin, "ada_test_begin");
0046 
0047    procedure Ada_Test_End;
0048    pragma Import (C, Ada_Test_End, "ada_test_end");
0049 
0050    procedure Check_Type(
0051       t : in Long_Integer;
0052       s : in Long_Integer;
0053       a : in Long_Integer
0054    );
0055    pragma Import (C, Check_Type, "check_type");
0056 
0057 --
0058 --  Fatal_Directive_Status
0059 --
0060 --  DESCRIPTION:
0061 --
0062 --  This subprogram checks if Status is equal to Desired.  If so, it 
0063 --  returns immediately.  Otherwise, it prints the Message along with
0064 --  the Status and Desired status and invokes the Fatal_Error_Occurred
0065 --  directive.
0066 --
0067 
0068    procedure Fatal_Directive_Status (
0069       Status  : in     RTEMS.Status_Codes;
0070       Desired : in     RTEMS.Status_Codes;
0071       Message : in     STRING
0072    );
0073    pragma Inline ( Fatal_Directive_Status );
0074 
0075 --  Directive_Failed
0076 --
0077 --  DESCRIPTION:
0078 --
0079 --  This subprogram checks if Status is equal to Successful.  If so, it 
0080 --  returns immediately.  Otherwise, it prints the Message along with
0081 --  the Status and Desired status and invokes the Fatal_Error_Occurred
0082 --
0083 
0084    procedure Directive_Failed (
0085       Status  : in     RTEMS.Status_Codes;
0086       Message : in     STRING
0087    );
0088    pragma Inline ( Directive_Failed );
0089 
0090 --
0091 --  Print_Time
0092 --
0093 --  DESCRIPTION:
0094 --
0095 --  This subprogram prints the Prefix string, following by the
0096 --  time of day in Time_Buffer, followed by the Suffix.
0097 --
0098 
0099    procedure Print_Time (
0100       Prefix      : in     STRING;
0101       Time_Buffer : in     RTEMS.Time_Of_Day;
0102       Suffix      : in     STRING
0103    );
0104    pragma Inline ( Print_Time );
0105 
0106 --
0107 --  Put_Dot
0108 --
0109 --  DESCRIPTION:
0110 --
0111 --  This subprogram prints a single character without a carriage return.
0112 --
0113 
0114    procedure Put_Dot ( 
0115       Buffer : in     STRING
0116    );
0117    pragma Inline ( Put_Dot );
0118 
0119 --
0120 --  Pause
0121 --
0122 --  DESCRIPTION:
0123 --
0124 --  This subprogram is used to pause screen output in the Test Suites
0125 --  until the user presses carriage return.
0126 --
0127 
0128    procedure Pause;
0129 
0130 --
0131 --  Pause_And_Screen_Number
0132 --
0133 --  DESCRIPTION:
0134 --
0135 --  This subprogram is used to pause screen output  and print the current
0136 --  number in the Test Suites until the user presses carriage return.
0137 --
0138 
0139    procedure Pause_And_Screen_Number (
0140       SCREEN : in     RTEMS.Unsigned32
0141    );
0142 
0143 --
0144 --  Put_Name
0145 --
0146 --  DESCRIPTION:
0147 --
0148 --  This subprogram prints the RTEMS object Name.  If New_Line is TRUE, 
0149 --  then a carriage return is printed after the Name.
0150 --
0151 
0152    procedure Put_Name (
0153       Name     : in     RTEMS.Name;
0154       New_Line : in     Boolean
0155    );
0156  
0157 --
0158 --  Task_Number
0159 --
0160 --  DESCRIPTION:
0161 --
0162 --  This function returns the task index which the test should use
0163 --  for TID.
0164 --
0165 
0166    function Task_Number (
0167       TID : in     RTEMS.ID
0168    ) return RTEMS.Unsigned32;
0169    pragma Inline ( Task_Number );
0170 
0171 --
0172 --  Do_Nothing
0173 --
0174 --  DESCRIPTION:
0175 --
0176 --  This procedure is called when a test wishes to use a delay
0177 --  loop and insure that the compiler does not optimize it away.
0178 --
0179 
0180    procedure Do_Nothing;
0181 
0182 --
0183 --  Ticks_Per_Second is the number of RTEMS clock ticks which
0184 --  occur each second.
0185 --
0186 
0187    function Ticks_Per_Second 
0188    return RTEMS.Interval; 
0189 
0190 --
0191 --  Milliseconds_Per_Tick is the number of milliseconds which
0192 --  occur between each RTEMS clock tick.
0193 --
0194 
0195    function Milliseconds_Per_Tick 
0196    return RTEMS.Unsigned32;
0197 
0198 --
0199 --  Return the size of the RTEMS Workspace
0200 --
0201 
0202    function Work_Space_Size
0203    return RTEMS.Size;
0204 
0205 --
0206 --  Return an indication of whether multiprocessing is configured
0207 --
0208 
0209    function Is_Configured_Multiprocessing 
0210    return Boolean;
0211 
0212 --
0213 --  Node is the node number in a multiprocessor configuration
0214 --
0215 
0216    function Node 
0217    return RTEMS.Unsigned32;
0218 
0219 --
0220 --  Longest time in seconds to run a test
0221 --
0222 
0223     MAXIMUM_LONG_TEST_DURATION : RTEMS.UNSIGNED32;
0224 
0225 private
0226 
0227 end Test_Support;