summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-14 23:53:49 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-14 23:53:49 +0000
commit216715075b0f9ae844de5f1b6eea969d1ea67b61 (patch)
tree5c90660e59dac9ce93bd872b0bc38ee12a3f4345 /testsuites
parent2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-216715075b0f9ae844de5f1b6eea969d1ea67b61.tar.bz2
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add new test to exercise devFS_Show(). * devfs01/.cvsignore, devfs01/Makefile.am, devfs01/devfs01.doc, devfs01/devfs01.scn, devfs01/init.c: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/ChangeLog6
-rw-r--r--testsuites/libtests/Makefile.am2
-rw-r--r--testsuites/libtests/configure.ac1
-rw-r--r--testsuites/libtests/devfs01/.cvsignore2
-rw-r--r--testsuites/libtests/devfs01/Makefile.am26
-rw-r--r--testsuites/libtests/devfs01/devfs01.doc22
-rw-r--r--testsuites/libtests/devfs01/devfs01.scn7
-rw-r--r--testsuites/libtests/devfs01/init.c73
8 files changed, 138 insertions, 1 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog
index 249b421cfd..0c54099423 100644
--- a/testsuites/libtests/ChangeLog
+++ b/testsuites/libtests/ChangeLog
@@ -1,5 +1,11 @@
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * Makefile.am, configure.ac: Add new test to exercise devFS_Show().
+ * devfs01/.cvsignore, devfs01/Makefile.am, devfs01/devfs01.doc,
+ devfs01/devfs01.scn, devfs01/init.c: New files.
+
+2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* Makefile.am, configure.ac: Add new test to exercise
malloc_get_statistics().
* malloc05/.cvsignore, malloc05/Makefile.am, malloc05/init.c,
diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am
index 057721d1c8..6e54650ec1 100644
--- a/testsuites/libtests/Makefile.am
+++ b/testsuites/libtests/Makefile.am
@@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal
SUBDIRS = POSIX
-SUBDIRS += bspcmdline01 cpuuse gxx01 \
+SUBDIRS += bspcmdline01 cpuuse devfs01 gxx01 \
malloctest malloc02 malloc03 malloc04 malloc05 heapwalk \
putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
termios termios01 termios02 termios03 termios04 termios05 termios06 \
diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac
index 6a23a9d0c9..3b37de126a 100644
--- a/testsuites/libtests/configure.ac
+++ b/testsuites/libtests/configure.ac
@@ -45,6 +45,7 @@ block09/Makefile
block10/Makefile
bspcmdline01/Makefile
cpuuse/Makefile
+devfs01/Makefile
gxx01/Makefile
heapwalk/Makefile
malloctest/Makefile
diff --git a/testsuites/libtests/devfs01/.cvsignore b/testsuites/libtests/devfs01/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/libtests/devfs01/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/libtests/devfs01/Makefile.am b/testsuites/libtests/devfs01/Makefile.am
new file mode 100644
index 0000000000..776cb1304a
--- /dev/null
+++ b/testsuites/libtests/devfs01/Makefile.am
@@ -0,0 +1,26 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = devfs01
+devfs01_SOURCES = init.c
+
+dist_rtems_tests_DATA = devfs01.scn
+dist_rtems_tests_DATA += devfs01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(devfs01_OBJECTS) $(devfs01_LDADD)
+LINK_LIBS = $(devfs01_LDLIBS)
+
+devfs01$(EXEEXT): $(devfs01_OBJECTS) $(devfs01_DEPENDENCIES)
+ @rm -f devfs01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/libtests/devfs01/devfs01.doc b/testsuites/libtests/devfs01/devfs01.doc
new file mode 100644
index 0000000000..aded196668
--- /dev/null
+++ b/testsuites/libtests/devfs01/devfs01.doc
@@ -0,0 +1,22 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# 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: devfs01
+
+directives:
+
+ devFS_Show
+
+concepts:
+
++ Fully exercise devFS_Show
diff --git a/testsuites/libtests/devfs01/devfs01.scn b/testsuites/libtests/devfs01/devfs01.scn
new file mode 100644
index 0000000000..7e36a6904a
--- /dev/null
+++ b/testsuites/libtests/devfs01/devfs01.scn
@@ -0,0 +1,7 @@
+*** TEST DEVFS01 ***
+devFS_Show - OK
+/dev/console_b 0 1
+/dev/console 0 0
+devFS_Show - no device table - EFAULT
+devFS_Show - devices - OK
+*** END OF TEST DEVFS01 ***
diff --git a/testsuites/libtests/devfs01/init.c b/testsuites/libtests/devfs01/init.c
new file mode 100644
index 0000000000..79fbabf647
--- /dev/null
+++ b/testsuites/libtests/devfs01/init.c
@@ -0,0 +1,73 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * 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 "test_support.h"
+#include <rtems/devfs.h>
+#include <errno.h>
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int sc;
+ int size;
+ rtems_filesystem_location_info_t *temp_loc;
+ rtems_device_name_t *device_name_table;
+
+ puts( "\n\n*** TEST DEVFS01 ***" );
+
+ puts( "devFS_Show - OK" );
+ sc = devFS_Show();
+ rtems_test_assert( sc == 0 );
+
+ /* save original node access information */
+ temp_loc = &rtems_filesystem_root;
+ device_name_table = (rtems_device_name_t *)temp_loc->node_access;
+ temp_loc->node_access = NULL;
+
+ puts( "devFS_Show - no device table - EFAULT" );
+ sc = devFS_Show();
+ rtems_test_assert( sc == -1 );
+ rtems_test_assert( errno == EFAULT );
+
+ /* restore node access information */
+ temp_loc->node_access = device_name_table;
+
+ /* save original device table size information */
+ size = rtems_device_table_size;
+ rtems_device_table_size = 0;
+ puts( "devFS_Show - devices - OK" );
+ sc = devFS_Show();
+ rtems_test_assert( sc == 0 );
+
+ /* restore original device table size information */
+ rtems_device_table_size = size;
+
+ puts( "*** END OF TEST DEVFS01 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */