5
Last change
on this file since bcd0c06c was
bcd0c06c,
checked in by Chris Johns <chrisj@…>, on 11/07/17 at 21:25:36
|
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
|
Rev | Line | |
---|
[cd9396e] | 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 | |
---|
[840ae71] | 8 | #include <rtems/test.h> |
---|
| 9 | |
---|
[cd9396e] | 10 | #ifdef __cplusplus |
---|
| 11 | extern "C" { |
---|
| 12 | #endif |
---|
| 13 | |
---|
[7e102915] | 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 | |
---|
[bcd0c06c] | 42 | #define TEST_BEGIN() rtems_test_begin(rtems_test_name, TEST_STATE) |
---|
| 43 | #define TEST_END() rtems_test_end(rtems_test_name) |
---|
[7e102915] | 44 | |
---|
[cd9396e] | 45 | #ifdef __cplusplus |
---|
[b16bdbf7] | 46 | }; |
---|
[cd9396e] | 47 | #endif |
---|
| 48 | |
---|
| 49 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.