summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-07 20:39:14 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-07 20:39:14 +0000
commit12bb21e3b58a3167996450ed32dc182bbc457558 (patch)
tree32f222a3abf7020f628392237fb0ec688eb43ea2 /testsuites
parent2009-07-07 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-12bb21e3b58a3167996450ed32dc182bbc457558.tar.bz2
2009-07-07 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add new test to verify that when a user extension create hook fails, that the error is properly propagated. * sp56/.cvsignore, sp56/Makefile.am, sp56/init.c, sp56/sp56.doc, sp56/sp56.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog7
-rw-r--r--testsuites/sptests/Makefile.am2
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/sp56/.cvsignore2
-rw-r--r--testsuites/sptests/sp56/Makefile.am29
-rw-r--r--testsuites/sptests/sp56/init.c82
-rw-r--r--testsuites/sptests/sp56/sp56.doc25
-rw-r--r--testsuites/sptests/sp56/sp56.scn5
8 files changed, 152 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index efbe4fb07d..cde48da894 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,5 +1,12 @@
2009-07-07 Joel Sherrill <joel.sherrill@OARcorp.com>
+ * Makefile.am, configure.ac: Add new test to verify that when a user
+ extension create hook fails, that the error is properly propagated.
+ * sp56/.cvsignore, sp56/Makefile.am, sp56/init.c, sp56/sp56.doc,
+ sp56/sp56.scn: New files.
+
+2009-07-07 Joel Sherrill <joel.sherrill@OARcorp.com>
+
* sp04/sp04.doc, sp04/sp04.scn, sp04/task1.c: Add test of
rtems_extension_delete.
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 9cc25e95d4..765217e19f 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -7,7 +7,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal
SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \
sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
- sp45 sp46 sp47 sp48 sp49 sp50 sp51 sp52 sp53 sp54 sp55 \
+ sp45 sp46 sp47 sp48 sp49 sp50 sp51 sp52 sp53 sp54 sp55 sp56 \
spchain spobjgetnext spprintk spsize spstkalloc spwatchdog spwkspace \
spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \
spfatal08 spfatal09 spfatal10 spfatal11 spfatal12
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index a6a7eeea39..b5bc273769 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -80,6 +80,7 @@ sp52/Makefile
sp53/Makefile
sp54/Makefile
sp55/Makefile
+sp56/Makefile
spchain/Makefile
spfatal01/Makefile
spfatal02/Makefile
diff --git a/testsuites/sptests/sp56/.cvsignore b/testsuites/sptests/sp56/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/sp56/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/sp56/Makefile.am b/testsuites/sptests/sp56/Makefile.am
new file mode 100644
index 0000000000..93bc30be23
--- /dev/null
+++ b/testsuites/sptests/sp56/Makefile.am
@@ -0,0 +1,29 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp56
+sp56_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp56.scn
+dist_rtems_tests_DATA += sp56.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp56_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DUSE_TIMER_SERVER
+
+LINK_OBJS = $(sp56_OBJECTS) $(sp56_LDADD)
+LINK_LIBS = $(sp56_LDLIBS)
+
+sp56$(EXEEXT): $(sp56_OBJECTS) $(sp56_DEPENDENCIES)
+ @rm -f sp56$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/sp56/init.c b/testsuites/sptests/sp56/init.c
new file mode 100644
index 0000000000..8cf5af5c62
--- /dev/null
+++ b/testsuites/sptests/sp56/init.c
@@ -0,0 +1,82 @@
+/* Extension create fails
+ *
+ * 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>
+
+bool task_create(
+ Thread_Control *executing,
+ Thread_Control *created
+)
+{
+ return false;
+}
+
+rtems_extensions_table Extensions = {
+ task_create, /* task create user extension */
+ NULL, /* task start user extension */
+ NULL, /* task restart user extension */
+ NULL, /* task delete user extension */
+ NULL, /* task switch user extension */
+ NULL, /* task begin user extension */
+ NULL, /* task exitted user extension */
+ NULL /* fatal error user extension */
+};
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ rtems_status_code status;
+ rtems_id extension;
+ rtems_id task_id;
+
+ puts( "\n\n*** TEST 56 ***" );
+
+ puts( "Init - rtems_extension_create - OK" );
+ status = rtems_extension_create(
+ rtems_build_name( 'E', 'X', 'T', ' ' ),
+ &Extensions,
+ &extension
+ );
+ directive_failed( status, "rtems_extension_create" );
+
+ puts( "Init - rtems_task_create - create extension fails - UNSATISFIED" );
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', '1', ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_TIMESLICE,
+ RTEMS_FLOATING_POINT,
+ &task_id
+ );
+ fatal_directive_status( status, RTEMS_UNSATISFIED, "rtems_task_create" );
+
+ puts( "Init - rtems_extension_delete - OK" );
+ status = rtems_extension_delete( extension );
+ directive_failed( status, "rtems_extension_delete" );
+ puts( "*** END OF TEST 56 ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+
+/* global variables */
diff --git a/testsuites/sptests/sp56/sp56.doc b/testsuites/sptests/sp56/sp56.doc
new file mode 100644
index 0000000000..60b94814a4
--- /dev/null
+++ b/testsuites/sptests/sp56/sp56.doc
@@ -0,0 +1,25 @@
+#
+# $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: sp56
+
+directives:
+
+ rtems_extension_create
+ rtems_task_create
+ rtems_extension_delete
+
+concepts:
+
++ Ensure that when an extension create hook returns false (e.g. fails), that
+ the thread creation returns the proper error.
diff --git a/testsuites/sptests/sp56/sp56.scn b/testsuites/sptests/sp56/sp56.scn
new file mode 100644
index 0000000000..545062a883
--- /dev/null
+++ b/testsuites/sptests/sp56/sp56.scn
@@ -0,0 +1,5 @@
+*** TEST 56 ***
+Init - rtems_extension_create - OK
+Init - rtems_task_create - create extension fails - UNSATISFIED
+Init - rtems_extension_delete - OK
+*** END OF TEST 56 ***