summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-01 23:52:36 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-01 23:52:36 +0000
commitdda7c828a03243a5434d5debf28ca4e66301dc0c (patch)
treeaa425bed82845f45f9a2655613961d706e9bfe6b /testsuites/libtests
parent2009-10-01 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-dda7c828a03243a5434d5debf28ca4e66301dc0c.tar.bz2
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().
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/ChangeLog9
-rw-r--r--testsuites/libtests/Makefile.am3
-rw-r--r--testsuites/libtests/configure.ac1
-rw-r--r--testsuites/libtests/termios01/termios_testdriver.c2
-rw-r--r--testsuites/libtests/termios02/.cvsignore2
-rw-r--r--testsuites/libtests/termios02/Makefile.am29
-rw-r--r--testsuites/libtests/termios02/init.c56
-rw-r--r--testsuites/libtests/termios02/termios02.doc22
-rw-r--r--testsuites/libtests/termios02/termios02.scn6
9 files changed, 128 insertions, 2 deletions
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 <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:
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 <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>
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 ***