From 016a926defe59ea4d0483da43b59b9f347e97e59 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 2 Aug 2002 00:55:27 +0000 Subject: 2002-08-01 Joel Sherrill * 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. * cpuuse/task2.c, malloctest/task1.c, putenvtest/init.c, rtmonuse/task1.c, termios/init.c: Modified. --- c/src/tests/libtests/termios/init.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'c/src/tests/libtests/termios/init.c') diff --git a/c/src/tests/libtests/termios/init.c b/c/src/tests/libtests/termios/init.c index b4cd7df06d..aff6b08384 100644 --- a/c/src/tests/libtests/termios/init.c +++ b/c/src/tests/libtests/termios/init.c @@ -46,6 +46,8 @@ rtems_task Init (rtems_task_argument argument); #include #include +#include + #if !defined(fileno) int fileno( FILE *stream); /* beyond ANSI */ #endif @@ -589,7 +591,7 @@ void change_line_settings( struct termios *tp ) tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits | baud_rate; if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) { perror( "change_line_settings(): tcsetattr() failed" ); - exit( 1 ); + rtems_test_exit( 1 ); } printf( "Line settings set.\n" ); } @@ -606,7 +608,7 @@ void canonical_input( struct termios *tp ) tp->c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) { perror( "canonical_input(): tcsetattr() failed" ); - exit( 1 ); + rtems_test_exit( 1 ); } while ( ( c = getchar () ) != '\n'); @@ -725,7 +727,7 @@ Init (rtems_task_argument ignored) if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) { perror( "tcgetattr() failed" ); - exit( 0 ); + rtems_test_exit( 0 ); } test_termios = orig_termios; @@ -738,7 +740,7 @@ Init (rtems_task_argument ignored) test_termios = orig_termios; if( tcsetattr( fileno( stdin ), TCSADRAIN, &test_termios ) < 0 ) { perror( "tcsetattr() failed" ); - exit( 1 ); + rtems_test_exit( 1 ); } usage(); break; @@ -764,7 +766,7 @@ Init (rtems_task_argument ignored) break; case '9': - exit( 1 ); + rtems_test_exit( 1 ); case '\n': break; -- cgit v1.2.3