From a3a9a2d0ef051a671ca1cee5f18a871c3117dc5d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 12 Oct 2009 00:00:04 +0000 Subject: 2009-10-11 Joel Sherrill * psxcleanup/system.h: Fix typo. * Makefile.am, configure.ac: Add new test for exercising pushing and popping a clean up handler without actually executing it. * psxcleanup01/.cvsignore, psxcleanup01/Makefile.am, psxcleanup01/init.c, psxcleanup01/psxcleanup01.doc, psxcleanup01/psxcleanup01.scn: New files. --- testsuites/psxtests/ChangeLog | 9 ++++ testsuites/psxtests/Makefile.am | 3 +- testsuites/psxtests/configure.ac | 1 + testsuites/psxtests/psxcleanup/system.h | 2 +- testsuites/psxtests/psxcleanup01/.cvsignore | 2 + testsuites/psxtests/psxcleanup01/Makefile.am | 28 +++++++++++++ testsuites/psxtests/psxcleanup01/init.c | 50 +++++++++++++++++++++++ testsuites/psxtests/psxcleanup01/psxcleanup01.doc | 23 +++++++++++ testsuites/psxtests/psxcleanup01/psxcleanup01.scn | 4 ++ 9 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 testsuites/psxtests/psxcleanup01/.cvsignore create mode 100644 testsuites/psxtests/psxcleanup01/Makefile.am create mode 100644 testsuites/psxtests/psxcleanup01/init.c create mode 100644 testsuites/psxtests/psxcleanup01/psxcleanup01.doc create mode 100644 testsuites/psxtests/psxcleanup01/psxcleanup01.scn (limited to 'testsuites') diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index 1ca020ab1e..7a5052dde9 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,12 @@ +2009-10-11 Joel Sherrill + + * psxcleanup/system.h: Fix typo. + * Makefile.am, configure.ac: Add new test for exercising pushing + and popping a clean up handler without actually executing it. + * psxcleanup01/.cvsignore, psxcleanup01/Makefile.am, + psxcleanup01/init.c, psxcleanup01/psxcleanup01.doc, + psxcleanup01/psxcleanup01.scn: New files. + 2009-10-11 Joel Sherrill * Makefile.am, configure.ac: Add new test to ensure that canceling an diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am index bd3bccd28a..518c3c237b 100644 --- a/testsuites/psxtests/Makefile.am +++ b/testsuites/psxtests/Makefile.am @@ -9,7 +9,8 @@ if HAS_POSIX SUBDIRS += psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \ psx10 psx11 psx12 psx13 psx14 psxalarm01 \ psxautoinit01 psxautoinit02 psxbarrier01 \ - psxcancel psxcancel01 psxcleanup psxcond01 psxenosys psxkey01 psxkey02 \ + psxcancel psxcancel01 psxcleanup psxcleanup01 \ + psxcond01 psxenosys psxkey01 psxkey02 \ psxkey03 psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 \ psxmutexattr01 psxobj01 psxrwlock01 psxsem01 psxsignal01 psxsignal02 \ psxsignal03 psxsignal04 psxsignal05 psxspin01 psxspin02 psxsysconf \ diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac index 0e810d3bec..951a0324b0 100644 --- a/testsuites/psxtests/configure.ac +++ b/testsuites/psxtests/configure.ac @@ -51,6 +51,7 @@ psxcancel/Makefile psxcancel01/Makefile psxchroot01/Makefile psxcleanup/Makefile +psxcleanup01/Makefile psxclock/Makefile psxcond01/Makefile psxenosys/Makefile diff --git a/testsuites/psxtests/psxcleanup/system.h b/testsuites/psxtests/psxcleanup/system.h index fc7a05d1e6..5baf542c60 100644 --- a/testsuites/psxtests/psxcleanup/system.h +++ b/testsuites/psxtests/psxcleanup/system.h @@ -7,7 +7,7 @@ * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * - * $Id} + * $Id$ */ /* functions */ diff --git a/testsuites/psxtests/psxcleanup01/.cvsignore b/testsuites/psxtests/psxcleanup01/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/psxtests/psxcleanup01/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/psxtests/psxcleanup01/Makefile.am b/testsuites/psxtests/psxcleanup01/Makefile.am new file mode 100644 index 0000000000..b62793cc64 --- /dev/null +++ b/testsuites/psxtests/psxcleanup01/Makefile.am @@ -0,0 +1,28 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = psxcleanup01 +psxcleanup01_SOURCES = init.c ../include/pmacros.h + +dist_rtems_tests_DATA = psxcleanup01.scn + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +psxcleanup01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) + +AM_CPPFLAGS += -I$(top_srcdir)/include +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(psxcleanup01_OBJECTS) $(psxcleanup01_LDADD) +LINK_LIBS = $(psxcleanup01_LDLIBS) + +psxcleanup01$(EXEEXT): $(psxcleanup01_OBJECTS) $(psxcleanup01_DEPENDENCIES) + @rm -f psxcleanup01$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/psxtests/psxcleanup01/init.c b/testsuites/psxtests/psxcleanup01/init.c new file mode 100644 index 0000000000..4225c32d82 --- /dev/null +++ b/testsuites/psxtests/psxcleanup01/init.c @@ -0,0 +1,50 @@ +/* + * + * 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 +#include "pmacros.h" +#include /* thread facilities */ + +void cleaner(void *arg) +{ + puts( "clean was not supposed to run" ); + rtems_test_exit(0); +} + +void *POSIX_Init( + void *argument +) +{ + puts( "\n\n*** POSIX CLEANUP TEST 01 ***" ); + + puts( "Init - pthread_cleanup_push - a routine we will not execute" ); + pthread_cleanup_push(cleaner, NULL); + + puts( "Init - pthread_cleanup_pop - do not execute" ); + pthread_cleanup_pop(0); + + puts( "*** END OF POSIX CLEANUP TEST 01 ***\n" ); + rtems_test_exit(0); +} + + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 + +#define CONFIGURE_INIT +#include diff --git a/testsuites/psxtests/psxcleanup01/psxcleanup01.doc b/testsuites/psxtests/psxcleanup01/psxcleanup01.doc new file mode 100644 index 0000000000..26f8b9fb06 --- /dev/null +++ b/testsuites/psxtests/psxcleanup01/psxcleanup01.doc @@ -0,0 +1,23 @@ +# +# $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: psxcleanup01 + +directives: + + pthread_cleanup_push + pthread_cleanup_pop + +concepts: + ++ Ensure that popping a routine without executing works as expected. diff --git a/testsuites/psxtests/psxcleanup01/psxcleanup01.scn b/testsuites/psxtests/psxcleanup01/psxcleanup01.scn new file mode 100644 index 0000000000..4eaed6c77a --- /dev/null +++ b/testsuites/psxtests/psxcleanup01/psxcleanup01.scn @@ -0,0 +1,4 @@ +*** POSIX CLEANUP TEST 01 *** +Init - pthread_cleanup_push - a routine we will not execute +Init - pthread_cleanup_pop - do not execute +*** END OF POSIX CLEANUP TEST 01 *** -- cgit v1.2.3