summaryrefslogtreecommitdiffstats
path: root/testsuites/support/include/buffer_test_io.h
blob: 8fbcd68b3eba6f1654a62e8f7c06fc8da5947edd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 *  Support for running the test output through a buffer
 */

#ifndef __BUFFER_TEST_IO_h
#define __BUFFER_TEST_IO_h

#include <rtems/test.h>

#ifdef __cplusplus
extern "C" {
#endif

#undef printf
#define printf(...) \
  do { \
     rtems_printf( &rtems_test_printer, __VA_ARGS__ ); \
  } while (0)

#undef puts
#define puts(_s) \
  do { \
     rtems_printf( &rtems_test_printer, "%s\n", _s ); \
  } while (0)

#undef putchar
#define putchar(_c) \
  do { \
     rtems_printf( &rtems_test_printer, "%c", _c ); \
  } while (0)

/* Do not call exit() since it closes stdin, etc and pulls in stdio code */
#define rtems_test_exit(_s) \
  do { \
    rtems_shutdown_executive(0); \
  } while (0)

#define FLUSH_OUTPUT() \
  do { \
  } while (0)

#define TEST_BEGIN() rtems_test_begin(rtems_test_name, TEST_STATE)
#define TEST_END()   rtems_test_end(rtems_test_name)

#ifdef __cplusplus
};
#endif

#endif