summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2012-12-20 14:17:17 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-12-20 14:17:17 -0600
commit71cb49560fe4f8c72282641aa46b41b6308b82b1 (patch)
treed42846d5eb5e4fb0beff82dd603467115c5b2e4c
parentdejagnu/boards/rtems-v850-v850sim.exp: New file (diff)
downloadrtems-testing-71cb49560fe4f8c72282641aa46b41b6308b82b1.tar.bz2
psxtmtest_init_destroy: Add new test template
-rw-r--r--rtems-test-template/psxtmtest_init_destroy/Makefile.am27
-rw-r--r--rtems-test-template/psxtmtest_init_destroy/TEST.doc13
-rw-r--r--rtems-test-template/psxtmtest_init_destroy/init.c94
3 files changed, 134 insertions, 0 deletions
diff --git a/rtems-test-template/psxtmtest_init_destroy/Makefile.am b/rtems-test-template/psxtmtest_init_destroy/Makefile.am
new file mode 100644
index 0000000..ec853b3
--- /dev/null
+++ b/rtems-test-template/psxtmtest_init_destroy/Makefile.am
@@ -0,0 +1,27 @@
+MANAGERS = all
+
+rtems_tests_PROGRAMS = @LOWER@
+@LOWER@_SOURCES = init.c
+@LOWER@_SOURCES += ../../tmtests/include/timesys.h
+@LOWER@_SOURCES += ../../support/src/tmtests_empty_function.c
+@LOWER@_SOURCES += ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = @LOWER@.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 = $(@LOWER@_OBJECTS) $(@LOWER@_LDADD)
+LINK_LIBS = $(@LOWER@_LDLIBS)
+
+@LOWER@$(EXEEXT): $(@LOWER@_OBJECTS) $(@LOWER@_DEPENDENCIES)
+ @rm -f @LOWER@$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/rtems-test-template/psxtmtest_init_destroy/TEST.doc b/rtems-test-template/psxtmtest_init_destroy/TEST.doc
new file mode 100644
index 0000000..e2e56e8
--- /dev/null
+++ b/rtems-test-template/psxtmtest_init_destroy/TEST.doc
@@ -0,0 +1,13 @@
+# COPYRIGHT (c) 1989-2012.
+# 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:
+
++ @DESC@
++ @DESC@
++ XXX Fix above
diff --git a/rtems-test-template/psxtmtest_init_destroy/init.c b/rtems-test-template/psxtmtest_init_destroy/init.c
new file mode 100644
index 0000000..a98c3ce
--- /dev/null
+++ b/rtems-test-template/psxtmtest_init_destroy/init.c
@@ -0,0 +1,94 @@
+/*
+ * COPYRIGHT (c) 1989-2012.
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <timesys.h>
+#include <rtems/timerdrv.h>
+#include "test_support.h"
+
+/* forward declarations to avoid warnings */
+void *POSIX_Init(void *argument);
+void benchmark_NAME_OF_CREATE_OPERATION(void);
+void benchmark_NAME_OF_DELETE_OPERATION(void);
+
+void benchmark_NAME_OF_CREATE_OPERATION(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ /* XXX single shot CREATE operation goes here -- test expected status */
+ /* XXX outside of the benchmark'ed region */
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "@DESC@", /* XXX fix to indicate create name */
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+
+}
+
+void benchmark_NAME_OF_DELETE_OPERATION(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ /* XXX single shot operation goes here -- test expected status outside */
+ /* XXX of the benchmark'ed region */
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "@DESC@", /* XXX fix to indicate delete name */
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+
+}
+
+void *POSIX_Init(
+ void *argument
+)
+{
+
+ puts( "\n\n*** POSIX TIME TEST @UPPER@ ***" );
+
+ /* XXX any required initialization goes here */
+
+ benchmark_NAME_OF_CREATE_OPERATION();
+ benchmark_NAME_OF_DELETE_OPERATION();
+
+ puts( "*** END OF POSIX TIME TEST @UPPER@ ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+/* XXX configure an instance of the object created/destroyed */
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */