forked from Imagelibrary/rtems
2009-10-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, termios01/termios_testdriver.c: Do not use CONSOLE_USE_INTERRUPTS. That is in use by BSPs and we should not use it. * termios02/.cvsignore, termios02/Makefile.am, termios02/init.c, termios02/termios02.doc, termios02/termios02.scn: New files. termios02 is a test for tcdrain().
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2009-10-01 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* Makefile.am, configure.ac, termios01/termios_testdriver.c: Do not use
|
||||
CONSOLE_USE_INTERRUPTS. That is in use by BSPs and we should not use
|
||||
it.
|
||||
* termios02/.cvsignore, termios02/Makefile.am, termios02/init.c,
|
||||
termios02/termios02.doc, termios02/termios02.scn: New files.
|
||||
termios02 is a test for tcdrain().
|
||||
|
||||
2009-10-01 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* termios01/init.c, termios01/termios_testdriver.c:
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
ACLOCAL_AMFLAGS = -I ../aclocal
|
||||
|
||||
SUBDIRS = bspcmdline01 cpuuse malloctest heapwalk putenvtest monitor \
|
||||
monitor02 rtmonuse stackchk stackchk01 termios termios01 rtems++ tztest
|
||||
monitor02 rtmonuse stackchk stackchk01 termios termios01 termios02 \
|
||||
rtems++ tztest
|
||||
|
||||
include $(top_srcdir)/../automake/subdirs.am
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
|
||||
@@ -46,6 +46,7 @@ stackchk/Makefile
|
||||
stackchk01/Makefile
|
||||
termios/Makefile
|
||||
termios01/Makefile
|
||||
termios02/Makefile
|
||||
tztest/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -35,7 +35,7 @@ int termios_test_driver_write_support (int minor, const char *buf, int len)
|
||||
int nwrite = 0;
|
||||
|
||||
while (nwrite < len) {
|
||||
#if (CONSOLE_USE_INTERRUPTS)
|
||||
#if (TERMIOS_TEST_DRIVER_USE_INTERRUPTS)
|
||||
termios_test_driver_outbyte_interrupt( minor, *buf++ );
|
||||
#else
|
||||
termios_test_driver_outbyte_polled( minor, *buf++ );
|
||||
|
||||
2
testsuites/libtests/termios02/.cvsignore
Normal file
2
testsuites/libtests/termios02/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
29
testsuites/libtests/termios02/Makefile.am
Normal file
29
testsuites/libtests/termios02/Makefile.am
Normal file
@@ -0,0 +1,29 @@
|
||||
##
|
||||
## $Id$
|
||||
##
|
||||
|
||||
MANAGERS = all
|
||||
|
||||
rtems_tests_PROGRAMS = termios02
|
||||
termios02_SOURCES = init.c
|
||||
|
||||
dist_rtems_tests_DATA = termios02.scn
|
||||
dist_rtems_tests_DATA += termios02.doc
|
||||
|
||||
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||
include $(top_srcdir)/../automake/compile.am
|
||||
include $(top_srcdir)/../automake/leaf.am
|
||||
|
||||
termios02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
|
||||
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||
|
||||
LINK_OBJS = $(termios02_OBJECTS) $(termios02_LDADD)
|
||||
LINK_LIBS = $(termios02_LDLIBS)
|
||||
|
||||
termios02$(EXEEXT): $(termios02_OBJECTS) $(termios02_DEPENDENCIES)
|
||||
@rm -f termios02$(EXEEXT)
|
||||
$(make-exe)
|
||||
|
||||
include $(top_srcdir)/../automake/local.am
|
||||
56
testsuites/libtests/termios02/init.c
Normal file
56
testsuites/libtests/termios02/init.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "tmacros.h"
|
||||
#include <termios.h>
|
||||
#include <errno.h>
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
{
|
||||
int sc;
|
||||
|
||||
printf( "\n\n*** TERMIOS 02 TEST ***\n" );
|
||||
|
||||
printf( "tcdrain(12) - EBADF\n" );
|
||||
sc = tcdrain(12);
|
||||
assert( sc == -1 );
|
||||
assert( errno == EBADF );
|
||||
|
||||
printf( "tcdrain(stdin) - OK\n" );
|
||||
sc = tcdrain(0);
|
||||
assert( !sc );
|
||||
|
||||
printf( "tcdrain(stdout) - OK\n" );
|
||||
tcdrain(1);
|
||||
assert( !sc );
|
||||
|
||||
printf( "tcdrain(stderr) - OK\n" );
|
||||
tcdrain(2);
|
||||
assert( !sc );
|
||||
|
||||
printf( "*** END OF TERMIOS 02 TEST ***\n" );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
|
||||
/* NOTICE: the clock driver is explicitly disabled */
|
||||
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include <rtems/confdefs.h>
|
||||
22
testsuites/libtests/termios02/termios02.doc
Normal file
22
testsuites/libtests/termios02/termios02.doc
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# COPYRIGHT (c) 1989-2009.
|
||||
# On-Line Applications Research Corporation (OAR).
|
||||
#
|
||||
# The license and distribution terms for this file may be
|
||||
# found in the file LICENSE in this distribution or at
|
||||
# http://www.rtems.com/license/LICENSE.
|
||||
#
|
||||
|
||||
This file describes the directives and concepts tested by this test set.
|
||||
|
||||
test set name: termios02
|
||||
|
||||
directives:
|
||||
|
||||
tcdrain
|
||||
|
||||
concepts:
|
||||
|
||||
+ Exercise tcdrain.
|
||||
6
testsuites/libtests/termios02/termios02.scn
Normal file
6
testsuites/libtests/termios02/termios02.scn
Normal file
@@ -0,0 +1,6 @@
|
||||
*** TERMIOS 02 TEST ***
|
||||
tcdrain(12) - EBADF
|
||||
tcdrain(stdin) - OK
|
||||
tcdrain(stdout) - OK
|
||||
tcdrain(stderr) - OK
|
||||
*** END OF TERMIOS 02 TEST ***
|
||||
Reference in New Issue
Block a user