summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-30 22:20:39 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-30 22:20:39 +0000
commitc83a33ccbbcbf108412a116356b6168b8b3b8b99 (patch)
tree13d913b50ab2b913336a81c7658d2bf0f8fff05a /testsuites
parent2009-01-30 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-c83a33ccbbcbf108412a116356b6168b8b3b8b99.tar.bz2
2009-01-30 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add sp48 which tests that configuring for unlimited objects when configured for a unified workspace works as expected. * sp48/.cvsignore, sp48/Makefile.am, sp48/init.c, sp48/sp48.doc, sp48/sp48.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog8
-rw-r--r--testsuites/sptests/Makefile.am4
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/sp48/.cvsignore2
-rw-r--r--testsuites/sptests/sp48/Makefile.am28
-rw-r--r--testsuites/sptests/sp48/init.c84
-rw-r--r--testsuites/sptests/sp48/sp48.doc24
-rw-r--r--testsuites/sptests/sp48/sp48.scn11
8 files changed, 160 insertions, 2 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index d1ed6cbe7d..8adb8f4a7a 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-30 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac: Add sp48 which tests that configuring for
+ unlimited objects when configured for a unified workspace works as
+ expected.
+ * sp48/.cvsignore, sp48/Makefile.am, sp48/init.c, sp48/sp48.doc,
+ sp48/sp48.scn: New files.
+
2009-01-21 Nickolay Kolchin <nbkolchin@gmail.com>
Joel Sherrill <joel.sherrill@oarcorp.com>
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 341f71b6ae..be54ecf62b 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -8,8 +8,8 @@ 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 spsize spwatchdog spfatal01 spfatal02 spfatal03 spfatal04 \
- spfatal05 spfatal06 spfatal07 spfatal08 spfatal09
+ sp45 sp46 sp47 sp48 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
+ spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 058d0cd7b2..e518a73553 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -72,6 +72,7 @@ sp44/Makefile
sp45/Makefile
sp46/Makefile
sp47/Makefile
+sp48/Makefile
spwatchdog/Makefile
spsize/Makefile
spfatal/Makefile
diff --git a/testsuites/sptests/sp48/.cvsignore b/testsuites/sptests/sp48/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/sp48/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/sp48/Makefile.am b/testsuites/sptests/sp48/Makefile.am
new file mode 100644
index 0000000000..5c705d4d16
--- /dev/null
+++ b/testsuites/sptests/sp48/Makefile.am
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = sp48.exe
+sp48_exe_SOURCES = init.c
+
+dist_rtems_tests_DATA = sp48.scn
+dist_rtems_tests_DATA += sp48.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+sp48_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(sp48_exe_OBJECTS) $(sp48_exe_LDADD)
+LINK_LIBS = $(sp48_exe_LDLIBS)
+
+sp48.exe$(EXEEXT): $(sp48_exe_OBJECTS) $(sp48_exe_DEPENDENCIES)
+ @rm -f sp48.exe$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/sp48/init.c b/testsuites/sptests/sp48/init.c
new file mode 100644
index 0000000000..33c8315c1c
--- /dev/null
+++ b/testsuites/sptests/sp48/init.c
@@ -0,0 +1,84 @@
+/*
+ * Verify creation of semaphores with unlimited attribute works.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include <rtems/libcsupport.h>
+
+#define MAX 5000
+rtems_id Semaphores[MAX];
+
+rtems_task Init(rtems_task_argument ignored)
+{
+ rtems_status_code sc;
+ int i;
+ int created;
+
+ puts( "\n\n*** TEST 48 ***" );
+
+ printf( "Largest C program heap block available: %d\n", malloc_free_space() );
+ for (i=0 ; i<MAX ; i++ ) {
+ sc = rtems_semaphore_create(
+ rtems_build_name('s', 'e', 'm', ' '),
+ 1,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ 0,
+ &Semaphores[i]
+ );
+ /* printf("Creating %i id=0x%08x\n", i, Semaphores[i]); */
+
+ if (sc == RTEMS_TOO_MANY) {
+ printf("We run out at %i!\n", i);
+ break;
+ }
+ if (sc != RTEMS_SUCCESSFUL) {
+ printf("FAILED creating at %i\n", i);
+ directive_failed( sc, "rtems_semaphore_create " );
+ rtems_test_exit( 0 );
+ }
+ }
+
+ created = i;
+ if ( created == MAX )
+ puts( "Created all semaphores allowed in this test" );
+
+ printf( "%d semaphores created\n", i );
+ printf( "Largest C program heap block available: %d\n", malloc_free_space() );
+
+ for ( i-- ; i ; i-- ) {
+ sc = rtems_semaphore_delete( Semaphores[i] );
+ if (sc != RTEMS_SUCCESSFUL) {
+ printf("FAILED deleting at %i\n", i);
+ directive_failed( sc, "rtems_semaphore_delete " );
+ rtems_test_exit( 0 );
+ }
+ }
+
+ printf( "%d semaphores successfully deleted\n", created );
+ printf( "Largest C program heap block available: %d\n", malloc_free_space() );
+
+ puts( "*** END OF TEST 48 ***" );
+ rtems_test_exit( 0 );
+}
+
+/* configuration stuff */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_SEMAPHORES rtems_resource_unlimited(5)
+#if 1
+ #define CONFIGURE_UNIFIED_WORK_AREAS
+#else
+ #define CONFIGURE_MEMORY_OVERHEAD 1024
+#endif
+
+#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/sp48/sp48.doc b/testsuites/sptests/sp48/sp48.doc
new file mode 100644
index 0000000000..5e71aee8d9
--- /dev/null
+++ b/testsuites/sptests/sp48/sp48.doc
@@ -0,0 +1,24 @@
+#
+# $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: sp48
+
+directives:
+
+ rtems_semaphore_create
+ rtems_semaphore_delete
+
+concepts:
+
++ Ensure that unlimited object configuration works properly when
+ configured for unified C program heap and Executive Workspace.
diff --git a/testsuites/sptests/sp48/sp48.scn b/testsuites/sptests/sp48/sp48.scn
new file mode 100644
index 0000000000..98049cfe16
--- /dev/null
+++ b/testsuites/sptests/sp48/sp48.scn
@@ -0,0 +1,11 @@
+*** TEST 48 ***
+Largest C program heap block available: 4006096
+Created all semaphores allowed in this test
+5000 semaphores created
+Largest C program heap block available: 2376296
+5000 semaphores successfully deleted
+Largest C program heap block available: 2376296
+*** END OF TEST 48 ***
+
+NOTE: Heap block size and maximum objects created vary based upon target.
+ The maximum semaphores that will be created is 5000.