summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-16 15:00:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-16 15:00:44 +0000
commit13a4c71cc40e3853844b6ca7b0b359ae19b599d3 (patch)
treeea037cfaa6dbd9600961804fd3afd1ecc0b61d8e /testsuites
parent2009-07-16 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-13a4c71cc40e3853844b6ca7b0b359ae19b599d3.tar.bz2
2009-07-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add test for auto initialization of message queues. * psxautoinit02/.cvsignore, psxautoinit02/Makefile.am, psxautoinit02/init.c, psxautoinit02/psxautoinit02.doc, psxautoinit02/psxautoinit02.scn: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/psxtests/ChangeLog8
-rw-r--r--testsuites/psxtests/Makefile.am4
-rw-r--r--testsuites/psxtests/configure.ac1
-rw-r--r--testsuites/psxtests/psxautoinit02/.cvsignore14
-rw-r--r--testsuites/psxtests/psxautoinit02/Makefile.am32
-rw-r--r--testsuites/psxtests/psxautoinit02/init.c55
-rw-r--r--testsuites/psxtests/psxautoinit02/psxautoinit02.doc26
-rw-r--r--testsuites/psxtests/psxautoinit02/psxautoinit02.scn5
8 files changed, 143 insertions, 2 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog
index cea00fd0e7..4ff58d6fc6 100644
--- a/testsuites/psxtests/ChangeLog
+++ b/testsuites/psxtests/ChangeLog
@@ -1,3 +1,11 @@
+2009-07-16 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac: Add test for auto initialization of
+ message queues.
+ * psxautoinit02/.cvsignore, psxautoinit02/Makefile.am,
+ psxautoinit02/init.c, psxautoinit02/psxautoinit02.doc,
+ psxautoinit02/psxautoinit02.scn: New files.
+
2009-07-07 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add test of pthread mutex auto
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index 077a006ebf..9b82357d5f 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -5,8 +5,8 @@
ACLOCAL_AMFLAGS = -I ../aclocal
SUBDIRS = psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
- psx10 psx11 psx12 psx13 psx14 psxautoinit01 psxbarrier01 psxcancel \
- psxcleanup psxenosys psxfatal01 psxfatal02 psxkey01 psxitimer \
+ psx10 psx11 psx12 psx13 psx14 psxautoinit01 psxautoinit02 psxbarrier01 \
+ psxcancel psxcleanup psxenosys psxfatal01 psxfatal02 psxkey01 psxitimer \
psxmsgq01 psxmsgq02 psxmsgq03 psxobj01 psxrwlock01 psxsem01 \
psxsignal01 psxspin01 psxsysconf psxtime psxtimer01 psxtimer02 \
psxualarm
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac
index f75c81fb78..d026824e32 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -41,6 +41,7 @@ psx12/Makefile
psx13/Makefile
psx14/Makefile
psxautoinit01/Makefile
+psxautoinit02/Makefile
psxbarrier01/Makefile
psxcancel/Makefile
psxchroot01/Makefile
diff --git a/testsuites/psxtests/psxautoinit02/.cvsignore b/testsuites/psxtests/psxautoinit02/.cvsignore
new file mode 100644
index 0000000000..bfdfd995be
--- /dev/null
+++ b/testsuites/psxtests/psxautoinit02/.cvsignore
@@ -0,0 +1,14 @@
+aclocal.m4
+autom4te*.cache
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+Makefile
+Makefile.in
+missing
+mkinstalldirs
diff --git a/testsuites/psxtests/psxautoinit02/Makefile.am b/testsuites/psxtests/psxautoinit02/Makefile.am
new file mode 100644
index 0000000000..935b5029e0
--- /dev/null
+++ b/testsuites/psxtests/psxautoinit02/Makefile.am
@@ -0,0 +1,32 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxautoinit02
+psxautoinit02_SOURCES = init.c ../include/pmacros.h
+
+scndir = $(rtems_testsdir)
+dist_rtems_tests_DATA = psxautoinit02.scn
+dist_rtems_tests_DATA += psxautoinit02.doc
+
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+psxautoinit02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxautoinit02_OBJECTS) $(psxautoinit02_LDADD)
+LINK_LIBS = $(psxautoinit02_LDLIBS)
+
+psxautoinit02$(EXEEXT): $(psxautoinit02_OBJECTS) \
+ $(psxautoinit02_DEPENDENCIES)
+ @rm -f psxautoinit02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/psxtests/psxautoinit02/init.c b/testsuites/psxtests/psxautoinit02/init.c
new file mode 100644
index 0000000000..53ec797c00
--- /dev/null
+++ b/testsuites/psxtests/psxautoinit02/init.c
@@ -0,0 +1,55 @@
+/*
+ * 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"
+#include <pthread.h>
+#include <errno.h>
+
+void *POSIX_Init(
+ void *argument
+)
+{
+ int sc;
+ pthread_cond_t cond1;
+ pthread_cond_t cond2;
+
+ puts( "\n\n*** POSIX TEST -- AUTOMATIC INITIALIZAITON 02 ***" );
+
+ cond1 = PTHREAD_COND_INITIALIZER;
+ cond2 = PTHREAD_COND_INITIALIZER;
+ puts( "Init - pthread_cond_broadcast - auto initialize - OK" );
+ sc = pthread_cond_broadcast( &cond1 );
+ fatal_posix_service_status( sc, 0, "cond broadcast OK" );
+
+ puts( "Init - pthread_cond_broadcast - auto initialize - EINVAL" );
+ sc = pthread_cond_broadcast( &cond2 );
+ fatal_posix_service_status( sc, EINVAL, "cond lock EINVAL" );
+
+ puts( "Init - pthread_cond_destroy - OK" );
+ sc = pthread_cond_destroy( &cond1 );
+ fatal_posix_service_status( sc, 0, "cond destroy OK" );
+
+ puts( "*** END OF POSIX TEST AUTOMATIC INITIALIZATION 02 ***" );
+ rtems_test_exit( 0 );
+
+ return NULL; /* just so the compiler thinks we returned something */
+}
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
diff --git a/testsuites/psxtests/psxautoinit02/psxautoinit02.doc b/testsuites/psxtests/psxautoinit02/psxautoinit02.doc
new file mode 100644
index 0000000000..25a06985b0
--- /dev/null
+++ b/testsuites/psxtests/psxautoinit02/psxautoinit02.doc
@@ -0,0 +1,26 @@
+#
+# $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: psxautoinit02
+
+directives:
+
+ pthread_cond_broadcast - auto initialization mode
+ pthread_cond_destroy
+
+concepts:
+
++ Verify that auto initialization of POSIX message queues works.
+
++ Verify that auto intialization of POSIX message queues properly handles
+ running out of message queues.
diff --git a/testsuites/psxtests/psxautoinit02/psxautoinit02.scn b/testsuites/psxtests/psxautoinit02/psxautoinit02.scn
new file mode 100644
index 0000000000..bfe3067468
--- /dev/null
+++ b/testsuites/psxtests/psxautoinit02/psxautoinit02.scn
@@ -0,0 +1,5 @@
+*** POSIX TEST -- AUTOMATIC INITIALIZAITON 02 ***
+Init - pthread_cond_broadcast - auto initialize - OK
+Init - pthread_cond_broadcast - auto initialize - EINVAL
+Init - pthread_cond_destroy - OK
+*** END OF POSIX TEST AUTOMATIC INITIALIZATION 02 ***