Changeset e6df806 in rtems for testsuites/support


Ignore:
Timestamp:
Nov 8, 2017, 2:27:25 AM (2 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
f5b3c024
Parents:
bcd0c06c
git-author:
Chris Johns <chrisj@…> (11/08/17 02:27:25)
git-committer:
Chris Johns <chrisj@…> (11/11/17 05:14:59)
Message:

tests: Use ld to map (wrap) printf, puts and putchar to tester functions.

  • Remove the macro defines and the need for tmacro.h by remapping the symbols using ld's wrap option.
  • Remove FLUSH_OUTPUT, it was empty.
  • Move rtems_test_exit to libmisc/testsupport as a function.

Update #3199.

Location:
testsuites/support/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/support/include/buffer_test_io.h

    rbcd0c06c re6df806  
    1212#endif
    1313
    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 
    4214#define TEST_BEGIN() rtems_test_begin(rtems_test_name, TEST_STATE)
    4315#define TEST_END()   rtems_test_end(rtems_test_name)
  • testsuites/support/include/tmacros.h

    rbcd0c06c re6df806  
    6565           " not %d detected at %s:%d\n", \
    6666         !_Thread_Dispatch_is_enabled(), (_expect), __FILE__, __LINE__ ); \
    67       FLUSH_OUTPUT(); \
    6867      rtems_test_exit( 1 ); \
    6968    } \
     
    8584        __LINE__ \
    8685      ); \
    87       FLUSH_OUTPUT(); \
    8886      rtems_test_exit( 1 ); \
    8987    } \
     
    108106      printf( "\n%s FAILED -- expected (%s) got (%s)\n", \
    109107              (_msg), rtems_status_text(_desired), rtems_status_text(_stat) ); \
    110       FLUSH_OUTPUT(); \
    111108      rtems_test_exit( _stat ); \
    112109    } \
     
    138135            (_msg), _desired, strerror(_desired), \
    139136            statx, errno, strerror(errno) ); \
    140     FLUSH_OUTPUT(); \
    141137    rtems_test_exit( _stat ); \
    142138  }
     
    154150      printf( "\n FAILED -- errno (%d - %s)\n", \
    155151              errno, strerror(errno) ); \
    156       FLUSH_OUTPUT(); \
    157152      rtems_test_exit( _stat ); \
    158153    } \
     
    167162    printf( "\n%s FAILED -- expected (-1) got (%p - %d/%s)\n", \
    168163            (_msg), _ptr, errno, strerror(errno) ); \
    169     FLUSH_OUTPUT(); \
    170164    rtems_test_exit( -1 ); \
    171165  }
     
    179173    printf( "\n%s FAILED -- expected (-1) got (%" PRId32 " - %d/%s)\n", \
    180174            (_msg), _ptr, errno, strerror(errno) ); \
    181     FLUSH_OUTPUT(); \
    182175    rtems_test_exit( -1 ); \
    183176  }
     
    203196      printf( "\n%s FAILED -- expected (%d) got (%d)\n", \
    204197              (_msg), (_desired), (_stat) ); \
    205       FLUSH_OUTPUT(); \
    206198      rtems_test_exit( _stat ); \
    207199    } \
     
    230222  do { \
    231223    putchar( _c ); \
    232     FLUSH_OUTPUT(); \
    233224  } while ( 0 )
    234225
     
    241232    do { \
    242233      printf( "<pause>\n" ); \
    243       FLUSH_OUTPUT(); \
    244234  } while ( 0 )
    245235
     
    247237  do { \
    248238    printf( "<pause - screen %d>\n", (_screen) ); \
    249     FLUSH_OUTPUT(); \
    250239  } while ( 0 )
    251240#else
     
    254243    char buffer[ 80 ]; \
    255244    printf( "<pause>" ); \
    256     FLUSH_OUTPUT(); \
    257245    gets( buffer ); \
    258246    puts( "" ); \
     
    263251    char buffer[ 80 ]; \
    264252    printf( "<pause - screen %d>", (_screen) ); \
    265     FLUSH_OUTPUT(); \
    266253    gets( buffer ); \
    267254    puts( "" ); \
Note: See TracChangeset for help on using the changeset viewer.