summaryrefslogtreecommitdiffstats
path: root/c/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/tests')
-rw-r--r--c/src/tests/configure.in10
-rw-r--r--c/src/tests/itrontests/Makefile.am21
-rw-r--r--c/src/tests/itrontests/README6
-rw-r--r--c/src/tests/itrontests/configure.in48
-rw-r--r--c/src/tests/itrontests/itronhello/init.c30
-rw-r--r--c/src/tests/itrontests/itronhello/system.h35
-rw-r--r--c/src/tests/itrontests/itronmbf01/init.c362
-rw-r--r--c/src/tests/itrontests/itronmbf01/system.h37
-rw-r--r--c/src/tests/itrontests/itronsem01/init.c328
-rw-r--r--c/src/tests/itrontests/itronsem01/system.h39
-rw-r--r--c/src/tests/itrontests/itrontask01/init.c72
-rw-r--r--c/src/tests/itrontests/itrontask01/system.h39
-rw-r--r--c/src/tests/samples/configure.in1
-rw-r--r--c/src/tests/tmitrontests/Makefile.am21
-rw-r--r--c/src/tests/tmitrontests/README6
-rw-r--r--c/src/tests/tmitrontests/configure.in45
-rw-r--r--c/src/tests/tmitrontests/include/Makefile.am9
-rw-r--r--c/src/tests/tmitrontests/include/timesys.h55
-rw-r--r--c/src/tests/tmitrontests/tmitronsem01/Makefile.in73
-rw-r--r--c/src/tests/tmitrontests/tmitronsem01/init.c141
-rw-r--r--c/src/tests/tmitrontests/tmitronsem01/system.h39
-rw-r--r--c/src/tests/tmitrontests/tmitronsem01/tmitronsem01.doc9
22 files changed, 1426 insertions, 0 deletions
diff --git a/c/src/tests/configure.in b/c/src/tests/configure.in
index 1b6e98e2fe..2c0212f7a2 100644
--- a/c/src/tests/configure.in
+++ b/c/src/tests/configure.in
@@ -14,6 +14,7 @@ AM_MAINTAINER_MODE
RTEMS_ENABLE_MULTIPROCESSING
RTEMS_ENABLE_POSIX
+RTEMS_ENABLE_ITRON
RTEMS_ENABLE_NETWORKING
RTEMS_ENABLE_INLINES
RTEMS_ENABLE_CXX
@@ -41,8 +42,10 @@ RTEMS_CANONICALIZE_TOOLS
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP)
RTEMS_CHECK_POSIX_API(RTEMS_BSP)
+RTEMS_CHECK_ITRON_API(RTEMS_BSP)
if test "$tests_enabled" = "yes"; then
+ # do functionality tests first, then performance tests
cfg_subdirs="libtests sptests"
if test "$HAS_MP" = "yes"; then
cfg_subdirs="$cfg_subdirs mptests"
@@ -50,7 +53,14 @@ if test "$tests_enabled" = "yes"; then
if test "$HAS_POSIX_API" = "yes"; then
cfg_subdirs="$cfg_subdirs psxtests"
fi
+ if test "$HAS_ITRON_API" = "yes"; then
+ cfg_subdirs="$cfg_subdirs itrontests tmitrontests"
+ fi
+ # Now do performance tests
cfg_subdirs="$cfg_subdirs tmtests"
+ if test "$HAS_ITRON_API" = "yes"; then
+ cfg_subdirs="$cfg_subdirs tmitrontests"
+ fi
fi
AC_SUBST(BARE_CPU_CFLAGS)
diff --git a/c/src/tests/itrontests/Makefile.am b/c/src/tests/itrontests/Makefile.am
new file mode 100644
index 0000000000..ff9e16ae5a
--- /dev/null
+++ b/c/src/tests/itrontests/Makefile.am
@@ -0,0 +1,21 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+project_bspdir = $(PROJECT_ROOT)/@RTEMS_BSP@
+
+PREINSTALLDIRS = $(project_bspdir)/tests/screens/psxtests
+$(PREINSTALLDIRS):
+ @$(mkinstalldirs) $@
+
+all-local: $(PREINSTALLDIRS)
+
+ITRON_DIRS = itronhello itrontask01 itronmbf01 itronsem01 itrontime01
+
+SUBDIRS = $(ITRON_DIRS)
+
+include $(top_srcdir)/../../../../automake/subdirs.am
+include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/tests/itrontests/README b/c/src/tests/itrontests/README
new file mode 100644
index 0000000000..65c5d4165d
--- /dev/null
+++ b/c/src/tests/itrontests/README
@@ -0,0 +1,6 @@
+#
+# $Id$
+#
+
+This directory contains the functionality tests for the ITRON 3.0 API
+implementation.
diff --git a/c/src/tests/itrontests/configure.in b/c/src/tests/itrontests/configure.in
new file mode 100644
index 0000000000..34301af2a1
--- /dev/null
+++ b/c/src/tests/itrontests/configure.in
@@ -0,0 +1,48 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id$
+
+AC_PREREQ(2.13)
+AC_INIT(itronhello)
+RTEMS_TOP(../../../..)
+AC_CONFIG_AUX_DIR(../../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-c-src-tests-itrontests,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+
+RTEMS_ENABLE_INLINES
+RTEMS_ENABLE_GCC28
+RTEMS_ENABLE_LIBCDIR
+RTEMS_ENABLE_BARE
+
+RTEMS_ENV_RTEMSBSP
+RTEMS_CHECK_CPU
+RTEMS_CANONICAL_HOST
+
+RTEMS_PROJECT_ROOT
+
+RTEMS_PROG_CC_FOR_TARGET
+
+RTEMS_CANONICALIZE_TOOLS
+
+RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
+
+AC_SUBST(RTEMS_USE_GCC272)
+AC_SUBST(BARE_CPU_CFLAGS)
+AC_SUBST(BARE_CPU_MODEL)
+AC_SUBST(CC_CFLAGS_DEFAULT)
+AC_SUBST(CC_CFLAGS_DEBUG_V)
+AC_SUBST(CC_CFLAGS_PROFILE_V)
+AC_SUBST(CC_LDFLAGS_PROFILE_V)
+
+# Try to explicitly list a Makefile here
+AC_OUTPUT(
+Makefile
+itronhello/Makefile
+itronmbf01/Makefile
+itronsem01/Makefile
+itrontask01/Makefile
+itrontime01/Makefile
+)
diff --git a/c/src/tests/itrontests/itronhello/init.c b/c/src/tests/itrontests/itronhello/init.c
new file mode 100644
index 0000000000..f2c079048c
--- /dev/null
+++ b/c/src/tests/itrontests/itronhello/init.c
@@ -0,0 +1,30 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#define TEST_INIT
+#include "system.h"
+#include <stdio.h>
+
+void ITRON_Init( void )
+{
+ printf( "\n\n*** ITRON HELLO WORLD TEST ***\n" );
+ printf( "Hello World\n" );
+ printf( "*** END OF ITRON HELLO WORLD TEST ***\n" );
+ exit( 0 );
+}
diff --git a/c/src/tests/itrontests/itronhello/system.h b/c/src/tests/itrontests/itronhello/system.h
new file mode 100644
index 0000000000..d7a30d195b
--- /dev/null
+++ b/c/src/tests/itrontests/itronhello/system.h
@@ -0,0 +1,35 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+
+/* functions */
+
+void ITRON_Init( void );
+
+/* configuration information */
+
+#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_ITRON_INIT_TASK_TABLE
+
+#include <confdefs.h>
+
+/* global variables */
+
+TEST_EXTERN rtems_id Global_variable; /* example global variable */
+
+/* end of include file */
diff --git a/c/src/tests/itrontests/itronmbf01/init.c b/c/src/tests/itrontests/itronmbf01/init.c
new file mode 100644
index 0000000000..39788c49f8
--- /dev/null
+++ b/c/src/tests/itrontests/itronmbf01/init.c
@@ -0,0 +1,362 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#define TEST_INIT
+#include "system.h"
+#include <stdio.h>
+#include <assert.h>
+
+/*
+ * The following is hopefully temporary.
+ */
+
+#include <time.h>
+
+#define put_time(_s) \
+do { \
+ time_t a_time_t; \
+ a_time_t = time( 0 ); \
+ printf( "%s%s", _s, ctime( &a_time_t ) ); \
+} while(0)
+
+
+
+void TestCre();
+void TestDel();
+void TestPsnd();
+void TestRef();
+void TestTrcv();
+void TestRcv();
+void TestPrcv();
+
+void ITRON_Init( void )
+{
+ printf( "\n\n*** ITRONMBF01 -- ITRON MESSAGE BUFFER TEST ***\n" );
+
+ TestCre();
+ TestDel();
+ TestPsnd();
+ TestRef();
+ TestRcv();
+ TestRef();
+ TestPrcv();
+ TestTrcv();
+
+ printf("\n\n*** ITRONMBF01 --- ITRON MESSAGE BUFFER TEST ***\n");
+ exit(0);
+}
+
+void TestCre()
+{
+ ER status;
+ T_CMBF pk_cmbf;
+
+ /*
+ * Exercise cre_mbf - this code seems to exercise every path.
+ */
+
+ puts( "Init - cre_mbf - NULL pk_cmbf returns E_PAR" );
+ status = cre_mbf( 1, NULL );
+ assert( status == E_PAR );
+
+ puts( "Init - cre_mbf - negative values for bufsz returns E_PAR" );
+ pk_cmbf.bufsz = -1;
+ pk_cmbf.maxmsz = 100;
+ status = cre_mbf( 1, &pk_cmbf );
+ assert( status == E_PAR );
+
+ puts( "Init - cre_mbf - negative values for maxmsz returns E_PAR" );
+ pk_cmbf.bufsz = 100;
+ pk_cmbf.maxmsz = -1;
+ status = cre_mbf( 1, &pk_cmbf );
+ assert( status == E_PAR );
+
+ puts( "Init - cre_mbf - bufsz < maxmsz returns E_PAR" );
+ pk_cmbf.bufsz = 100;
+ pk_cmbf.maxmsz = 101;
+ status = cre_mbf( 1, &pk_cmbf );
+ assert( status == E_PAR );
+
+ /*
+ * Now run through all the bad ID errors
+ */
+
+ pk_cmbf.bufsz = 200;
+ pk_cmbf.maxmsz = 30;
+ puts( "Init - cre_mbf - bad id (less than -4) - E_OACV" );
+ status = cre_mbf( -5, &pk_cmbf );
+ assert( status == E_OACV );
+
+ puts( "Init - cre_mbf - bad id (between 0 and -4) - E_ID" );
+ status = cre_mbf( -4, &pk_cmbf );
+ assert( status == E_ID );
+
+ puts( "Init - cre_mbf - bad id (0) - E_ID" );
+ status = cre_mbf( 0, &pk_cmbf );
+ assert( status == E_ID );
+
+ puts( "Init - cre_mbf - bad id (too great) - E_ID" );
+ status = cre_mbf( CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, &pk_cmbf );
+ assert( status == E_ID );
+
+ puts( "Init - cre_mbf - create mbf 1 TA_TFIFO - E_OK" );
+ pk_cmbf.bufsz = 600;
+ pk_cmbf.maxmsz = 200;
+ pk_cmbf.mbfatr = TA_TFIFO;
+ status = cre_mbf( 1, &pk_cmbf );
+ assert( status == E_OK );
+
+ puts( "Init - cre_mbf - create mbf 1 again - E_OBJ" );
+ status = cre_mbf( 1, &pk_cmbf );
+ assert( status == E_OBJ );
+
+ puts( "Init - cre_mbf - create mbf 2 TA_TPRI - E_OK" );
+ pk_cmbf.bufsz = 600;
+ pk_cmbf.maxmsz = 200;
+ pk_cmbf.mbfatr = TA_TPRI;
+ status = cre_mbf( 2, &pk_cmbf );
+ assert( status == E_OK );
+}
+
+void TestDel()
+{
+ ER status;
+
+ /*
+ * Generate all the bad id errors for del_mbf
+ */
+
+ puts( "Init - del_mbf - bad id (less than -4) - E_OACV" );
+ status = del_mbf( -5 );
+ assert( status == E_OACV );
+
+ puts( "Init - del_mbf - bad id (between 0 and -4) - E_ID" );
+ status = del_mbf( -4 );
+ assert( status == E_ID );
+
+ puts( "Init - del_mbf - bad id (0) - E_ID" );
+ status = del_mbf( 0 );
+ assert( status == E_ID );
+
+ puts( "Init - del_mbf - bad id (too great) - E_ID" );
+ status = del_mbf( CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1 );
+ assert( status == E_ID );
+
+
+ puts("Init - del_mbf - E_OK" );
+ status = del_mbf(2);
+ assert(status == E_OK);
+}
+
+void TestPsnd()
+{
+ ER status;
+ char msg[100] = "This is test message 1";
+
+ /*
+ * Generate all the bad id errors for psnd_mbf
+ */
+
+ puts( "Init - psnd_mbf - bad id (less than -4) - E_OACV" );
+ status = psnd_mbf(-5, msg, sizeof(msg));
+ assert( status == E_OACV );
+
+ puts( "Init - psnd_mbf - bad id (between 0 and -4) - E_ID" );
+ status = psnd_mbf(-4, msg, sizeof(msg));
+ assert( status == E_ID );
+
+ puts( "Init - psnd_mbf - bad id (0) - E_ID" );
+ status = psnd_mbf(0, msg, sizeof(msg));
+ assert( status == E_ID );
+
+ puts( "Init - psnd_mbf - bad id (too great) - E_ID" );
+ status = psnd_mbf(CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, msg,
+ sizeof(msg));
+ assert( status == E_ID );
+
+ puts( "Init - psnd_mbf - msg == 0, E_PAR" );
+ status = psnd_mbf(1, 0, sizeof(msg));
+ assert( status == E_PAR );
+
+ puts( "Init - psnd_mbf - msgsz too big - E_PAR" );
+ status = psnd_mbf(1, msg, 300);
+ assert( status == E_PAR );
+
+ puts( "Init - psnd_mbf - msgsz <0 - E_PAR" );
+ status = psnd_mbf(1, msg, -10);
+ assert( status == E_PAR );
+
+ puts( "Init - psnd_mbf - E_OK" );
+ status = psnd_mbf(1, msg, sizeof(msg));
+ assert( status == E_OK );
+}
+
+void TestRef()
+{
+ ER status;
+ T_RMBF pk_rmbf;
+
+ puts( "Init - ref_mbf - bad id (less than -4) - E_OACV" );
+ status = ref_mbf(&pk_rmbf, -5);
+ assert( status == E_OACV );
+
+ puts( "Init - ref_mbf - bad id (between 0 and -4) - E_ID" );
+ status = ref_mbf(&pk_rmbf, -4);
+ assert( status == E_ID );
+
+ puts( "Init - ref_mbf - bad id (0) - E_ID" );
+ status = ref_mbf(&pk_rmbf, 0);
+ assert( status == E_ID );
+
+ puts( "Init - ref_mbf - bad id (too great) - E_ID" );
+ status = ref_mbf(&pk_rmbf,
+ CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1);
+ assert( status == E_ID );
+
+ puts( "Init - ref_mbf - NULL pk_mbf returns E_PAR" );
+ status = ref_mbf( NULL, 1 );
+ assert( status == E_PAR );
+
+ puts( "Init - ref_mbf - mbf 1 - E_OK" );
+ status = ref_mbf( &pk_rmbf, 1 );
+ assert( status == E_OK );
+
+ printf( "Init - mbf 1 msgsz = %d\n", pk_rmbf.msgsz );
+ printf( "Init - mbf 1 frbufsz = %d\n", pk_rmbf.frbufsz );
+ printf( "Init - mbf 1 waiting tasks = %d\n", pk_rmbf.wtsk );
+ printf( "Init - mbf 1 sending tasks = %d\n", pk_rmbf.stsk);
+}
+
+void TestRcv()
+{
+ ER status;
+ char buffer[200];
+ int s;
+
+ puts( "Init - rcv_mbf - bad id (less than -4) - E_OACV" );
+ status = rcv_mbf(buffer, &s, -5);
+ assert( status == E_OACV );
+
+ puts( "Init - rcv_mbf - bad id (between 0 and -4) - E_ID" );
+ status = rcv_mbf(buffer, &s, -4);
+ assert( status == E_ID );
+
+ puts( "Init - rcv_mbf - bad id (0) - E_ID" );
+ status = rcv_mbf(buffer, &s, 0);
+ assert( status == E_ID );
+
+ puts( "Init - rcv_mbf - bad id (too great) - E_ID" );
+ status = rcv_mbf(buffer, &s, CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1);
+ assert( status == E_ID );
+
+ puts( "Init - rcv_mbf - NULL msg returns E_PAR" );
+ status = rcv_mbf(NULL, &s, 1);
+ assert( status == E_PAR );
+
+ puts( "Init - rcv_mbf - NULL p_msgsz returns E_PAR" );
+ status = rcv_mbf(buffer, 0, 1);
+ assert( status == E_PAR );
+
+ puts("Init - rcv_mbf -- OK");
+ status = rcv_mbf(buffer, &s, 1);
+ assert(status == E_OK);
+ printf("Message:[%s], length:%d\n", buffer, s);
+}
+
+
+void TestPrcv()
+{
+ ER status;
+ char buffer[200];
+ int s;
+
+ puts( "Init - prcv_mbf - bad id (less than -4) - E_OACV" );
+ status = prcv_mbf(buffer, &s, -5);
+ assert( status == E_OACV );
+
+ puts( "Init - prcv_mbf - bad id (between 0 and -4) - E_ID" );
+ status = prcv_mbf(buffer, &s, -4);
+ assert( status == E_ID );
+
+ puts( "Init - prcv_mbf - bad id (0) - E_ID" );
+ status = prcv_mbf(buffer, &s, 0);
+ assert( status == E_ID );
+
+ puts( "Init - prcv_mbf - bad id (too great) - E_ID" );
+ status = prcv_mbf(buffer, &s, CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1);
+ assert( status == E_ID );
+
+ puts( "Init - prcv_mbf - NULL msg returns E_PAR" );
+ status = prcv_mbf(NULL, &s, 1);
+ assert( status == E_PAR );
+
+ puts( "Init - prcv_mbf - NULL p_msgsz returns E_PAR" );
+ status = prcv_mbf(buffer, 0, 1);
+ assert( status == E_PAR );
+
+ puts("Init - prcv_mbf -- E_TMOUT");
+ status = prcv_mbf(buffer, &s, 1);
+ assert(status == E_TMOUT);
+}
+
+
+void TestTrcv()
+{
+ ER status;
+ char buffer[200];
+ int s;
+
+ puts( "Init - trcv_mbf - bad id (less than -4) - E_OACV" );
+ status = trcv_mbf(buffer, &s, -5, 5000);
+ assert( status == E_OACV );
+
+ puts( "Init - trcv_mbf - bad id (between 0 and -4) - E_ID" );
+ status = trcv_mbf(buffer, &s, -4, 5000);
+ assert( status == E_ID );
+
+ puts( "Init - trcv_mbf - bad id (0) - E_ID" );
+ status = trcv_mbf(buffer, &s, 0, 5000);
+ assert( status == E_ID );
+
+ puts( "Init - trcv_mbf - bad id (too great) - E_ID" );
+ status = trcv_mbf(buffer, &s,
+ CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1,
+ 5000);
+ assert( status == E_ID );
+
+ puts( "Init - trcv_mbf - NULL msg returns E_PAR" );
+ status = trcv_mbf(NULL, &s, 1, 5000);
+ assert( status == E_PAR );
+
+ puts( "Init - trcv_mbf - NULL p_msgsz returns E_PAR" );
+ status = trcv_mbf(buffer, 0, 1, 5000);
+ assert( status == E_PAR );
+
+ puts( "Init - trcv_mbf - tmout <-2 returns E_PAR" );
+ status = trcv_mbf(buffer, &s, 1, -2);
+ assert( status == E_PAR );
+
+ puts("\nInit - trcv_mbf -- E_TMOUT");
+ put_time( "Init - starting to block at ");
+ status = trcv_mbf(buffer, &s, 1, 1000);
+ assert(status == E_TMOUT);
+ put_time( "Init - time out at ");
+}
+
+
diff --git a/c/src/tests/itrontests/itronmbf01/system.h b/c/src/tests/itrontests/itronmbf01/system.h
new file mode 100644
index 0000000000..b433415b2b
--- /dev/null
+++ b/c/src/tests/itrontests/itronmbf01/system.h
@@ -0,0 +1,37 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+
+/* functions */
+
+void ITRON_Init( void );
+
+/* configuration information */
+
+#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_ITRON_INIT_TASK_TABLE
+#define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 10
+
+#include <confdefs.h>
+
+/* global variables */
+
+TEST_EXTERN rtems_id Global_variable; /* example global variable */
+
+/* end of include file */
diff --git a/c/src/tests/itrontests/itronsem01/init.c b/c/src/tests/itrontests/itronsem01/init.c
new file mode 100644
index 0000000000..4748de7f45
--- /dev/null
+++ b/c/src/tests/itrontests/itronsem01/init.c
@@ -0,0 +1,328 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#define TEST_INIT
+#include "system.h"
+#include <stdio.h>
+
+/*
+ * The following is hopefully temporary.
+ */
+
+#include <time.h>
+
+#define put_time(_s) \
+ do { \
+ time_t a_time_t; \
+ a_time_t = time( 0 ); \
+ printf( "%s%s", _s, ctime( &a_time_t ) ); \
+ } while(0)
+
+void ITRON_Init( void )
+{
+ ER status;
+ T_CSEM pk_csem;
+ T_RSEM pk_rsem;
+
+ printf( "\n\n*** ITRONSEM01 -- ITRON SEMAPHORE TEST ***\n" );
+
+ /*
+ * Exercise cre_sem - this code seems to exercise every path.
+ */
+
+ puts( "Init - cre_sem - NULL pk_sem returns E_PAR" );
+ status = cre_sem( 1, NULL );
+ assert( status == E_PAR );
+
+ puts( "Init - cre_sem - isemcnt > maxsem returns E_PAR" );
+ pk_csem.isemcnt = 3;
+ pk_csem.maxsem = 2;
+ status = cre_sem( 1, &pk_csem );
+ assert( status == E_PAR );
+
+ puts( "Init - cre_sem - maxsem of 0 returns E_PAR" );
+ pk_csem.isemcnt = 0;
+ pk_csem.maxsem = 0;
+ status = cre_sem( 1, &pk_csem );
+ assert( status == E_PAR );
+
+ /*
+ * Now run through all the bad ID errors
+ */
+
+ pk_csem.isemcnt = 2;
+ pk_csem.maxsem = 3;
+ puts( "Init - cre_sem - bad id (less than -4) - E_OACV" );
+ status = cre_sem( -5, &pk_csem );
+ assert( status == E_OACV );
+
+ puts( "Init - cre_sem - bad id (between 0 and -4) - E_ID" );
+ status = cre_sem( -4, &pk_csem );
+ assert( status == E_ID );
+
+ puts( "Init - cre_sem - bad id (0) - E_ID" );
+ status = cre_sem( 0, &pk_csem );
+ assert( status == E_ID );
+
+ puts( "Init - cre_sem - bad id (too great) - E_ID" );
+ status = cre_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1, &pk_csem );
+ assert( status == E_ID );
+
+ puts( "Init - cre_sem - create semaphore 1 TA_TFIFO - E_OK" );
+ pk_csem.isemcnt = 2;
+ pk_csem.maxsem = 3;
+ pk_csem.sematr = TA_TFIFO;
+ status = cre_sem( 1, &pk_csem );
+ assert( status == E_OK );
+
+ puts( "Init - cre_sem - create semaphore 1 again - E_OBJ" );
+ status = cre_sem( 1, &pk_csem );
+ assert( status == E_OBJ );
+
+ puts( "Init - cre_sem - create semaphore 2 TA_TPRI - E_OK" );
+ pk_csem.isemcnt = 2;
+ pk_csem.maxsem = 3;
+ pk_csem.sematr = TA_TPRI;
+ status = cre_sem( 2, &pk_csem );
+ assert( status == E_OK );
+
+ /*
+ * Generate all the bad id errors for del_sem
+ */
+
+ puts( "Init - del_sem - bad id (less than -4) - E_OACV" );
+ status = del_sem( -5 );
+ assert( status == E_OACV );
+
+ puts( "Init - del_sem - bad id (between 0 and -4) - E_ID" );
+ status = del_sem( -4 );
+ assert( status == E_ID );
+
+ puts( "Init - del_sem - bad id (0) - E_ID" );
+ status = del_sem( 0 );
+ assert( status == E_ID );
+
+ puts( "Init - del_sem - bad id (too great) - E_ID" );
+ status = del_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 );
+ assert( status == E_ID );
+
+ /*
+ * Generate all the bad id errors for sig_sem
+ */
+
+ puts( "Init - sig_sem - bad id (less than -4) - E_OACV" );
+ status = sig_sem( -5 );
+ assert( status == E_OACV );
+
+ puts( "Init - sig_sem - bad id (between 0 and -4) - E_ID" );
+ status = sig_sem( -4 );
+ assert( status == E_ID );
+
+ puts( "Init - sig_sem - bad id (0) - E_ID" );
+ status = sig_sem( 0 );
+ assert( status == E_ID );
+
+ puts( "Init - sig_sem - bad id (too great) - E_ID" );
+ status = wai_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 );
+ assert( status == E_ID );
+
+ /*
+ * Generate all the bad id errors for preq_sem
+ */
+
+ puts( "Init - preq_sem - bad id (less than -4) - E_OACV" );
+ status = preq_sem( -5 );
+ assert( status == E_OACV );
+
+ puts( "Init - preq_sem - bad id (between 0 and -4) - E_ID" );
+ status = preq_sem( -4 );
+ assert( status == E_ID );
+
+ puts( "Init - preq_sem - bad id (0) - E_ID" );
+ status = preq_sem( 0 );
+ assert( status == E_ID );
+
+ puts( "Init - preq_sem - bad id (too great) - E_ID" );
+ status = preq_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 );
+ assert( status == E_ID );
+
+ /*
+ * Generate all the bad id errors for wai_sem
+ */
+
+ puts( "Init - wai_sem - bad id (less than -4) - E_OACV" );
+ status = wai_sem( -5 );
+ assert( status == E_OACV );
+
+ puts( "Init - wai_sem - bad id (between 0 and -4) - E_ID" );
+ status = wai_sem( -4 );
+ assert( status == E_ID );
+
+ puts( "Init - wai_sem - bad id (0) - E_ID" );
+ status = wai_sem( 0 );
+ assert( status == E_ID );
+
+ puts( "Init - wai_sem - bad id (too great) - E_ID" );
+ status = wai_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 );
+ assert( status == E_ID );
+
+ /*
+ * Generate all the bad id errors for twai_sem
+ */
+
+ puts( "Init - twai_sem - bad id (less than -4) - E_OACV" );
+ status = twai_sem( -5, 1000 );
+ assert( status == E_OACV );
+
+ puts( "Init - twai_sem - bad id (between 0 and -4) - E_ID" );
+ status = twai_sem( -4, 1000 );
+ assert( status == E_ID );
+
+ puts( "Init - twai_sem - bad id (0) - E_ID" );
+ status = twai_sem( 0, 1000 );
+ assert( status == E_ID );
+
+ puts( "Init - twai_sem - bad id (too great) - E_ID" );
+ status = twai_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1, 1000 );
+ assert( status == E_ID );
+
+ /*
+ * Generate all the bad id errors for ref_sem
+ */
+
+ puts( "Init - ref_sem - bad id (less than -4) - E_OACV" );
+ status = ref_sem( -5, &pk_rsem );
+ assert( status == E_OACV );
+
+ puts( "Init - ref_sem - bad id (between 0 and -4) - E_ID" );
+ status = ref_sem( -4, &pk_rsem );
+ assert( status == E_ID );
+
+ puts( "Init - ref_sem - bad id (0) - E_ID" );
+ status = ref_sem( 0, &pk_rsem );
+ assert( status == E_ID );
+
+ puts( "Init - ref_sem - bad id (too great) - E_ID" );
+ status = ref_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1, &pk_rsem );
+ assert( status == E_ID );
+
+ /*
+ * Exercise preq_sem (and sig_sem a little)
+ */
+
+
+ puts( "Init - preq_sem - semaphore 1 available (count --> 1) - E_OK" );
+ status = preq_sem( 1 );
+ assert( status == E_OK );
+
+ puts( "Init - preq_sem - semaphore 1 available (count --> 0) - E_OK" );
+ status = preq_sem( 1 );
+ assert( status == E_OK );
+
+ puts( "Init - preq_sem - semaphore 1 unavailable - E_TMOUT" );
+ status = preq_sem( 1 );
+ assert( status == E_TMOUT );
+
+ puts( "Init - sig_sem - semaphore 1 (count --> 1) - E_OK" );
+ status = sig_sem( 1 );
+ assert( status == E_OK );
+
+ puts("Init - twai_sem(TMO_POL) - semaphore 1 available (count --> 0) - E_OK");
+ status = twai_sem( 1, TMO_POL );
+ assert( status == E_OK );
+
+ puts( "Init - twai_sem(TMO_POL) - semaphore 1 available - E_TMOUT" );
+ status = twai_sem( 1, TMO_POL );
+ assert( status == E_TMOUT );
+
+ /*
+ * Exercise twai_sem
+ */
+
+ puts( "Init - twai_sem - semaphore 1 unavailable - 1 second E_TMOUT" );
+ put_time( "Init - starting to block at ");
+ status = twai_sem( 1, 1000 );
+ assert( status == E_TMOUT );
+ put_time( "Init - timed out at ");
+ puts( "Init - twai_sem - semaphore 1 unavailable - timeout completed" );
+
+ /*
+ * Now let's test exceed the maximum count of semaphore 1
+ */
+
+ puts( "Init - sig_sem - semaphore 1 (count --> 1) - E_OK" );
+ status = sig_sem( 1 );
+ assert( status == E_OK );
+
+ puts( "Init - sig_sem - semaphore 1 (count --> 2) - E_OK" );
+ status = sig_sem( 1 );
+ assert( status == E_OK );
+
+ puts( "Init - sig_sem - semaphore 1 (count --> 3) - E_OK" );
+ status = sig_sem( 1 );
+ assert( status == E_OK );
+
+ puts( "Init - sig_sem - semaphore 1 (count > maximum) - E_QOVR" );
+ status = sig_sem( 1 );
+ assert( status == E_OK );
+
+ /*
+ * Exercise ref_sem
+ */
+
+ puts( "Init - ref_sem - NULL pk_sem returns E_PAR" );
+ status = ref_sem( 1, NULL );
+ assert( status == E_PAR );
+
+ puts( "Init - ref_sem - semaphore 1 - E_OK" );
+ status = ref_sem( 1, &pk_rsem );
+ assert( status == E_OK );
+ printf( "Init - semaphore 1 count = %d\n", pk_rsem.semcnt );
+ printf( "Init - semaphore 1 waiting tasks = %d\n", pk_rsem.wtsk );
+
+ puts( "Init - preq_sem - semaphore 1 (count --> 2) - E_OK" );
+ status = preq_sem( 1 );
+ assert( status == E_OK );
+
+ puts( "Init - ref_sem - semaphore 1 - E_OK" );
+ status = ref_sem( 1, &pk_rsem );
+ assert( status == E_OK );
+ printf( "Init - semaphore 1 count = %d\n", pk_rsem.semcnt );
+ printf( "Init - semaphore 1 waiting tasks = %d\n", pk_rsem.wtsk );
+
+
+ /*
+ * Exercise del_sem
+ */
+
+ /* XXX really want another task blocking on the semaphore XXX */
+
+ puts( "Init - del_sem - semaphore 1 deleted - E_OK" );
+ status = del_sem( 1 );
+ assert( status == E_OK );
+
+ puts( "Init - XXX need other tasks to complete the test XXX" );
+
+ puts( "Init - dly_tsk - 1 second to let other task run" );
+ status = dly_tsk( 1000 );
+ assert( status == E_OK );
+
+ printf( "*** END OF ITRONSEM01 -- ITRON SEMAPHORE TEST ***\n" );
+ exit( 0 );
+}
diff --git a/c/src/tests/itrontests/itronsem01/system.h b/c/src/tests/itrontests/itronsem01/system.h
new file mode 100644
index 0000000000..e3eac6012f
--- /dev/null
+++ b/c/src/tests/itrontests/itronsem01/system.h
@@ -0,0 +1,39 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include <itron.h>
+#include <assert.h>
+
+/* functions */
+
+void ITRON_Init( void );
+
+/* configuration information */
+
+#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_ITRON_INIT_TASK_TABLE
+#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 10
+
+#include <confdefs.h>
+
+/* global variables */
+
+TEST_EXTERN rtems_id Global_variable; /* example global variable */
+
+/* end of include file */
diff --git a/c/src/tests/itrontests/itrontask01/init.c b/c/src/tests/itrontests/itrontask01/init.c
new file mode 100644
index 0000000000..3b36e2e9ec
--- /dev/null
+++ b/c/src/tests/itrontests/itrontask01/init.c
@@ -0,0 +1,72 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function. This test is based off of sp01.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+
+#define TEST_INIT
+#include "system.h"
+
+#warning "Task_id is really an rtems_id"
+void Task_1_through_3( void ){}
+
+void ITRON_Init( void )
+{
+ rtems_time_of_day time;
+ ER status;
+ T_CTSK values;
+
+ puts( "\n\n*** ITRONTASK01 - TICKER TEST ***" );
+
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+
+ values.exinf = NULL;
+ values.tskatr = TA_HLNG;
+ values.task = Task_1_through_3;
+ values.itskpri = 1;
+ values.stksz = RTEMS_MINIMUM_STACK_SIZE;
+
+ status = cre_tsk( Task_id[1], &values );
+ directive_failed( status, "cre_tsk of TA1" );
+
+ values.stksz = RTEMS_MINIMUM_STACK_SIZE;
+ status = cre_tsk( Task_id[2], &values );
+ directive_failed( status, "cre_tsk of TA1" );
+
+ values.stksz = RTEMS_MINIMUM_STACK_SIZE;
+ status = cre_tsk( Task_id[3], &values );
+ directive_failed( status, "cre_tsk of TA1" );
+
+#if 0
+ status = sta_tsk( Task_id[1] );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+#endif
+}
diff --git a/c/src/tests/itrontests/itrontask01/system.h b/c/src/tests/itrontests/itrontask01/system.h
new file mode 100644
index 0000000000..8a5b4ad378
--- /dev/null
+++ b/c/src/tests/itrontests/itrontask01/system.h
@@ -0,0 +1,39 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include <itron.h>
+
+/* functions */
+
+void ITRON_Init( void );
+
+/* configuration information */
+
+#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_ITRON_INIT_TASK_TABLE
+
+#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
+
+#include <confdefs.h>
+
+/* global variables */
+
+TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
+
+/* end of include file */
diff --git a/c/src/tests/samples/configure.in b/c/src/tests/samples/configure.in
index fd2705cc0e..da5f09b402 100644
--- a/c/src/tests/samples/configure.in
+++ b/c/src/tests/samples/configure.in
@@ -14,6 +14,7 @@ AM_MAINTAINER_MODE
RTEMS_ENABLE_MULTIPROCESSING
RTEMS_ENABLE_POSIX
+RTEMS_ENABLE_ITRON
RTEMS_ENABLE_NETWORKING
RTEMS_ENABLE_INLINES
RTEMS_ENABLE_CXX
diff --git a/c/src/tests/tmitrontests/Makefile.am b/c/src/tests/tmitrontests/Makefile.am
new file mode 100644
index 0000000000..3b10073729
--- /dev/null
+++ b/c/src/tests/tmitrontests/Makefile.am
@@ -0,0 +1,21 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+project_bspdir = $(PROJECT_ROOT)/@RTEMS_BSP@
+
+PREINSTALLDIRS = $(project_bspdir)/tests/screens/psxtests
+$(PREINSTALLDIRS):
+ @$(mkinstalldirs) $@
+
+all-local: $(PREINSTALLDIRS)
+
+ITRON_DIRS = include tmitronsem01
+
+SUBDIRS = $(ITRON_DIRS)
+
+include $(top_srcdir)/../../../../automake/subdirs.am
+include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/tests/tmitrontests/README b/c/src/tests/tmitrontests/README
new file mode 100644
index 0000000000..65c5d4165d
--- /dev/null
+++ b/c/src/tests/tmitrontests/README
@@ -0,0 +1,6 @@
+#
+# $Id$
+#
+
+This directory contains the functionality tests for the ITRON 3.0 API
+implementation.
diff --git a/c/src/tests/tmitrontests/configure.in b/c/src/tests/tmitrontests/configure.in
new file mode 100644
index 0000000000..28da189e75
--- /dev/null
+++ b/c/src/tests/tmitrontests/configure.in
@@ -0,0 +1,45 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id$
+
+AC_PREREQ(2.13)
+AC_INIT(tmitronsem01)
+RTEMS_TOP(../../../..)
+AC_CONFIG_AUX_DIR(../../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-c-src-tests-tmitrontests,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+
+RTEMS_ENABLE_INLINES
+RTEMS_ENABLE_GCC28
+RTEMS_ENABLE_LIBCDIR
+RTEMS_ENABLE_BARE
+
+RTEMS_ENV_RTEMSBSP
+RTEMS_CHECK_CPU
+RTEMS_CANONICAL_HOST
+
+RTEMS_PROJECT_ROOT
+
+RTEMS_PROG_CC_FOR_TARGET
+
+RTEMS_CANONICALIZE_TOOLS
+
+RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
+
+AC_SUBST(RTEMS_USE_GCC272)
+AC_SUBST(BARE_CPU_CFLAGS)
+AC_SUBST(BARE_CPU_MODEL)
+AC_SUBST(CC_CFLAGS_DEFAULT)
+AC_SUBST(CC_CFLAGS_DEBUG_V)
+AC_SUBST(CC_CFLAGS_PROFILE_V)
+AC_SUBST(CC_LDFLAGS_PROFILE_V)
+
+# Try to explicitly list a Makefile here
+AC_OUTPUT(
+Makefile
+include/Makefile
+tmitronsem01/Makefile
+)
diff --git a/c/src/tests/tmitrontests/include/Makefile.am b/c/src/tests/tmitrontests/include/Makefile.am
new file mode 100644
index 0000000000..fcf88cb578
--- /dev/null
+++ b/c/src/tests/tmitrontests/include/Makefile.am
@@ -0,0 +1,9 @@
+##
+## $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+noinst_HEADERS = timesys.h
+
+include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/tests/tmitrontests/include/timesys.h b/c/src/tests/tmitrontests/include/timesys.h
new file mode 100644
index 0000000000..4f75a9abf2
--- /dev/null
+++ b/c/src/tests/tmitrontests/include/timesys.h
@@ -0,0 +1,55 @@
+/* timesys.h
+ *
+ * This header file contains the global variables for the Time
+ * suite.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+
+/*
+ * How many times a particular operation is performed while timed.
+ */
+
+#define OPERATION_COUNT 100
+#define IT_COUNT 100
+
+/* functions */
+
+#define put_time( _message, _total_time, \
+ _iterations, _loop_overhead, _overhead ) \
+ printf( \
+ "%s %d\n", \
+ (_message), \
+ (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \
+ )
+
+#if defined(STACK_CHECKER_ON) || defined(RTEMS_DEBUG)
+#define Print_Warning() \
+ do { \
+ puts( \
+ "\n" \
+ "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \
+ "\n" \
+ ); \
+ } while (0)
+
+#else
+#define Print_Warning()
+#endif
+
+/* variables */
+
+TEST_EXTERN volatile unsigned32 end_time; /* ending time variable */
+TEST_EXTERN volatile unsigned32 overhead; /* loop overhead variable */
+
+/* end of include file */
diff --git a/c/src/tests/tmitrontests/tmitronsem01/Makefile.in b/c/src/tests/tmitrontests/tmitronsem01/Makefile.in
new file mode 100644
index 0000000000..8777928c69
--- /dev/null
+++ b/c/src/tests/tmitrontests/tmitronsem01/Makefile.in
@@ -0,0 +1,73 @@
+#
+# $Id$
+#
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+subdir = tmitronsem01
+
+RTEMS_ROOT = @RTEMS_ROOT@
+PROJECT_ROOT = @PROJECT_ROOT@
+
+VPATH = @srcdir@
+
+TEST = tmitronsem01
+
+MANAGERS = all
+
+# C source names, if any, go here -- minus the .c
+C_PIECES = init
+C_FILES = $(C_PIECES:%=%.c)
+C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
+
+H_FILES = system.h
+
+DOCTYPES = doc
+DOCS = $(DOCTYPES:%=$(TEST).%)
+
+SRCS = $(DOCS) $(C_FILES) $(H_FILES)
+OBJS = $(C_O_FILES)
+
+PRINT_SRCS = $(DOCS)
+
+PGM = ${ARCH}/$(TEST).exe
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(RTEMS_ROOT)/make/leaf.cfg
+
+INSTALL_CHANGE = @INSTALL_CHANGE@
+PACKHEX = @PACKHEX@
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+DEFINES +=
+CPPFLAGS += -I$(srcdir)/../include
+CFLAGS +=
+
+LD_PATHS +=
+LD_LIBS +=
+LDFLAGS +=
+
+#
+# Add your list of files to delete here. The config files
+# already know how to delete some stuff, so you may want
+# to just run 'make clean' first to see what gets missed.
+# 'make clobber' already includes 'make clean'
+#
+
+CLEAN_ADDITIONS +=
+CLOBBER_ADDITIONS +=
+
+all: ${ARCH} $(SRCS) $(PGM)
+ @$(INSTALL_VARIANT) -m 755 ${PGM} $(PROJECT_RELEASE)/tests
+
+${PGM}: $(OBJS) $(LINK_FILES)
+ $(make-exe)
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/c/src/tests/tmitrontests/tmitronsem01/init.c b/c/src/tests/tmitrontests/tmitronsem01/init.c
new file mode 100644
index 0000000000..396d45d04b
--- /dev/null
+++ b/c/src/tests/tmitrontests/tmitronsem01/init.c
@@ -0,0 +1,141 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#define TEST_INIT
+#include "system.h"
+#include <timesys.h>
+#include <stdio.h>
+
+void ITRON_Init( void )
+{
+ T_CSEM pk_csem;
+ T_RSEM pk_rsem;
+ int index;
+
+ pk_csem.isemcnt = 2;
+ pk_csem.maxsem = 3;
+ pk_csem.sematr = TA_TFIFO;
+
+ printf( "\n\n*** TMITRON01 -- ITRON TIMING TEST ***\n" );
+
+ /*
+ * time one invocation of cre_sem
+ */
+
+ Timer_initialize();
+ (void) cre_sem( 1, &pk_csem );
+ end_time = Read_timer();
+ put_time(
+ "cre_sem",
+ end_time,
+ 1,
+ 0, /* no loop overhead to take out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time one invocation of del_sem
+ */
+
+ Timer_initialize();
+ (void) del_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "del_sem",
+ end_time,
+ 1,
+ 0, /* no loop overhead to take out */
+ 0 /* no calling overhead */
+ );
+
+ pk_csem.isemcnt = 100;
+ pk_csem.maxsem = 100;
+ pk_csem.sematr = TA_TFIFO;
+ (void) cre_sem( 1, &pk_csem );
+
+ /*
+ * time preq_sem (available)
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) preq_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "preq_sem (available)",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time preq_sem (not available)
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) preq_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "preq_sem (not available)",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time sig_sem (no waiting tasks)
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) sig_sem( 1 );
+ end_time = Read_timer();
+ put_time(
+ "sig_sem (no waiting tasks)",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ /*
+ * time ref_sem
+ */
+
+ Timer_initialize();
+ for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
+ (void) ref_sem( 1, &pk_rsem );
+ end_time = Read_timer();
+ put_time(
+ "ref_sem",
+ end_time,
+ OPERATION_COUNT,
+ 0, /* don't take the loop overhead out */
+ 0 /* no calling overhead */
+ );
+
+ printf( "\n\nXXX ADD BLOCKING AND PREEMPTING TIME TESTS\n\n" );
+
+
+ printf( "*** END OF TMITRON01 -- ITRON TIMING TEST ***\n" );
+ exit( 0 );
+}
diff --git a/c/src/tests/tmitrontests/tmitronsem01/system.h b/c/src/tests/tmitrontests/tmitronsem01/system.h
new file mode 100644
index 0000000000..0537ae527a
--- /dev/null
+++ b/c/src/tests/tmitrontests/tmitronsem01/system.h
@@ -0,0 +1,39 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include <itron.h>
+#include <assert.h>
+
+/* functions */
+
+void ITRON_Init( void );
+
+/* configuration information */
+
+#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
+#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_ITRON_INIT_TASK_TABLE
+#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 100
+
+#include <confdefs.h>
+
+/* global variables */
+
+TEST_EXTERN rtems_id Global_variable; /* example global variable */
+
+/* end of include file */
diff --git a/c/src/tests/tmitrontests/tmitronsem01/tmitronsem01.doc b/c/src/tests/tmitrontests/tmitronsem01/tmitronsem01.doc
new file mode 100644
index 0000000000..558f0594c8
--- /dev/null
+++ b/c/src/tests/tmitrontests/tmitronsem01/tmitronsem01.doc
@@ -0,0 +1,9 @@
+#
+# $Id$
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.OARcorp.com/rtems/license.html.
+#
+
+Time some basic ITRON semaphore operations