diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-20 01:05:33 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-20 01:05:33 +0000 |
commit | f691e0a09f9ff7b24d482145cf9ae52220ee9b0f (patch) | |
tree | 2771b3f59e36fa3bd9b8e10645a735843184b7c1 /testsuites | |
parent | *** empty log message *** (diff) | |
download | rtems-f691e0a09f9ff7b24d482145cf9ae52220ee9b0f.tar.bz2 |
2009-07-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add sp60 to exercise case where a task is
blocked on one period while another expires. Add sp61 which exercises
the case where a call is made to rtems_shutdown_executive when the
system is not up.
* sp60/.cvsignore, sp60/Makefile.am, sp60/init.c, sp60/sp60.doc,
sp60/sp60.scn, sp61/.cvsignore, sp61/Makefile.am, sp61/init.c,
sp61/sp61.doc, sp61/sp61.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/sptests/ChangeLog | 10 | ||||
-rw-r--r-- | testsuites/sptests/Makefile.am | 1 | ||||
-rw-r--r-- | testsuites/sptests/configure.ac | 2 | ||||
-rw-r--r-- | testsuites/sptests/sp60/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/sp60/Makefile.am | 28 | ||||
-rw-r--r-- | testsuites/sptests/sp60/init.c | 70 | ||||
-rw-r--r-- | testsuites/sptests/sp60/sp60.doc | 25 | ||||
-rw-r--r-- | testsuites/sptests/sp60/sp60.scn | 11 | ||||
-rw-r--r-- | testsuites/sptests/sp61/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/sptests/sp61/Makefile.am | 28 | ||||
-rw-r--r-- | testsuites/sptests/sp61/init.c | 47 | ||||
-rw-r--r-- | testsuites/sptests/sp61/sp61.doc | 24 | ||||
-rw-r--r-- | testsuites/sptests/sp61/sp61.scn | 5 |
13 files changed, 255 insertions, 0 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index ea208a2620..a4a736719f 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,5 +1,15 @@ 2009-07-19 Joel Sherrill <joel.sherrill@oarcorp.com> + * Makefile.am, configure.ac: Add sp60 to exercise case where a task is + blocked on one period while another expires. Add sp61 which exercises + the case where a call is made to rtems_shutdown_executive when the + system is not up. + * sp60/.cvsignore, sp60/Makefile.am, sp60/init.c, sp60/sp60.doc, + sp60/sp60.scn, sp61/.cvsignore, sp61/Makefile.am, sp61/init.c, + sp61/sp61.doc, sp61/sp61.scn: New files. + +2009-07-19 Joel Sherrill <joel.sherrill@oarcorp.com> + * sp04/init.c: To be timesliced, tasks must also me preemptible. 2009-07-16 Joel Sherrill <joel.sherrill@oarcorp.com> diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index a5fb28dc0b..8257bf15f1 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -11,6 +11,7 @@ SUBDIRS = \ sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 \ sp40 sp42 sp43 sp44 sp45 sp46 sp47 sp48 sp49 \ sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 sp58 sp59 \ + sp60 sp61 \ spchain spobjgetnext spprintk spsize spstkalloc spthreadq01 \ spwatchdog spwkspace \ spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \ diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac index b7f2742fc0..b1dec1f1d3 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -83,6 +83,8 @@ sp56/Makefile sp57/Makefile sp58/Makefile sp59/Makefile +sp60/Makefile +sp61/Makefile spchain/Makefile spfatal01/Makefile spfatal02/Makefile diff --git a/testsuites/sptests/sp60/.cvsignore b/testsuites/sptests/sp60/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/sp60/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/sp60/Makefile.am b/testsuites/sptests/sp60/Makefile.am new file mode 100644 index 0000000000..b164bef099 --- /dev/null +++ b/testsuites/sptests/sp60/Makefile.am @@ -0,0 +1,28 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = sp60 +sp60_SOURCES = init.c + +dist_rtems_tests_DATA = sp60.scn +dist_rtems_tests_DATA += sp60.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +sp60_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(sp60_OBJECTS) $(sp60_LDADD) +LINK_LIBS = $(sp60_LDLIBS) + +sp60$(EXEEXT): $(sp60_OBJECTS) $(sp60_DEPENDENCIES) + @rm -f sp60$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/sp60/init.c b/testsuites/sptests/sp60/init.c new file mode 100644 index 0000000000..93b467e86f --- /dev/null +++ b/testsuites/sptests/sp60/init.c @@ -0,0 +1,70 @@ +/* + * 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 Init( + rtems_task_argument ignored +) +{ + rtems_status_code sc; + rtems_id period1; + rtems_id period2; + + puts( "\n\n*** TEST 60 ***" ); + + puts( "Init - rtems_rate_monotonic_create - first period" ); + sc = rtems_rate_monotonic_create( + rtems_build_name( 'P', 'E', 'R', '1' ), + &period1 + ); + directive_failed( sc, "rtems_rate_monotonic_create 1" ); + + puts( "Init - rtems_rate_monotonic_create - second period" ); + sc = rtems_rate_monotonic_create( + rtems_build_name( 'P', 'E', 'R', '2' ), + &period2 + ); + directive_failed( sc, "rtems_rate_monotonic_create 1" ); + + puts( "Init - rtems_rate_monotonic_period - short period" ); + sc = rtems_rate_monotonic_period(period1, RTEMS_MILLISECONDS_TO_TICKS(200) ); + directive_failed( sc, "rtems_rate_monotonic_period" ); + + puts( "Init - rtems_rate_monotonic_period - long period initiated" ); + sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) ); + directive_failed( sc, "rtems_rate_monotonic_period" ); + + puts( "Init - rtems_rate_monotonic_period - long period block" ); + sc = rtems_rate_monotonic_period(period2, RTEMS_MILLISECONDS_TO_TICKS(1000) ); + directive_failed( sc, "rtems_rate_monotonic_period" ); + + puts( "Init - rtems_rate_monotonic_period - verify long period expired" ); + sc = rtems_rate_monotonic_period(period1, RTEMS_PERIOD_STATUS ); + fatal_directive_status(sc, RTEMS_TIMEOUT, "rtems_task_period status"); + + puts( "*** END OF TEST 60 ***" ); + 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_MAXIMUM_PERIODS 2 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> + +/* global variables */ diff --git a/testsuites/sptests/sp60/sp60.doc b/testsuites/sptests/sp60/sp60.doc new file mode 100644 index 0000000000..a4fe454f49 --- /dev/null +++ b/testsuites/sptests/sp60/sp60.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: sp60 + +directives: + + rtems_rate_monotonic_create + rtems_rate_monotonic_period + +concepts: + ++ Ensure that when a task is blocked on one period while another period + expires which is associated with the same task, that the task remains + blocked. diff --git a/testsuites/sptests/sp60/sp60.scn b/testsuites/sptests/sp60/sp60.scn new file mode 100644 index 0000000000..93c4b9b367 --- /dev/null +++ b/testsuites/sptests/sp60/sp60.scn @@ -0,0 +1,11 @@ +sparc-rtems4.10-run is /opt/rtems-4.10/bin/sparc-rtems4.10-run +
+
+*** TEST 60 ***
+Init - rtems_rate_monotonic_create - first period
+Init - rtems_rate_monotonic_create - second period
+Init - rtems_rate_monotonic_period - short period
+Init - rtems_rate_monotonic_period - long period initiated
+Init - rtems_rate_monotonic_period - long period block
+Init - rtems_rate_monotonic_period - verify long period expired
+*** END OF TEST 60 ***
diff --git a/testsuites/sptests/sp61/.cvsignore b/testsuites/sptests/sp61/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/sp61/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/sp61/Makefile.am b/testsuites/sptests/sp61/Makefile.am new file mode 100644 index 0000000000..d1b979ec95 --- /dev/null +++ b/testsuites/sptests/sp61/Makefile.am @@ -0,0 +1,28 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = sp61 +sp61_SOURCES = init.c + +dist_rtems_tests_DATA = sp61.scn +dist_rtems_tests_DATA += sp61.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +sp61_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(sp61_OBJECTS) $(sp61_LDADD) +LINK_LIBS = $(sp61_LDLIBS) + +sp61$(EXEEXT): $(sp61_OBJECTS) $(sp61_DEPENDENCIES) + @rm -f sp61$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/sp61/init.c b/testsuites/sptests/sp61/init.c new file mode 100644 index 0000000000..23fa4895f6 --- /dev/null +++ b/testsuites/sptests/sp61/init.c @@ -0,0 +1,47 @@ +/* + * 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$ + */ + +#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ +#include <tmacros.h> + + +rtems_task Init( + rtems_task_argument ignored +) +{ + puts( "\n\n*** TEST 61 ***" ); + + puts( "Init - Set current System State to Shutdown" ); + _System_state_Set( SYSTEM_STATE_SHUTDOWN ); + + puts( "Init - rtems_shutdown_executive when already shutdown" ); + rtems_shutdown_executive( 0 ); + + puts( "Init - restore System State and shutdown for real" ); + _System_state_Set( SYSTEM_STATE_UP ); + + puts( "*** END OF TEST 61 ***" ); + 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_MAXIMUM_REGIONS 1 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> + +/* global variables */ diff --git a/testsuites/sptests/sp61/sp61.doc b/testsuites/sptests/sp61/sp61.doc new file mode 100644 index 0000000000..163fed4238 --- /dev/null +++ b/testsuites/sptests/sp61/sp61.doc @@ -0,0 +1,24 @@ +# +# $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: sp61 + +directives: + + _System_state_Set + rtems_shutdown_executive + +concepts: + ++ Ensure that shutting RTEMS down when the system state indicates it is + already shutdown does not do anything. diff --git a/testsuites/sptests/sp61/sp61.scn b/testsuites/sptests/sp61/sp61.scn new file mode 100644 index 0000000000..b064f5816a --- /dev/null +++ b/testsuites/sptests/sp61/sp61.scn @@ -0,0 +1,5 @@ +*** TEST 61 *** +Init - Set current System State to Shutdown +Init - rtems_shutdown_executive when already shutdown +Init - restore System State and shutdown for real +*** END OF TEST 61 *** |