summaryrefslogtreecommitdiffstats
path: root/testsuites/tmtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-21 16:53:50 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-21 16:53:50 +0000
commitf63801a25209817f751e4139c92ca9eb7bd35f05 (patch)
tree67206c4d723682dc0f0a4f05ef9a267d30f1fdcc /testsuites/tmtests
parent2010-06-21 Peter Dufault <dufault@hda.com> (diff)
downloadrtems-f63801a25209817f751e4139c92ca9eb7bd35f05.tar.bz2
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: New test for barrier create, ident, and delete. * tm30/.cvsignore, tm30/Makefile.am, tm30/init.c, tm30/tm30.doc: New files.
Diffstat (limited to 'testsuites/tmtests')
-rw-r--r--testsuites/tmtests/ChangeLog7
-rw-r--r--testsuites/tmtests/Makefile.am2
-rw-r--r--testsuites/tmtests/configure.ac1
-rw-r--r--testsuites/tmtests/tm30/.cvsignore2
-rw-r--r--testsuites/tmtests/tm30/Makefile.am29
-rw-r--r--testsuites/tmtests/tm30/init.c106
-rw-r--r--testsuites/tmtests/tm30/tm30.doc15
7 files changed, 161 insertions, 1 deletions
diff --git a/testsuites/tmtests/ChangeLog b/testsuites/tmtests/ChangeLog
index b23b781ec1..461dd53c26 100644
--- a/testsuites/tmtests/ChangeLog
+++ b/testsuites/tmtests/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac: New test for barrier create, ident, and
+ delete.
+ * tm30/.cvsignore, tm30/Makefile.am, tm30/init.c, tm30/tm30.doc: New
+ files.
+
2009-12-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* tm20/task1.c: Use rtems_test_assert() consistently instead of system
diff --git a/testsuites/tmtests/Makefile.am b/testsuites/tmtests/Makefile.am
index 8b1f427951..cff96a164e 100644
--- a/testsuites/tmtests/Makefile.am
+++ b/testsuites/tmtests/Makefile.am
@@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal
SUBDIRS = tmck tmoverhd tm01 tm02 tm03 tm04 tm05 tm06 tm07 tm08 tm09 tm10 \
tm11 tm12 tm13 tm14 tm15 tm16 tm17 tm18 tm19 tm20 tm21 tm22 tm23 tm24 \
- tm25 tm26 tm27 tm28 tm29
+ tm25 tm26 tm27 tm28 tm29 tm30
include $(top_srcdir)/../automake/subdirs.am
include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/tmtests/configure.ac b/testsuites/tmtests/configure.ac
index 40910f6cf0..73e828d6ff 100644
--- a/testsuites/tmtests/configure.ac
+++ b/testsuites/tmtests/configure.ac
@@ -61,5 +61,6 @@ tm26/Makefile
tm27/Makefile
tm28/Makefile
tm29/Makefile
+tm30/Makefile
])
AC_OUTPUT
diff --git a/testsuites/tmtests/tm30/.cvsignore b/testsuites/tmtests/tm30/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/tmtests/tm30/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/tmtests/tm30/Makefile.am b/testsuites/tmtests/tm30/Makefile.am
new file mode 100644
index 0000000000..d23db16f84
--- /dev/null
+++ b/testsuites/tmtests/tm30/Makefile.am
@@ -0,0 +1,29 @@
+##
+## $Id$
+##
+
+MANAGERS = io rate_monotonic semaphore
+
+rtems_tests_PROGRAMS = tm30
+tm30_SOURCES = init.c ../include/timesys.h \
+ ../../support/src/tmtests_empty_function.c \
+ ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = tm30.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)/include -DOPERATION_COUNT=$(OPERATION_COUNT)
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(tm30_OBJECTS) $(tm30_LDADD)
+LINK_LIBS = $(tm30_LDLIBS)
+
+tm30$(EXEEXT): $(tm30_OBJECTS) $(tm30_DEPENDENCIES)
+ @rm -f tm30$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/tmtests/tm30/init.c b/testsuites/tmtests/tm30/init.c
new file mode 100644
index 0000000000..d27e030442
--- /dev/null
+++ b/testsuites/tmtests/tm30/init.c
@@ -0,0 +1,106 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * 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 <bsp.h>
+#include <coverhd.h>
+#include <tmacros.h>
+#include <timesys.h>
+#include "test_support.h"
+
+rtems_id barrier[ OPERATION_COUNT ];
+
+void benchmark_barrier_create(
+ int iteration,
+ void *argument
+)
+{
+ rtems_status_code status;
+
+ status = rtems_barrier_create(
+ iteration + 1,
+ RTEMS_LOCAL | RTEMS_FIFO,
+ 2,
+ &barrier[iteration]
+ );
+ directive_failed(status, "rtems_barrier_create");
+}
+
+void benchmark_barrier_ident(
+ int iteration,
+ void *argument
+)
+{
+ rtems_status_code status;
+ rtems_id id;
+
+ status = rtems_barrier_ident( iteration+1, &id );
+ directive_failed(status, "rtems_barrier_ident");
+}
+
+void benchmark_barrier_delete(
+ int iteration,
+ void *argument
+)
+{
+ rtems_status_code status;
+
+ status = rtems_barrier_delete( barrier[iteration] );
+ directive_failed(status, "rtems_barrier_delete");
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ puts( "\n\n*** TIME TEST 30 ***" );
+
+ rtems_time_test_measure_operation(
+ "rtems_barrier_create",
+ benchmark_barrier_create,
+ NULL,
+ OPERATION_COUNT,
+ 0
+ );
+
+ rtems_time_test_measure_operation(
+ "rtems_barrier_ident",
+ benchmark_barrier_ident,
+ NULL,
+ OPERATION_COUNT,
+ 0
+ );
+
+ rtems_time_test_measure_operation(
+ "rtems_barrier_delete",
+ benchmark_barrier_delete,
+ NULL,
+ OPERATION_COUNT,
+ 0
+ );
+
+ puts( "*** END OF TIME TEST 30 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_BARRIERS OPERATION_COUNT
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
diff --git a/testsuites/tmtests/tm30/tm30.doc b/testsuites/tmtests/tm30/tm30.doc
new file mode 100644
index 0000000000..6d85454e86
--- /dev/null
+++ b/testsuites/tmtests/tm30/tm30.doc
@@ -0,0 +1,15 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# 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:
+
++ rtems_barrier_create
++ rtems_barrier_delete