source: rtems/testsuites/support/include/buffer_test_io.h @ bcd0c06c

5
Last change on this file since bcd0c06c was bcd0c06c, checked in by Chris Johns <chrisj@…>, on Nov 7, 2017 at 9:25:36 PM

tests: Use rtems_test_begin and rtems_test_end.

Add a tests enum and move all test banner test to the library in libmisc.

Update #3199.

  • Property mode set to 100644
File size: 900 bytes
Line 
1/*
2 *  Support for running the test output through a buffer
3 */
4
5#ifndef __BUFFER_TEST_IO_h
6#define __BUFFER_TEST_IO_h
7
8#include <rtems/test.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#undef printf
15#define printf(...) \
16  do { \
17     rtems_printf( &rtems_test_printer, __VA_ARGS__ ); \
18  } while (0)
19
20#undef puts
21#define puts(_s) \
22  do { \
23     rtems_printf( &rtems_test_printer, "%s\n", _s ); \
24  } while (0)
25
26#undef putchar
27#define putchar(_c) \
28  do { \
29     rtems_printf( &rtems_test_printer, "%c", _c ); \
30  } while (0)
31
32/* Do not call exit() since it closes stdin, etc and pulls in stdio code */
33#define rtems_test_exit(_s) \
34  do { \
35    rtems_shutdown_executive(0); \
36  } while (0)
37
38#define FLUSH_OUTPUT() \
39  do { \
40  } while (0)
41
42#define TEST_BEGIN() rtems_test_begin(rtems_test_name, TEST_STATE)
43#define TEST_END()   rtems_test_end(rtems_test_name)
44
45#ifdef __cplusplus
46};
47#endif
48
49#endif
Note: See TracBrowser for help on using the repository browser.