summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-22 01:28:13 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-22 01:28:13 +0000
commit5d8a0bab42122a0d1d60334d7262546dcbbc116c (patch)
treea4e06d3f9b2f8632be492b3f650baf524b3dfa03 /testsuites/sptests
parent2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-5d8a0bab42122a0d1d60334d7262546dcbbc116c.tar.bz2
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, spfatal_support/init.c, spfatal_support/system.h: Add new tests to generate fatal errors in open_dev_console(). * spfatal14/.cvsignore, spfatal14/Makefile.am, spfatal14/spfatal14.doc, spfatal14/spfatal14.scn, spfatal14/testcase.h, spfatal15/.cvsignore, spfatal15/Makefile.am, spfatal15/spfatal15.doc, spfatal15/spfatal15.scn, spfatal15/testcase.h, spfatal_support/consume_sems.c: New files.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/ChangeLog11
-rw-r--r--testsuites/sptests/Makefile.am3
-rw-r--r--testsuites/sptests/configure.ac2
-rw-r--r--testsuites/sptests/spfatal14/.cvsignore2
-rw-r--r--testsuites/sptests/spfatal14/Makefile.am29
-rw-r--r--testsuites/sptests/spfatal14/spfatal14.doc24
-rw-r--r--testsuites/sptests/spfatal14/spfatal14.scn1
-rw-r--r--testsuites/sptests/spfatal14/testcase.h26
-rw-r--r--testsuites/sptests/spfatal15/.cvsignore2
-rw-r--r--testsuites/sptests/spfatal15/Makefile.am29
-rw-r--r--testsuites/sptests/spfatal15/spfatal15.doc22
-rw-r--r--testsuites/sptests/spfatal15/spfatal15.scn5
-rw-r--r--testsuites/sptests/spfatal15/testcase.h25
-rw-r--r--testsuites/sptests/spfatal_support/consume_sems.c54
-rw-r--r--testsuites/sptests/spfatal_support/init.c2
-rw-r--r--testsuites/sptests/spfatal_support/system.h9
16 files changed, 244 insertions, 2 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 1c833fcb87..a0729efbab 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,5 +1,16 @@
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * Makefile.am, configure.ac, spfatal_support/init.c,
+ spfatal_support/system.h: Add new tests to generate fatal errors in
+ open_dev_console().
+ * spfatal14/.cvsignore, spfatal14/Makefile.am, spfatal14/spfatal14.doc,
+ spfatal14/spfatal14.scn, spfatal14/testcase.h, spfatal15/.cvsignore,
+ spfatal15/Makefile.am, spfatal15/spfatal15.doc,
+ spfatal15/spfatal15.scn, spfatal15/testcase.h,
+ spfatal_support/consume_sems.c: New files.
+
+2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* sp43/init.c: Remove more ITRON references.
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 91a4c8b8a7..6be431e12c 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -18,7 +18,8 @@ SUBDIRS = \
spchain spclockget spcoverage spobjgetnext spnotepad01 spprintk spsize \
spstkalloc spthreadq01 spwatchdog spwkspace \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
- spfatal08 spfatal09 spfatal10 spfatal11 spfatal12 spfatal13 \
+ spfatal08 spfatal09 spfatal10 spfatal11 spfatal12 spfatal13 spfatal14 \
+ spfatal15 \
spfifo01 spfifo02 spfifo03 spfifo04 spfifo08 \
spintrcritical01 spintrcritical02 spintrcritical03 spintrcritical04 \
spintrcritical05 spintrcritical06 spintrcritical07 spintrcritical08 \
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 3164868edd..e0b1e1964b 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -112,6 +112,8 @@ spfatal10/Makefile
spfatal11/Makefile
spfatal12/Makefile
spfatal13/Makefile
+spfatal14/Makefile
+spfatal15/Makefile
spfifo01/Makefile
spfifo02/Makefile
spfifo03/Makefile
diff --git a/testsuites/sptests/spfatal14/.cvsignore b/testsuites/sptests/spfatal14/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spfatal14/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spfatal14/Makefile.am b/testsuites/sptests/spfatal14/Makefile.am
new file mode 100644
index 0000000000..051b6afe8b
--- /dev/null
+++ b/testsuites/sptests/spfatal14/Makefile.am
@@ -0,0 +1,29 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spfatal14
+spfatal14_SOURCES = ../spfatal_support/init.c \
+ ../spfatal_support/consume_sems.c \
+ ../spfatal_support/system.h testcase.h
+
+dist_rtems_tests_DATA = spfatal14.scn
+dist_rtems_tests_DATA += spfatal14.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
+AM_CPPFLAGS += -DSEMAPHORES_REMAINING=6
+
+LINK_OBJS = $(spfatal14_OBJECTS) $(spfatal14_LDADD)
+LINK_LIBS = $(spfatal14_LDLIBS)
+
+spfatal14$(EXEEXT): $(spfatal14_OBJECTS) $(spfatal14_DEPENDENCIES)
+ @rm -f spfatal14$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spfatal14/spfatal14.doc b/testsuites/sptests/spfatal14/spfatal14.doc
new file mode 100644
index 0000000000..c7810e47bc
--- /dev/null
+++ b/testsuites/sptests/spfatal14/spfatal14.doc
@@ -0,0 +1,24 @@
+#
+# $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: spfatal14
+
+directives:
+
+ + open("dev/console")
+
+concepts:
+
++ fail to open stderr in open_dev_console.c
+
+
diff --git a/testsuites/sptests/spfatal14/spfatal14.scn b/testsuites/sptests/spfatal14/spfatal14.scn
new file mode 100644
index 0000000000..1e107abf61
--- /dev/null
+++ b/testsuites/sptests/spfatal14/spfatal14.scn
@@ -0,0 +1 @@
+Fatal error (fail to open stderr) hit
diff --git a/testsuites/sptests/spfatal14/testcase.h b/testsuites/sptests/spfatal14/testcase.h
new file mode 100644
index 0000000000..e9e95b62e0
--- /dev/null
+++ b/testsuites/sptests/spfatal14/testcase.h
@@ -0,0 +1,26 @@
+/*
+ * 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$
+ */
+
+/* generate fatal errors in open_dev_console.c */
+
+#define FATAL_ERROR_TEST_NAME "14"
+#define FATAL_ERROR_DESCRIPTION "fail to open stdout"
+#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
+#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
+#define FATAL_ERROR_EXPECTED_ERROR 0x55544431
+
+#define CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS \
+ CONSUME_SEMAPHORE_DRIVERS
+
+void force_error()
+{
+ /* we will not run this far */
+}
diff --git a/testsuites/sptests/spfatal15/.cvsignore b/testsuites/sptests/spfatal15/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spfatal15/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spfatal15/Makefile.am b/testsuites/sptests/spfatal15/Makefile.am
new file mode 100644
index 0000000000..47d2848099
--- /dev/null
+++ b/testsuites/sptests/spfatal15/Makefile.am
@@ -0,0 +1,29 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spfatal15
+spfatal15_SOURCES = ../spfatal_support/init.c \
+ ../spfatal_support/consume_sems.c \
+ ../spfatal_support/system.h testcase.h
+
+dist_rtems_tests_DATA = spfatal15.scn
+dist_rtems_tests_DATA += spfatal15.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
+AM_CPPFLAGS += -DSEMAPHORES_REMAINING=7
+
+LINK_OBJS = $(spfatal15_OBJECTS) $(spfatal15_LDADD)
+LINK_LIBS = $(spfatal15_LDLIBS)
+
+spfatal15$(EXEEXT): $(spfatal15_OBJECTS) $(spfatal15_DEPENDENCIES)
+ @rm -f spfatal15$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spfatal15/spfatal15.doc b/testsuites/sptests/spfatal15/spfatal15.doc
new file mode 100644
index 0000000000..12b5763ac6
--- /dev/null
+++ b/testsuites/sptests/spfatal15/spfatal15.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: spfatal15
+
+directives:
+
+ + open("dev/console")
+
+concepts:
+
++ fail to open stderr in open_dev_console.c
diff --git a/testsuites/sptests/spfatal15/spfatal15.scn b/testsuites/sptests/spfatal15/spfatal15.scn
new file mode 100644
index 0000000000..3515e70214
--- /dev/null
+++ b/testsuites/sptests/spfatal15/spfatal15.scn
@@ -0,0 +1,5 @@
+*** TEST FATAL 15 ***
+Fatal error (fail to open stderr) NOT hit
+[joel@localhost spfatal15]$ make clean all >/dev/null && sis -i *.exe
+sparc-rtems4.11-run is /opt/rtems-4.11/bin/sparc-rtems4.11-run
+Fatal error (fail to open stderr) hit
diff --git a/testsuites/sptests/spfatal15/testcase.h b/testsuites/sptests/spfatal15/testcase.h
new file mode 100644
index 0000000000..66ca243917
--- /dev/null
+++ b/testsuites/sptests/spfatal15/testcase.h
@@ -0,0 +1,25 @@
+/*
+ * 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$
+ */
+
+/* generate fatal errors in open_dev_console.c */
+#define FATAL_ERROR_TEST_NAME "15"
+#define FATAL_ERROR_DESCRIPTION "fail to open stderr"
+#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
+#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
+#define FATAL_ERROR_EXPECTED_ERROR 0x55544432
+
+#define CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS \
+ { consume_semaphores_initialize, NULL, NULL, NULL, NULL, NULL }
+
+void force_error()
+{
+ /* we will not run this far */
+}
diff --git a/testsuites/sptests/spfatal_support/consume_sems.c b/testsuites/sptests/spfatal_support/consume_sems.c
new file mode 100644
index 0000000000..b0fcc420a8
--- /dev/null
+++ b/testsuites/sptests/spfatal_support/consume_sems.c
@@ -0,0 +1,54 @@
+/*
+ * 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 <rtems.h>
+
+#define MAXIMUM 20
+rtems_id Semaphores[MAXIMUM];
+
+rtems_device_driver consume_semaphores_initialize(
+ rtems_device_major_number major __attribute__((unused)),
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *pargp __attribute__((unused))
+)
+{
+ int sems;
+ rtems_status_code status;
+
+ for ( sems=0 ; sems<MAXIMUM ; sems++ ) {
+ status = rtems_semaphore_create(
+ rtems_build_name( 'S', 'M', '1', ' ' ),
+ 1,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_NO_PRIORITY,
+ &Semaphores[sems]
+ );
+ if ( status == RTEMS_TOO_MANY )
+ break;
+ }
+
+ #if 0
+ printk( "Consumed %d\n", sems );
+ printk( "Freeing %d\n", SEMAPHORES_REMAINING );
+ #endif
+
+ #if defined(SEMAPHORES_REMAINING)
+ {
+ int i;
+
+ for ( i=0 ; i<SEMAPHORES_REMAINING ; i++ ) {
+ (void) rtems_semaphore_delete( Semaphores[i] );
+ }
+ }
+ #endif
+ return RTEMS_SUCCESSFUL;
+}
+
diff --git a/testsuites/sptests/spfatal_support/init.c b/testsuites/sptests/spfatal_support/init.c
index a3e87b0aaa..5e2fce1baf 100644
--- a/testsuites/sptests/spfatal_support/init.c
+++ b/testsuites/sptests/spfatal_support/init.c
@@ -102,7 +102,7 @@ void Put_Error( uint32_t source, uint32_t error )
}
else if (source == INTERNAL_ERROR_RTEMS_API ){
if (error > RTEMS_NOT_IMPLEMENTED )
- printk("Unknown Internal Rtems Error (%d)", error);
+ printk("Unknown Internal Rtems Error (0x%08x)", error);
else
printk( Errors_Rtems[ error ] );
}
diff --git a/testsuites/sptests/spfatal_support/system.h b/testsuites/sptests/spfatal_support/system.h
index 4373220c36..07f863e53d 100644
--- a/testsuites/sptests/spfatal_support/system.h
+++ b/testsuites/sptests/spfatal_support/system.h
@@ -45,6 +45,15 @@ void force_error(void);
/* need some prototypes for test cases */
+rtems_device_driver consume_semaphores_initialize(
+ rtems_device_major_number major __attribute__((unused)),
+ rtems_device_minor_number minor __attribute__((unused)),
+ void *pargp __attribute__((unused))
+);
+
+#define CONSUME_SEMAPHORE_DRIVERS \
+ { consume_semaphores_initialize, NULL, NULL, NULL, NULL, NULL }
+
#include "testcase.h"
/* configuration information */