diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-08 18:49:15 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-08 18:49:15 +0000 |
commit | 02819318cdd3516e1e2a625d26d532fda7eb8cd3 (patch) | |
tree | 6e41691c6123139990ec11eedd8cacb158baf3a0 /testsuites | |
parent | 2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-02819318cdd3516e1e2a625d26d532fda7eb8cd3.tar.bz2 |
2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add test of restarting a task which is in
the middle of a sleep or wake after.
* sp57/.cvsignore, sp57/Makefile.am, sp57/init.c, sp57/sp57.doc,
sp57/sp57.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/sptests/ChangeLog | 7 | ||||
-rw-r--r-- | testsuites/sptests/Makefile.am | 2 | ||||
-rw-r--r-- | testsuites/sptests/configure.ac | 1 | ||||
-rw-r--r-- | testsuites/sptests/sp57/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/sp57/Makefile.am | 29 | ||||
-rw-r--r-- | testsuites/sptests/sp57/init.c | 75 | ||||
-rw-r--r-- | testsuites/sptests/sp57/sp57.doc | 25 | ||||
-rw-r--r-- | testsuites/sptests/sp57/sp57.scn | 7 |
8 files changed, 147 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index dbf5ade25b..476d9c3685 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,5 +1,12 @@ 2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com> + * Makefile.am, configure.ac: Add test of restarting a task which is in + the middle of a sleep or wake after. + * sp57/.cvsignore, sp57/Makefile.am, sp57/init.c, sp57/sp57.doc, + sp57/sp57.scn: New files. + +2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com> + * sp43/init.c, sp43/sp43.scn: Add more cases for rtems_object_get_class_information() to improve coverage. diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index 765217e19f..dc82e0c3db 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 sp56 \ + sp45 sp46 sp47 sp48 sp49 sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 \ 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 b5bc273769..6c2c24a0b2 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -81,6 +81,7 @@ sp53/Makefile sp54/Makefile sp55/Makefile sp56/Makefile +sp57/Makefile spchain/Makefile spfatal01/Makefile spfatal02/Makefile diff --git a/testsuites/sptests/sp57/.cvsignore b/testsuites/sptests/sp57/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/sp57/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/sp57/Makefile.am b/testsuites/sptests/sp57/Makefile.am new file mode 100644 index 0000000000..e15340c96c --- /dev/null +++ b/testsuites/sptests/sp57/Makefile.am @@ -0,0 +1,29 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = sp57 +sp57_SOURCES = init.c + +dist_rtems_tests_DATA = sp57.scn +dist_rtems_tests_DATA += sp57.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +sp57_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include +AM_CPPFLAGS += -DUSE_TIMER_SERVER + +LINK_OBJS = $(sp57_OBJECTS) $(sp57_LDADD) +LINK_LIBS = $(sp57_LDLIBS) + +sp57$(EXEEXT): $(sp57_OBJECTS) $(sp57_DEPENDENCIES) + @rm -f sp57$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/sp57/init.c b/testsuites/sptests/sp57/init.c new file mode 100644 index 0000000000..7c139edf56 --- /dev/null +++ b/testsuites/sptests/sp57/init.c @@ -0,0 +1,75 @@ +/* Restart a task which is delaying + * + * 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> + +rtems_task Delay_task( + rtems_task_argument ignored +) +{ + rtems_status_code status; + + puts( "Delay - rtems_task_wake_after - OK" ); + status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(2000) ); + + puts( "ERROR - delay task woke up!!" ); + rtems_test_exit(0); +} + +rtems_task Init( + rtems_task_argument ignored +) +{ + rtems_status_code status; + rtems_id task_id; + + puts( "\n\n*** TEST 57 ***" ); + + puts( "Init - rtems_task_create - delay task - OK" ); + status = rtems_task_create( + rtems_build_name( 'T', 'A', '1', ' ' ), + 1, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_OPTIONS, + RTEMS_DEFAULT_ATTRIBUTES, + &task_id + ); + directive_failed( status, "rtems_task_create" ); + + puts( "Init - rtems_task_start - delay task - OK" ); + status = rtems_task_start( task_id, Delay_task, 0 ); + directive_failed( status, "rtems_task_start" ); + + puts( "Init - rtems_task_wake_after - let delay task block - OK" ); + status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(1000) ); + directive_failed( status, "rtems_task_wake_after" ); + + puts( "Init - rtems_task_restart - delay task - OK" ); + status = rtems_task_restart( task_id, 0 ); + directive_failed( status, "rtems_task_restart" ); + + puts( "*** END OF TEST 57 ***" ); + rtems_test_exit(0); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> + +/* global variables */ diff --git a/testsuites/sptests/sp57/sp57.doc b/testsuites/sptests/sp57/sp57.doc new file mode 100644 index 0000000000..40c3994d93 --- /dev/null +++ b/testsuites/sptests/sp57/sp57.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: sp57 + +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/sp57/sp57.scn b/testsuites/sptests/sp57/sp57.scn new file mode 100644 index 0000000000..95007266d4 --- /dev/null +++ b/testsuites/sptests/sp57/sp57.scn @@ -0,0 +1,7 @@ +*** TEST 57 *** +Init - rtems_task_create - delay task - OK +Init - rtems_task_start - delay task - OK +Init - rtems_task_wake_after - let delay task block - OK +Delay - rtems_task_wake_after - OK +Init - rtems_task_restart - delay task - OK +*** END OF TEST 57 *** |