summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/termios02
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/termios02
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/termios02')
-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
5 files changed, 115 insertions, 0 deletions
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 ***