Changeset cd9396e in rtems


Ignore:
Timestamp:
Aug 2, 2002, 12:51:52 AM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
3aa4c2e0
Parents:
d9ab6d3
Message:

2002-08-01 Joel Sherrill <joel@…>

  • Per PR47 add support for buffered test output. This involved adding defines to redirect output to a buffer and dump it when full, at "test pause", and at exit. To avoid problems when redefining exit(), all tests were modified to call rtems_test_exit(). Some tests, notable psxtests, had to be modified to include the standard test macro .h file (pmacros.h or tmacros.h) to enable this support.
  • include/buffer_test_io.h: New file.
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/tests/support/ChangeLog

    rd9ab6d3 rcd9396e  
     12002-08-01      Joel Sherrill <joel@OARcorp.com>
     2
     3        * Per PR47 add support for buffered test output.  This involved
     4        adding defines to redirect output to a buffer and dump it when
     5        full, at "test pause", and at exit.  To avoid problems when redefining
     6        exit(), all tests were modified to call rtems_test_exit().
     7        Some tests, notable psxtests, had to be modified to include
     8        the standard test macro .h file (pmacros.h or tmacros.h) to
     9        enable this support.
     10        * include/buffer_test_io.h: New file.
    1112002-03-27      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    212
  • c/src/tests/support/include/Makefile.am

    rd9ab6d3 rcd9396e  
    99
    1010TMPINSTALLFILES = $(project_bspdir)/lib/include \
    11     $(project_bspdir)/lib/include/tmacros.h
     11    $(project_bspdir)/lib/include/tmacros.h \
     12    $(project_bspdir)/lib/include/buffer_test_io.h
    1213
    1314$(project_bspdir)/lib/include:
     
    1516$(project_bspdir)/lib/include/tmacros.h: tmacros.h
    1617        $(INSTALL_DATA) $< $@
     18$(project_bspdir)/lib/include/buffer_test_io.h: buffer_test_io.h
     19        $(INSTALL_DATA) $< $@
    1720
    18 CLEANFILES = $(project_bspdir)/lib/include/tmacros.h
     21CLEANFILES = $(project_bspdir)/lib/include/tmacros.h \
     22    $(project_bspdir)/lib/include/buffer_test_io.h
    1923
    2024all-local: $(TMPINSTALLFILES)
  • c/src/tests/support/include/tmacros.h

    rd9ab6d3 rcd9396e  
    3838#endif
    3939
     40#include <buffer_test_io.h>
     41
     42/*
     43 *  Check that that the dispatch disable level is proper for the
     44 *  mode/state of the test.  Normally it should be 0 when in task space.
     45 */
     46
    4047#define check_dispatch_disable_level( _expect ) \
    4148  do { \
     
    4451      printf( "\n_Thread_Dispatch_disable_level is (%d) not %d\n", \
    4552              _Thread_Dispatch_disable_level, (_expect) ); \
    46       fflush(stdout); \
    47       exit( 1 ); \
     53      FLUSH_OUTPUT(); \
     54      rtems_test_exit( 1 ); \
    4855    } \
    4956  } while ( 0 )
     
    6875      printf( "\n%s FAILED -- expected (%s) got (%s)\n", \
    6976              (_msg), rtems_status_text(_desired), rtems_status_text(_stat) ); \
    70       fflush(stdout); \
    71       exit( _stat ); \
     77      FLUSH_OUTPUT(); \
     78      rtems_test_exit( _stat ); \
    7279    } \
    7380  } while ( 0 )
     
    101108      printf( "\n FAILED -- errno (%d - %s)\n", \
    102109              errno, strerror(errno) ); \
    103       fflush(stdout); \
    104       exit( _stat ); \
     110      FLUSH_OUTPUT(); \
     111      rtems_test_exit( _stat ); \
    105112    } \
    106113  } while ( 0 )
     
    126133      printf( "\n%s FAILED -- expected (%d) got (%d)\n", \
    127134              (_msg), (_desired), (_stat) ); \
    128       fflush(stdout); \
    129       exit( _stat ); \
     135      FLUSH_OUTPUT(); \
     136      rtems_test_exit( _stat ); \
    130137    } \
    131138  } while ( 0 )
     
    148155       _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
    149156       (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
    150     fflush(stdout); \
    151157  } while ( 0 )
    152158
     
    154160  do { \
    155161    putchar( _c ); \
    156     fflush( stdout ); \
     162    FLUSH_OUTPUT(); \
    157163  } while ( 0 )
    158164
     
    164170#define rtems_test_pause() \
    165171    do { \
    166       printf( "<pause>\n" ); fflush( stdout ); \
     172      printf( "<pause>\n" ); \
     173      FLUSH_OUTPUT(); \
    167174  } while ( 0 )
    168175
    169176#define rtems_test_pause_and_screen_number( _screen ) \
    170177  do { \
    171     printf( "<pause - screen %d>\n", (_screen) ); fflush( stdout ); \
     178    printf( "<pause - screen %d>\n", (_screen) ); \
     179    FLUSH_OUTPUT(); \
    172180  } while ( 0 )
    173181#else
     
    175183  do { \
    176184    char buffer[ 80 ]; \
    177     printf( "<pause>" ); fflush( stdout ); \
     185    printf( "<pause>" ); \
     186    FLUSH_OUTPUT(); \
    178187    gets( buffer ); \
    179188    puts( "" ); \
     
    183192  do { \
    184193    char buffer[ 80 ]; \
    185     printf( "<pause - screen %d>", (_screen) ); fflush( stdout ); \
     194    printf( "<pause - screen %d>", (_screen) ); \
     195    FLUSH_OUTPUT(); \
    186196    gets( buffer ); \
    187197    puts( "" ); \
  • testsuites/support/ChangeLog

    rd9ab6d3 rcd9396e  
     12002-08-01      Joel Sherrill <joel@OARcorp.com>
     2
     3        * Per PR47 add support for buffered test output.  This involved
     4        adding defines to redirect output to a buffer and dump it when
     5        full, at "test pause", and at exit.  To avoid problems when redefining
     6        exit(), all tests were modified to call rtems_test_exit().
     7        Some tests, notable psxtests, had to be modified to include
     8        the standard test macro .h file (pmacros.h or tmacros.h) to
     9        enable this support.
     10        * include/buffer_test_io.h: New file.
    1112002-03-27      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    212
  • testsuites/support/include/tmacros.h

    rd9ab6d3 rcd9396e  
    3838#endif
    3939
     40#include <buffer_test_io.h>
     41
     42/*
     43 *  Check that that the dispatch disable level is proper for the
     44 *  mode/state of the test.  Normally it should be 0 when in task space.
     45 */
     46
    4047#define check_dispatch_disable_level( _expect ) \
    4148  do { \
     
    4451      printf( "\n_Thread_Dispatch_disable_level is (%d) not %d\n", \
    4552              _Thread_Dispatch_disable_level, (_expect) ); \
    46       fflush(stdout); \
    47       exit( 1 ); \
     53      FLUSH_OUTPUT(); \
     54      rtems_test_exit( 1 ); \
    4855    } \
    4956  } while ( 0 )
     
    6875      printf( "\n%s FAILED -- expected (%s) got (%s)\n", \
    6976              (_msg), rtems_status_text(_desired), rtems_status_text(_stat) ); \
    70       fflush(stdout); \
    71       exit( _stat ); \
     77      FLUSH_OUTPUT(); \
     78      rtems_test_exit( _stat ); \
    7279    } \
    7380  } while ( 0 )
     
    101108      printf( "\n FAILED -- errno (%d - %s)\n", \
    102109              errno, strerror(errno) ); \
    103       fflush(stdout); \
    104       exit( _stat ); \
     110      FLUSH_OUTPUT(); \
     111      rtems_test_exit( _stat ); \
    105112    } \
    106113  } while ( 0 )
     
    126133      printf( "\n%s FAILED -- expected (%d) got (%d)\n", \
    127134              (_msg), (_desired), (_stat) ); \
    128       fflush(stdout); \
    129       exit( _stat ); \
     135      FLUSH_OUTPUT(); \
     136      rtems_test_exit( _stat ); \
    130137    } \
    131138  } while ( 0 )
     
    148155       _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
    149156       (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
    150     fflush(stdout); \
    151157  } while ( 0 )
    152158
     
    154160  do { \
    155161    putchar( _c ); \
    156     fflush( stdout ); \
     162    FLUSH_OUTPUT(); \
    157163  } while ( 0 )
    158164
     
    164170#define rtems_test_pause() \
    165171    do { \
    166       printf( "<pause>\n" ); fflush( stdout ); \
     172      printf( "<pause>\n" ); \
     173      FLUSH_OUTPUT(); \
    167174  } while ( 0 )
    168175
    169176#define rtems_test_pause_and_screen_number( _screen ) \
    170177  do { \
    171     printf( "<pause - screen %d>\n", (_screen) ); fflush( stdout ); \
     178    printf( "<pause - screen %d>\n", (_screen) ); \
     179    FLUSH_OUTPUT(); \
    172180  } while ( 0 )
    173181#else
     
    175183  do { \
    176184    char buffer[ 80 ]; \
    177     printf( "<pause>" ); fflush( stdout ); \
     185    printf( "<pause>" ); \
     186    FLUSH_OUTPUT(); \
    178187    gets( buffer ); \
    179188    puts( "" ); \
     
    183192  do { \
    184193    char buffer[ 80 ]; \
    185     printf( "<pause - screen %d>", (_screen) ); fflush( stdout ); \
     194    printf( "<pause - screen %d>", (_screen) ); \
     195    FLUSH_OUTPUT(); \
    186196    gets( buffer ); \
    187197    puts( "" ); \
Note: See TracChangeset for help on using the changeset viewer.