From dda7c828a03243a5434d5debf28ca4e66301dc0c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 1 Oct 2009 23:52:36 +0000 Subject: 2009-10-01 Joel Sherrill * 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(). --- testsuites/libtests/ChangeLog | 9 ++++ testsuites/libtests/Makefile.am | 3 +- testsuites/libtests/configure.ac | 1 + testsuites/libtests/termios01/termios_testdriver.c | 2 +- testsuites/libtests/termios02/.cvsignore | 2 + testsuites/libtests/termios02/Makefile.am | 29 +++++++++++ testsuites/libtests/termios02/init.c | 56 ++++++++++++++++++++++ testsuites/libtests/termios02/termios02.doc | 22 +++++++++ testsuites/libtests/termios02/termios02.scn | 6 +++ 9 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 testsuites/libtests/termios02/.cvsignore create mode 100644 testsuites/libtests/termios02/Makefile.am create mode 100644 testsuites/libtests/termios02/init.c create mode 100644 testsuites/libtests/termios02/termios02.doc create mode 100644 testsuites/libtests/termios02/termios02.scn (limited to 'testsuites') diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index bf06f0ec38..e5438fd0bc 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,12 @@ +2009-10-01 Joel Sherrill + + * 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 * termios01/init.c, termios01/termios_testdriver.c: diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am index 22f6676f62..9e93c6e174 100644 --- a/testsuites/libtests/Makefile.am +++ b/testsuites/libtests/Makefile.am @@ -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 diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac index 4749907830..71c9e53e6d 100644 --- a/testsuites/libtests/configure.ac +++ b/testsuites/libtests/configure.ac @@ -46,6 +46,7 @@ stackchk/Makefile stackchk01/Makefile termios/Makefile termios01/Makefile +termios02/Makefile tztest/Makefile ]) AC_OUTPUT diff --git a/testsuites/libtests/termios01/termios_testdriver.c b/testsuites/libtests/termios01/termios_testdriver.c index a413c2b023..4ac0e72d7f 100644 --- a/testsuites/libtests/termios01/termios_testdriver.c +++ b/testsuites/libtests/termios01/termios_testdriver.c @@ -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++ ); diff --git a/testsuites/libtests/termios02/.cvsignore b/testsuites/libtests/termios02/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/libtests/termios02/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/libtests/termios02/Makefile.am b/testsuites/libtests/termios02/Makefile.am new file mode 100644 index 0000000000..389904bc0f --- /dev/null +++ b/testsuites/libtests/termios02/Makefile.am @@ -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 diff --git a/testsuites/libtests/termios02/init.c b/testsuites/libtests/termios02/init.c new file mode 100644 index 0000000000..7c4dc3aa35 --- /dev/null +++ b/testsuites/libtests/termios02/init.c @@ -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 +#include + +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 diff --git a/testsuites/libtests/termios02/termios02.doc b/testsuites/libtests/termios02/termios02.doc new file mode 100644 index 0000000000..25c4c95b5a --- /dev/null +++ b/testsuites/libtests/termios02/termios02.doc @@ -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. diff --git a/testsuites/libtests/termios02/termios02.scn b/testsuites/libtests/termios02/termios02.scn new file mode 100644 index 0000000000..614a6e2fc6 --- /dev/null +++ b/testsuites/libtests/termios02/termios02.scn @@ -0,0 +1,6 @@ +*** TERMIOS 02 TEST *** +tcdrain(12) - EBADF +tcdrain(stdin) - OK +tcdrain(stdout) - OK +tcdrain(stderr) - OK +*** END OF TERMIOS 02 TEST *** -- cgit v1.2.3