source: rtems/cpukit/libmisc/testsupport/testbeginend.c @ f703e7f

5
Last change on this file since f703e7f was f703e7f, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 26, 2017 at 11:59:05 AM

tests: Move rtems_test_printer definition

Statically initialize it to use printk().

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 939 bytes
Line 
1/*
2 * Copyright (c) 2014, 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/test.h>
20#include <rtems/bspIo.h>
21
22rtems_printer rtems_test_printer = {
23  .printer = rtems_printk_printer
24};
25
26int rtems_test_begin(void)
27{
28  return rtems_printf(
29    &rtems_test_printer,
30    TEST_BEGIN_STRING
31  );
32}
33
34int rtems_test_end(void)
35{
36  return rtems_printf(
37    &rtems_test_printer,
38    TEST_END_STRING
39  );
40}
41
42int rtems_test_printf(
43  const char* format,
44  ...
45)
46{
47  va_list ap;
48  int len;
49  va_start(ap, format);
50  len = rtems_vprintf(
51    &rtems_test_printer,
52    format,
53    ap
54  );
55  va_end(ap);
56  return len;
57}
Note: See TracBrowser for help on using the repository browser.