summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-20 13:20:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-20 13:20:25 +0000
commit7be58fc5615b8a29ca51011904a231a1e1452a8e (patch)
tree896d7ec0552747426d8a9d7dad14dbd12dba9433 /testsuites
parentRegenerate. (diff)
downloadrtems-7be58fc5615b8a29ca51011904a231a1e1452a8e.tar.bz2
2011-07-20 Ricardo Aguirre <el.mastin@ymail.com>
PR 1843/tests * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of key create and delete. * psxtmkey01/.cvsignore, psxtmkey01/Makefile.am, psxtmkey01/init.c, psxtmkey01/psxtmkey01.doc: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/psxtmtests/ChangeLog8
-rw-r--r--testsuites/psxtmtests/Makefile.am1
-rw-r--r--testsuites/psxtmtests/configure.ac1
-rw-r--r--testsuites/psxtmtests/psxtmkey01/.cvsignore2
-rw-r--r--testsuites/psxtmtests/psxtmkey01/Makefile.am30
-rw-r--r--testsuites/psxtmtests/psxtmkey01/init.c92
-rw-r--r--testsuites/psxtmtests/psxtmkey01/psxtmkey01.doc16
-rw-r--r--testsuites/psxtmtests/psxtmtests_plan.csv6
8 files changed, 153 insertions, 3 deletions
diff --git a/testsuites/psxtmtests/ChangeLog b/testsuites/psxtmtests/ChangeLog
index c81578e0d2..c4674efa61 100644
--- a/testsuites/psxtmtests/ChangeLog
+++ b/testsuites/psxtmtests/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-20 Ricardo Aguirre <el.mastin@ymail.com>
+
+ PR 1843/tests
+ * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of key
+ create and delete.
+ * psxtmkey01/.cvsignore, psxtmkey01/Makefile.am, psxtmkey01/init.c,
+ psxtmkey01/psxtmkey01.doc: New files.
+
2011-07-19 Ricardo Aguirre <el.mastin@ymail.com>
PR 1840/tests
diff --git a/testsuites/psxtmtests/Makefile.am b/testsuites/psxtmtests/Makefile.am
index 64e5b7d914..4c46ace61f 100644
--- a/testsuites/psxtmtests/Makefile.am
+++ b/testsuites/psxtmtests/Makefile.am
@@ -7,6 +7,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal
SUBDIRS =
if HAS_POSIX
+SUBDIRS += psxtmkey01
SUBDIRS += psxtmkey02
SUBDIRS += psxtmmutex01
SUBDIRS += psxtmmutex02
diff --git a/testsuites/psxtmtests/configure.ac b/testsuites/psxtmtests/configure.ac
index b2cab57d69..1decd26fcf 100644
--- a/testsuites/psxtmtests/configure.ac
+++ b/testsuites/psxtmtests/configure.ac
@@ -79,6 +79,7 @@ AC_SUBST(OPERATION_COUNT)
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
+psxtmkey01/Makefile
psxtmkey02/Makefile
psxtmmutex01/Makefile
psxtmmutex02/Makefile
diff --git a/testsuites/psxtmtests/psxtmkey01/.cvsignore b/testsuites/psxtmtests/psxtmkey01/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmkey01/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/psxtmtests/psxtmkey01/Makefile.am b/testsuites/psxtmtests/psxtmkey01/Makefile.am
new file mode 100644
index 0000000000..290b76c74c
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmkey01/Makefile.am
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmkey01
+psxtmkey01_SOURCES = init.c ../../tmtests/include/timesys.h \
+ ../../support/src/tmtests_empty_function.c \
+ ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmkey01.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 = $(psxtmkey01_OBJECTS) $(psxtmkey01_LDADD)
+LINK_LIBS = $(psxtmkey01_LDLIBS)
+
+psxtmkey01$(EXEEXT): $(psxtmkey01_OBJECTS) $(psxtmkey01_DEPENDENCIES)
+ @rm -f psxtmkey01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/psxtmtests/psxtmkey01/init.c b/testsuites/psxtmtests/psxtmkey01/init.c
new file mode 100644
index 0000000000..bdd4fcb345
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmkey01/init.c
@@ -0,0 +1,92 @@
+/*
+ * 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 <errno.h>
+#include <pthread.h>
+#include "test_support.h"
+
+pthread_key_t Key;
+
+void benchmark_pthread_key_create(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = pthread_key_create(&Key, NULL);
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "pthread_key_create",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+
+}
+
+void benchmark_pthread_key_delete(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = pthread_key_delete(Key);
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "pthread_key_delete",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+
+}
+
+void *POSIX_Init(void *argument)
+{
+
+ puts( "\n\n*** POSIX TIME TEST PSXTMKEY01 ***" );
+
+ /*key creation, using NULL destructor*/
+ benchmark_pthread_key_create();
+
+ /* key deletion*/
+ benchmark_pthread_key_delete();
+
+ puts( "*** END OF POSIX TIME TEST PSXTMKEY01 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
diff --git a/testsuites/psxtmtests/psxtmkey01/psxtmkey01.doc b/testsuites/psxtmtests/psxtmkey01/psxtmkey01.doc
new file mode 100644
index 0000000000..e00306a538
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmkey01/psxtmkey01.doc
@@ -0,0 +1,16 @@
+#
+# $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:
+
++ pthread_key_create
++ pthread_key_delete
+
diff --git a/testsuites/psxtmtests/psxtmtests_plan.csv b/testsuites/psxtmtests/psxtmtests_plan.csv
index 9ddf404543..e03ebf0410 100644
--- a/testsuites/psxtmtests/psxtmtests_plan.csv
+++ b/testsuites/psxtmtests/psxtmtests_plan.csv
@@ -9,7 +9,7 @@
"pthread_mutex_unlock - thread waiting, no preempt","psxtmmutex05","psxtmtest_unblocking_nopreempt",
"pthread_mutex_unlock - thread waiting, preempt","psxtmmutex06","psxtmtest_unblocking_preempt",
"pthread_mutex_timedlock - available","psxtmmutex03","psxtmtest_single","Yes"
-"pthread_mutex_timedlock - not available, block","psxtmmutex04","psxtmtest_blocking",
+"pthread_mutex_timedlock - not available, block","psxtmmutex04","psxtmtest_blocking","Yes"
"pthread_mutex_setprioceiling","psxtmmutex07","psxtmtest_single","Yes"
"pthread_mutex_getprioceiling","psxtmmutex07","psxtmtest_single","Yes"
,,,
@@ -36,10 +36,10 @@
,,,
"pthread_once",,,
,,,
-"pthread_key_create","psxtmkey01","psxtmtest_init_destroy",
+"pthread_key_create","psxtmkey01","psxtmtest_single","Yes"
"pthread_setspecific","psxtmkey02","psxtmtest_single","Yes"
"pthread_getspecific","psxtmkey02","psxtmtest_single","Yes"
-"pthread_key_delete","psxtmkey01","psxtmtest_init_destroy",
+"pthread_key_delete","psxtmkey01","psxtmtest_single","Yes"
,,,
"pthread_cancel",,,
"pthread_setcancelstate",,,