source: rtems/testsuites/tmtests/tm30/init.c @ 96e4b22

5
Last change on this file since 96e4b22 was 96e4b22, checked in by Chris Johns <chrisj@…>, on 03/06/19 at 09:39:29

testsuite: Make the OPERATION_COUNT a test configuration parameter.

  • Add a small memory test config file.
  • Update the small memory PowerPC BSPs to use the new test config.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2013.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#if !defined(OPERATION_COUNT)
11#define OPERATION_COUNT 100
12#endif
13
14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <bsp.h>
19#include <tmacros.h>
20#include <timesys.h>
21#include "test_support.h"
22
23const char rtems_test_name[] = "TIME TEST 30";
24
25rtems_id barrier[ OPERATION_COUNT ];
26
27rtems_task Init(
28  rtems_task_argument argument
29);
30
31static void benchmark_barrier_create(
32  int    iteration,
33  void  *argument
34)
35{
36  rtems_status_code status;
37
38  status = rtems_barrier_create(
39    iteration + 1,
40    RTEMS_LOCAL | RTEMS_FIFO,
41    2,
42    &barrier[iteration]
43  );
44  directive_failed(status, "rtems_barrier_create");
45}
46
47static void benchmark_barrier_ident(
48  int    iteration,
49  void  *argument
50)
51{
52  rtems_status_code status;
53  rtems_id          id;
54
55  status = rtems_barrier_ident( iteration+1, &id );
56  directive_failed(status, "rtems_barrier_ident");
57}
58
59static void benchmark_barrier_delete(
60  int    iteration,
61  void  *argument
62)
63{
64  rtems_status_code status;
65
66  status = rtems_barrier_delete( barrier[iteration] );
67  directive_failed(status, "rtems_barrier_delete");
68}
69
70rtems_task Init(
71  rtems_task_argument argument
72)
73{
74  TEST_BEGIN();
75
76  rtems_time_test_measure_operation(
77    "rtems_barrier_create: only case",
78    benchmark_barrier_create,
79    NULL,
80    OPERATION_COUNT,
81    0
82  );
83
84  rtems_time_test_measure_operation(
85    "rtems_barrier_ident: only case",
86    benchmark_barrier_ident,
87    NULL,
88    OPERATION_COUNT,
89    0
90  );
91
92  rtems_time_test_measure_operation(
93    "rtems_barrier_delete: only case",
94    benchmark_barrier_delete,
95    NULL,
96    OPERATION_COUNT,
97    0
98  );
99
100  TEST_END();
101
102  rtems_test_exit(0);
103}
104
105/* configuration information */
106
107#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
108#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
109
110#define CONFIGURE_MAXIMUM_TASKS             1
111#define CONFIGURE_MAXIMUM_BARRIERS          OPERATION_COUNT
112#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
113
114#define CONFIGURE_INIT
115
116#include <rtems/confdefs.h>
117/* end of file */
Note: See TracBrowser for help on using the repository browser.