summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp60
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-20 01:05:33 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-20 01:05:33 +0000
commitf691e0a09f9ff7b24d482145cf9ae52220ee9b0f (patch)
tree2771b3f59e36fa3bd9b8e10645a735843184b7c1 /testsuites/sptests/sp60
parent*** empty log message *** (diff)
downloadrtems-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/sptests/sp60')
-rw-r--r--testsuites/sptests/sp60/.cvsignore2
-rw-r--r--testsuites/sptests/sp60/Makefile.am28
-rw-r--r--testsuites/sptests/sp60/init.c70
-rw-r--r--testsuites/sptests/sp60/sp60.doc25
-rw-r--r--testsuites/sptests/sp60/sp60.scn11
5 files changed, 136 insertions, 0 deletions
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 ***