From 5d8a0bab42122a0d1d60334d7262546dcbbc116c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 22 Jun 2010 01:28:13 +0000 Subject: 2010-06-21 Joel Sherrill * 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. --- testsuites/sptests/ChangeLog | 11 +++++ testsuites/sptests/Makefile.am | 3 +- testsuites/sptests/configure.ac | 2 + testsuites/sptests/spfatal14/.cvsignore | 2 + testsuites/sptests/spfatal14/Makefile.am | 29 ++++++++++++ testsuites/sptests/spfatal14/spfatal14.doc | 24 ++++++++++ testsuites/sptests/spfatal14/spfatal14.scn | 1 + testsuites/sptests/spfatal14/testcase.h | 26 +++++++++++ testsuites/sptests/spfatal15/.cvsignore | 2 + testsuites/sptests/spfatal15/Makefile.am | 29 ++++++++++++ testsuites/sptests/spfatal15/spfatal15.doc | 22 +++++++++ testsuites/sptests/spfatal15/spfatal15.scn | 5 +++ testsuites/sptests/spfatal15/testcase.h | 25 +++++++++++ testsuites/sptests/spfatal_support/consume_sems.c | 54 +++++++++++++++++++++++ testsuites/sptests/spfatal_support/init.c | 2 +- testsuites/sptests/spfatal_support/system.h | 9 ++++ 16 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 testsuites/sptests/spfatal14/.cvsignore create mode 100644 testsuites/sptests/spfatal14/Makefile.am create mode 100644 testsuites/sptests/spfatal14/spfatal14.doc create mode 100644 testsuites/sptests/spfatal14/spfatal14.scn create mode 100644 testsuites/sptests/spfatal14/testcase.h create mode 100644 testsuites/sptests/spfatal15/.cvsignore create mode 100644 testsuites/sptests/spfatal15/Makefile.am create mode 100644 testsuites/sptests/spfatal15/spfatal15.doc create mode 100644 testsuites/sptests/spfatal15/spfatal15.scn create mode 100644 testsuites/sptests/spfatal15/testcase.h create mode 100644 testsuites/sptests/spfatal_support/consume_sems.c (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 1c833fcb87..a0729efbab 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,14 @@ +2010-06-21 Joel Sherrill + + * 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 * sp43/init.c: Remove more ITRON references. 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 + +#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 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 */ -- cgit v1.2.3