summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-22 20:53:33 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-22 20:53:33 +0000
commitdfe9034dad6c3fd7c1b269e880ca4d229fdbeb0b (patch)
tree30ab7abdffc8c8d86216c9d08f526de95cfc7db9 /testsuites
parent2011-06-21 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-dfe9034dad6c3fd7c1b269e880ca4d229fdbeb0b.tar.bz2
2011-06-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add test case for sleep - blocking. * psxtmsleep02/.cvsignore, psxtmsleep02/Makefile.am, psxtmsleep02/init.c, psxtmsleep02/psxtmsleep02.doc: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/psxtmtests/ChangeLog6
-rw-r--r--testsuites/psxtmtests/Makefile.am9
-rw-r--r--testsuites/psxtmtests/configure.ac1
-rw-r--r--testsuites/psxtmtests/psxtmsleep02/.cvsignore2
-rw-r--r--testsuites/psxtmtests/psxtmsleep02/Makefile.am30
-rw-r--r--testsuites/psxtmtests/psxtmsleep02/init.c87
-rw-r--r--testsuites/psxtmtests/psxtmsleep02/psxtmsleep02.doc14
7 files changed, 145 insertions, 4 deletions
diff --git a/testsuites/psxtmtests/ChangeLog b/testsuites/psxtmtests/ChangeLog
index c0d6327231..018a849a1c 100644
--- a/testsuites/psxtmtests/ChangeLog
+++ b/testsuites/psxtmtests/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac: Add test case for sleep - blocking.
+ * psxtmsleep02/.cvsignore, psxtmsleep02/Makefile.am,
+ psxtmsleep02/init.c, psxtmsleep02/psxtmsleep02.doc: New files.
+
2011-06-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtmsleep01/Makefile.in: Removed.
diff --git a/testsuites/psxtmtests/Makefile.am b/testsuites/psxtmtests/Makefile.am
index b7f39f2dff..51b71cd499 100644
--- a/testsuites/psxtmtests/Makefile.am
+++ b/testsuites/psxtmtests/Makefile.am
@@ -5,10 +5,11 @@
ACLOCAL_AMFLAGS = -I ../aclocal
if HAS_POSIX
-SUBDIRS = \
- psxtmmutex02 \
- psxtmsleep01 \
- psxtmthread01 psxtmthread03
+SUBDIRS = psxtmmutex02
+SUBDIRS += psxtmsleep01
+SUBDIRS += psxtmsleep02
+SUBDIRS += psxtmthread01
+SUBDIRS += psxtmthread03
endif
DIST_SUBDIRS = $(SUBDIRS)
diff --git a/testsuites/psxtmtests/configure.ac b/testsuites/psxtmtests/configure.ac
index 5b71d57d15..65efb3f396 100644
--- a/testsuites/psxtmtests/configure.ac
+++ b/testsuites/psxtmtests/configure.ac
@@ -81,6 +81,7 @@ AC_SUBST(OPERATION_COUNT)
AC_CONFIG_FILES([Makefile
psxtmmutex02/Makefile
psxtmsleep01/Makefile
+psxtmsleep02/Makefile
psxtmthread01/Makefile
psxtmthread03/Makefile
])
diff --git a/testsuites/psxtmtests/psxtmsleep02/.cvsignore b/testsuites/psxtmtests/psxtmsleep02/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmsleep02/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/psxtmtests/psxtmsleep02/Makefile.am b/testsuites/psxtmtests/psxtmsleep02/Makefile.am
new file mode 100644
index 0000000000..470daf595e
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmsleep02/Makefile.am
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmsleep02
+psxtmsleep02_SOURCES = init.c ../../tmtests/include/timesys.h \
+ ../../support/src/tmtests_empty_function.c \
+ ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmsleep02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+OPERATION_COUNT = @OPERATION_COUNT@
+AM_CPPFLAGS += -I$(top_srcdir)/../tmtests/include
+AM_CPPFLAGS += -DOPERATION_COUNT=$(OPERATION_COUNT)
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxtmsleep02_OBJECTS) $(psxtmsleep02_LDADD)
+LINK_LIBS = $(psxtmsleep02_LDLIBS)
+
+psxtmsleep02$(EXEEXT): $(psxtmsleep02_OBJECTS) $(psxtmsleep02_DEPENDENCIES)
+ @rm -f psxtmsleep02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/psxtmtests/psxtmsleep02/init.c b/testsuites/psxtmtests/psxtmsleep02/init.c
new file mode 100644
index 0000000000..4938584069
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmsleep02/init.c
@@ -0,0 +1,87 @@
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <timesys.h>
+#include <rtems/timerdrv.h>
+#include "test_support.h"
+
+#include <pthread.h>
+
+void *Low(
+ void *argument
+)
+{
+ long end_time;
+
+ end_time = benchmark_timer_read();
+
+ put_time(
+ "sleep - blocking",
+ end_time,
+ OPERATION_COUNT,
+ 0,
+ 0
+ );
+
+ puts( "*** END OF POSIX TIME TEST sleep - blocking ***" );
+
+ rtems_test_exit( 0 );
+ return NULL;
+}
+
+void *Middle(
+ void *argument
+)
+{
+ sleep(1);
+ return NULL;
+}
+
+void *POSIX_Init(
+ void *argument
+)
+{
+ int i;
+ int status;
+ pthread_t threadId;
+
+ puts( "\n\n*** POSIX TIME TEST sleep - blocking ***" );
+
+ for ( i=0 ; i < OPERATION_COUNT - 1 ; i++ ) {
+ status = pthread_create( &threadId, NULL, Middle, NULL );
+ rtems_test_assert( !status );
+ }
+
+ status = pthread_create( &threadId, NULL, Low, NULL );
+ rtems_test_assert( !status );
+
+ /* start the timer and switch through all the other tasks */
+ benchmark_timer_initialize();
+ sleep(1);
+ return NULL;
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS OPERATION_COUNT + 2
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+ /* end of file */
diff --git a/testsuites/psxtmtests/psxtmsleep02/psxtmsleep02.doc b/testsuites/psxtmtests/psxtmsleep02/psxtmsleep02.doc
new file mode 100644
index 0000000000..325141e54d
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmsleep02/psxtmsleep02.doc
@@ -0,0 +1,14 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# 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 test benchmarks the following operations:
+
++ sleep - blocking