diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-21 16:53:50 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-21 16:53:50 +0000 |
commit | f63801a25209817f751e4139c92ca9eb7bd35f05 (patch) | |
tree | 67206c4d723682dc0f0a4f05ef9a267d30f1fdcc /testsuites/tmtests/tm30 | |
parent | 2010-06-21 Peter Dufault <dufault@hda.com> (diff) | |
download | rtems-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/tm30')
-rw-r--r-- | testsuites/tmtests/tm30/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/tmtests/tm30/Makefile.am | 29 | ||||
-rw-r--r-- | testsuites/tmtests/tm30/init.c | 106 | ||||
-rw-r--r-- | testsuites/tmtests/tm30/tm30.doc | 15 |
4 files changed, 152 insertions, 0 deletions
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 |