summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtmtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-13 15:23:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-13 15:23:25 +0000
commit02a7789c7756f84a61efe4d4fd4d0159febc2a49 (patch)
tree0868dadc8f68efcf60dea84cb2967823523b8aa9 /testsuites/psxtmtests
parent2011-07-12 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-02a7789c7756f84a61efe4d4fd4d0159febc2a49.tar.bz2
2011-07-13 Ricardo Aguirre <el.mastin@ymail.com>
PR 1831/tests * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of mutex init and destroy. * psxtmmutex01/.cvsignore, psxtmmutex01/Makefile.am, psxtmmutex01/init.c, psxtmmutex01/psxtmmutex01.doc: New files.
Diffstat (limited to 'testsuites/psxtmtests')
-rw-r--r--testsuites/psxtmtests/ChangeLog8
-rw-r--r--testsuites/psxtmtests/Makefile.am12
-rw-r--r--testsuites/psxtmtests/configure.ac5
-rw-r--r--testsuites/psxtmtests/psxtmmutex01/.cvsignore2
-rw-r--r--testsuites/psxtmtests/psxtmmutex01/Makefile.am30
-rw-r--r--testsuites/psxtmtests/psxtmmutex01/init.c89
-rw-r--r--testsuites/psxtmtests/psxtmmutex01/psxtmmutex01.doc15
-rw-r--r--testsuites/psxtmtests/psxtmtests_plan.csv4
8 files changed, 156 insertions, 9 deletions
diff --git a/testsuites/psxtmtests/ChangeLog b/testsuites/psxtmtests/ChangeLog
index fccb613a38..d07728dd86 100644
--- a/testsuites/psxtmtests/ChangeLog
+++ b/testsuites/psxtmtests/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-13 Ricardo Aguirre <el.mastin@ymail.com>
+
+ PR 1831/tests
+ * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
+ mutex init and destroy.
+ * psxtmmutex01/.cvsignore, psxtmmutex01/Makefile.am,
+ psxtmmutex01/init.c, psxtmmutex01/psxtmmutex01.doc: New files.
+
2011-07-12 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtmnanosleep01/init.c, psxtmsleep01/init.c: Do not divide by
diff --git a/testsuites/psxtmtests/Makefile.am b/testsuites/psxtmtests/Makefile.am
index 1bad66682c..3522322169 100644
--- a/testsuites/psxtmtests/Makefile.am
+++ b/testsuites/psxtmtests/Makefile.am
@@ -4,19 +4,21 @@
ACLOCAL_AMFLAGS = -I ../aclocal
+SUBDIRS =
+
if HAS_POSIX
-SUBDIRS = psxtmmutex02
+SUBDIRS += psxtmmutex01
+SUBDIRS += psxtmmutex02
+SUBDIRS += psxtmmutex03
+SUBDIRS += psxtmnanosleep01
+SUBDIRS += psxtmnanosleep02
SUBDIRS += psxtmsleep01
SUBDIRS += psxtmsleep02
SUBDIRS += psxtmthread01
SUBDIRS += psxtmthread03
-SUBDIRS += psxtmnanosleep01
-SUBDIRS += psxtmnanosleep02
-SUBDIRS += psxtmmutex03
endif
DIST_SUBDIRS = $(SUBDIRS)
-# EXTRA_DIST = psxfatal_support/init.c psxfatal_support/system.h
include $(top_srcdir)/../automake/subdirs.am
include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/psxtmtests/configure.ac b/testsuites/psxtmtests/configure.ac
index aca7324ca4..35b26c6534 100644
--- a/testsuites/psxtmtests/configure.ac
+++ b/testsuites/psxtmtests/configure.ac
@@ -79,13 +79,14 @@ AC_SUBST(OPERATION_COUNT)
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
+psxtmmutex01/Makefile
psxtmmutex02/Makefile
psxtmmutex03/Makefile
+psxtmnanosleep01/Makefile
+psxtmnanosleep02/Makefile
psxtmsleep01/Makefile
psxtmsleep02/Makefile
psxtmthread01/Makefile
psxtmthread03/Makefile
-psxtmnanosleep01/Makefile
-psxtmnanosleep02/Makefile
])
AC_OUTPUT
diff --git a/testsuites/psxtmtests/psxtmmutex01/.cvsignore b/testsuites/psxtmtests/psxtmmutex01/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmmutex01/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/psxtmtests/psxtmmutex01/Makefile.am b/testsuites/psxtmtests/psxtmmutex01/Makefile.am
new file mode 100644
index 0000000000..2ec2bfd6ad
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmmutex01/Makefile.am
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmmutex01
+psxtmmutex01_SOURCES = init.c ../../tmtests/include/timesys.h \
+ ../../support/src/tmtests_empty_function.c \
+ ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmmutex01.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 = $(psxtmmutex01_OBJECTS) $(psxtmmutex01_LDADD)
+LINK_LIBS = $(psxtmmutex01_LDLIBS)
+
+psxtmmutex01$(EXEEXT): $(psxtmmutex01_OBJECTS) $(psxtmmutex01_DEPENDENCIES)
+ @rm -f psxtmmutex01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/psxtmtests/psxtmmutex01/init.c b/testsuites/psxtmtests/psxtmmutex01/init.c
new file mode 100644
index 0000000000..418f35bcec
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmmutex01/init.c
@@ -0,0 +1,89 @@
+/*
+ * 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_mutex_t MutexId;
+
+void test_mutex_create(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = pthread_mutex_init( &MutexId, NULL );
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "pthread_mutex_init",
+ end_time,
+ 1,
+ 0,
+ 0
+ );
+}
+
+void test_mutex_destroy(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = pthread_mutex_destroy( &MutexId );
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "pthread_mutex_destroy",
+ end_time,
+ 1,
+ 0,
+ 0
+ );
+}
+
+void *POSIX_Init(
+ void *argument
+)
+{
+
+ puts( "\n\n*** POSIX TIME TEST PSXTMMUTEX01 ***" );
+
+ test_mutex_create();
+ test_mutex_destroy();
+
+ puts( "*** END OF POSIX TIME TEST PSXTMMUTEX01 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
diff --git a/testsuites/psxtmtests/psxtmmutex01/psxtmmutex01.doc b/testsuites/psxtmtests/psxtmmutex01/psxtmmutex01.doc
new file mode 100644
index 0000000000..9e8113c507
--- /dev/null
+++ b/testsuites/psxtmtests/psxtmmutex01/psxtmmutex01.doc
@@ -0,0 +1,15 @@
+#
+# $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_mutex_init
++ phtread_mutex_destroy
diff --git a/testsuites/psxtmtests/psxtmtests_plan.csv b/testsuites/psxtmtests/psxtmtests_plan.csv
index edf096babf..43aa9968d1 100644
--- a/testsuites/psxtmtests/psxtmtests_plan.csv
+++ b/testsuites/psxtmtests/psxtmtests_plan.csv
@@ -1,6 +1,6 @@
"Test Case","Test","Template","Implemented"
-"pthread_mutex_init","psxtmmutex01","psxtmtest_init_destroy",
-"pthread_mutex_destroy","psxtmmutex01","psxtmtest_init_destroy",
+"pthread_mutex_init","psxtmmutex01","psxtmtest_init_destroy","Yes"
+"pthread_mutex_destroy","psxtmmutex01","psxtmtest_init_destroy","Yes"
"pthread_mutex_lock - not available, block","psxtmmutex02","psxtmtest_blocking","Yes"
"pthread_mutex_lock - available","psxtmmutex03","psxtmtest_single","Yes"
"pthread_mutex_trylock - available","psxtmmutex03","psxtmtest_single","Yes"