source: rtems/testsuites/ada/support/time_test_support.adb @ 48aa4b5d

Last change on this file since 48aa4b5d was ee537ea, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 12, 2017 at 8:00:10 AM

ada-tests: Move to testsuites/ada

This solves a build dependency issue, e.g. building tests before
librtemsbsp.a exists.

Close #3079.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1--
2--  TIME_TEST_SUPPORT / SPECIFICATION
3--
4--  DESCRIPTION:
5--
6--  This package provides routines which aid the individual tests in
7--  the Timing Test Suite 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.org/license/LICENSE.
19--
20
21with INTERFACES; use INTERFACES;
22with TEXT_IO;
23with UNSIGNED32_IO;
24
25package body TIME_TEST_SUPPORT is
26
27--PAGE
28--
29--  PUT_TIME
30--
31
32   procedure PUT_TIME (
33      MESSAGE          : in     STRING;
34      TOTAL_TIME       : in     RTEMS.UNSIGNED32;
35      ITERATIONS       : in     RTEMS.UNSIGNED32;
36      LOOP_OVERHEAD    : in     RTEMS.UNSIGNED32;
37      CALLING_OVERHEAD : in     RTEMS.UNSIGNED32
38   ) is
39      PER_ITERATION : RTEMS.UNSIGNED32;
40   begin
41
42      PER_ITERATION := (TOTAL_TIME - LOOP_OVERHEAD) / ITERATIONS;
43      PER_ITERATION := PER_ITERATION - CALLING_OVERHEAD;
44
45      if PER_ITERATION = 0 then
46
47         TEXT_IO.PUT( "TOTAL_TIME " );
48         UNSIGNED32_IO.PUT( TOTAL_TIME );
49         TEXT_IO.NEW_LINE; 
50
51         TEXT_IO.PUT( "ITERATIONS " );
52         UNSIGNED32_IO.PUT( ITERATIONS );
53         TEXT_IO.NEW_LINE; 
54
55         TEXT_IO.PUT( "LOOP_OVERHEAD " );
56         UNSIGNED32_IO.PUT( LOOP_OVERHEAD );
57         TEXT_IO.NEW_LINE; 
58
59         TEXT_IO.PUT( "CALLING_OVERHEAD " );
60         UNSIGNED32_IO.PUT( CALLING_OVERHEAD );
61         TEXT_IO.NEW_LINE; 
62
63      end if;
64
65      TEXT_IO.PUT( MESSAGE );
66      TEXT_IO.PUT( " " );
67      UNSIGNED32_IO.PUT( PER_ITERATION );
68      TEXT_IO.NEW_LINE; 
69      TEXT_IO.FLUSH; 
70
71   end PUT_TIME;
72
73end TIME_TEST_SUPPORT;
Note: See TracBrowser for help on using the repository browser.