summaryrefslogtreecommitdiffstats
path: root/testsuites/tmtests/tm03
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-07-10 14:20:39 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-07-14 19:31:00 -0500
commitb6343c61002b421e4d578e9868bedc1f0f0b43d7 (patch)
tree5c26dfacce2523537cb201e5f07de599cf454901 /testsuites/tmtests/tm03
parentcapture01: Add include of assert.h. (diff)
downloadrtems-b6343c61002b421e4d578e9868bedc1f0f0b43d7.tar.bz2
Enhance Semaphore Blocking and Readying Time Test Cases
tm02 and tm03 were modified to be reused for multiple configurations of RTEMS Classic API Semaphores. This added tm31-36. The messages for tm02 and tm03 were modified to indicate the semaphore attributes. tm31 - tm36 were added. This resulted in the following cases: tm02 - rtems_semaphore_obtain: Counting/FIFO not available caller blocks tm03 - rtems_semaphore_release: Counting/FIFO task readied preempts caller tm31 - rtems_semaphore_obtain: Counting/priority not available caller blocks tm32 - rtems_semaphore_release: Counting/priority task readied preempts caller tm33 - rtems_semaphore_obtain: Binary/FIFO not available caller blocks tm34 - rtems_semaphore_release: Binary/FIFO task readied preempts caller tm35 - rtems_semaphore_obtain: Binary/priority not available caller blocks tm36 - rtems_semaphore_release: Binary/priority task readied preempts caller
Diffstat (limited to 'testsuites/tmtests/tm03')
-rw-r--r--testsuites/tmtests/tm03/Makefile.am1
-rw-r--r--testsuites/tmtests/tm03/task1.c29
-rw-r--r--testsuites/tmtests/tm03/tm03.doc5
3 files changed, 29 insertions, 6 deletions
diff --git a/testsuites/tmtests/tm03/Makefile.am b/testsuites/tmtests/tm03/Makefile.am
index be850763cf..1f6d6fe689 100644
--- a/testsuites/tmtests/tm03/Makefile.am
+++ b/testsuites/tmtests/tm03/Makefile.am
@@ -13,6 +13,7 @@ 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
+AM_CPPFLAGS += -DTM03
LINK_OBJS = $(tm03_OBJECTS)
LINK_LIBS = $(tm03_LDLIBS)
diff --git a/testsuites/tmtests/tm03/task1.c b/testsuites/tmtests/tm03/task1.c
index 9cd8de8cdb..42126ac8a5 100644
--- a/testsuites/tmtests/tm03/task1.c
+++ b/testsuites/tmtests/tm03/task1.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2013.
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -14,7 +14,30 @@
#define CONFIGURE_INIT
#include "system.h"
+#if defined(TM03)
const char rtems_test_name[] = "TIME TEST 3";
+#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_FIFO)
+#define ATTR_DESC "counting/FIFO"
+
+#elif defined(TM32)
+const char rtems_test_name[] = "TIME TEST 32";
+#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY)
+#define ATTR_DESC "counting/priority"
+
+#elif defined(TM34)
+const char rtems_test_name[] = "TIME TEST 34";
+#define SEMAPHORE_ATTRIBUTES RTEMS_BINARY_SEMAPHORE
+#define ATTR_DESC "binary/FIFO"
+
+#elif defined(TM36)
+const char rtems_test_name[] = "TIME TEST 36";
+#define SEMAPHORE_ATTRIBUTES (RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY)
+#define ATTR_DESC "binary/priority"
+
+#else
+#error "Unknown test configuration"
+#endif
+
rtems_id Semaphore_id;
rtems_task test_init(
@@ -72,7 +95,7 @@ rtems_task test_init(
status = rtems_semaphore_create(
rtems_build_name( 'S', 'M', '1', '\0'),
0,
- RTEMS_DEFAULT_ATTRIBUTES,
+ SEMAPHORE_ATTRIBUTES,
RTEMS_NO_PRIORITY,
&Semaphore_id
);
@@ -140,7 +163,7 @@ rtems_task High_task(
end_time = benchmark_timer_read();
put_time(
- "rtems_semaphore_release: task readied preempts caller",
+ "rtems_semaphore_release: " ATTR_DESC " task readied preempts caller",
end_time,
operation_count - 1,
0,
diff --git a/testsuites/tmtests/tm03/tm03.doc b/testsuites/tmtests/tm03/tm03.doc
index 32f2b2d6c2..3d1ea9d4ef 100644
--- a/testsuites/tmtests/tm03/tm03.doc
+++ b/testsuites/tmtests/tm03/tm03.doc
@@ -1,6 +1,5 @@
# COPYRIGHT (c) 1989-2014.
# On-Line Applications Research Corporation (OAR).
-# Cynthia Rempel <cynthia@rtems.org>
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
# http://www.rtems.org/license/LICENSE.
@@ -8,8 +7,8 @@
This test benchmarks the following operations:
- + rtems_semaphore_obtain
+ + rtems_semaphore_release: counting/FIFO task readied preempts caller
For more information
1. tmtests/include/timesys.h
-2. tmtests/README \ No newline at end of file
+2. tmtests/README