summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp47
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-21 20:47:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-21 20:47:58 +0000
commit03f0885546cd067f01be23c611a2795b97ecacc0 (patch)
tree512808dd6f66f6268e0b5b3f203333dba30640f1 /testsuites/sptests/sp47
parent2009-01-21 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-03f0885546cd067f01be23c611a2795b97ecacc0.tar.bz2
2009-01-21 Nickolay Kolchin <nbkolchin@gmail.com>
Joel Sherrill <joel.sherrill@oarcorp.com> PR 1357/cpukit * rtems/src/tasks.c: Ensure creating a task with no ASR is honored.
Diffstat (limited to 'testsuites/sptests/sp47')
-rw-r--r--testsuites/sptests/sp47/.cvsignore2
-rw-r--r--testsuites/sptests/sp47/Makefile.am28
-rw-r--r--testsuites/sptests/sp47/init.c68
-rw-r--r--testsuites/sptests/sp47/sp47.doc23
-rw-r--r--testsuites/sptests/sp47/sp47.scn3
5 files changed, 124 insertions, 0 deletions
diff --git a/testsuites/sptests/sp47/.cvsignore b/testsuites/sptests/sp47/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/sp47/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/sp47/Makefile.am b/testsuites/sptests/sp47/Makefile.am
new file mode 100644
index 0000000000..c0a1f04335
--- /dev/null
+++ b/testsuites/sptests/sp47/Makefile.am
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp47.exe
+sp47_exe_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp47.scn
+dist_rtems_tests_DATA += sp47.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp47_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(sp47_exe_OBJECTS) $(sp47_exe_LDADD)
+LINK_LIBS = $(sp47_exe_LDLIBS)
+
+sp47.exe$(EXEEXT): $(sp47_exe_OBJECTS) $(sp47_exe_DEPENDENCIES)
+ @rm -f sp47.exe$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/sp47/init.c b/testsuites/sptests/sp47/init.c
new file mode 100644
index 0000000000..d0115fab0f
--- /dev/null
+++ b/testsuites/sptests/sp47/init.c
@@ -0,0 +1,68 @@
+/*
+ * Submitted as part of PR1357
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+
+rtems_task test_asr(rtems_task_argument unused)
+{
+ rtems_mode mode;
+
+ rtems_task_mode(0, RTEMS_CURRENT_MODE, &mode);
+
+ if ( (mode & RTEMS_NO_ASR) == 0 ) {
+ puts( "ERROR - disable ASR not honored" );
+ printf(
+ "mode = 0x%08X asr = %s\n", mode,
+ (mode & RTEMS_NO_ASR) ? "OFF" : "ON"
+ );
+ } else
+ puts( "Creating task with ASR disable mode honored" );
+
+ puts( "*** END OF TEST 47 ***" );
+ rtems_test_exit( 0 );
+}
+
+rtems_task Init(rtems_task_argument ignored)
+{
+ rtems_status_code sc;
+ rtems_id ti;
+
+ puts( "\n\n*** TEST 47 ***" );
+ sc = rtems_task_create(
+ rtems_build_name('t', 's', 't', '0'),
+ 100,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_NO_ASR,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &ti
+ );
+
+ if (sc != RTEMS_SUCCESSFUL) {
+ printf("rtems_task_create failed: %i\n", sc);
+ exit(0);
+ }
+
+ rtems_task_start(ti, test_asr, 0);
+
+ rtems_task_delete(RTEMS_SELF);
+}
+
+/* configuration stuff */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MICROSECONDS_PER_TICK 10000
+
+#define CONFIGURE_MAXIMUM_TASKS 64
+#define CONFIGURE_MAXIMUM_PERIODS 10
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/sp47/sp47.doc b/testsuites/sptests/sp47/sp47.doc
new file mode 100644
index 0000000000..0ad61fe107
--- /dev/null
+++ b/testsuites/sptests/sp47/sp47.doc
@@ -0,0 +1,23 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2008.
+# 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: sp47
+
+directives:
+
+ rtems_task_create
+ rtems_task_mode
+
+concepts:
+
++ Ensure that setting the initial ASR mode of a task is honored. (PR1357)
diff --git a/testsuites/sptests/sp47/sp47.scn b/testsuites/sptests/sp47/sp47.scn
new file mode 100644
index 0000000000..fb41a47057
--- /dev/null
+++ b/testsuites/sptests/sp47/sp47.scn
@@ -0,0 +1,3 @@
+*** TEST 47 ***
+Creating task with ASR disable mode honored
+*** END OF TEST 47 ***