Merged tests from Task group.

This commit is contained in:
Joel Sherrill
1999-11-09 23:27:05 +00:00
parent 3d67661f9d
commit e099180999
66 changed files with 3584 additions and 76 deletions
@@ -0,0 +1,13 @@
#
# $Id$
#
# 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.
#
@@ -0,0 +1,3 @@
*** HELLO WORLD TEST ***
Hello World
*** END OF HELLO WORLD TEST ***
@@ -0,0 +1,13 @@
#
# $Id$
#
# 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.
#
@@ -0,0 +1,3 @@
*** HELLO WORLD TEST ***
Hello World
*** END OF HELLO WORLD TEST ***
@@ -0,0 +1,13 @@
#
# $Id$
#
# 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.
#
@@ -0,0 +1,3 @@
*** HELLO WORLD TEST ***
Hello World
*** END OF HELLO WORLD TEST ***
@@ -0,0 +1,74 @@
#
# $Id$
#
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ..
subdir = itrontask01
RTEMS_ROOT = @RTEMS_ROOT@
PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@
TEST = itrontask01
PGM = ${ARCH}/$(TEST).exe
MANAGERS = all
# C source names, if any, go here -- minus the .c
C_PIECES = init task1
C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
H_FILES = system.h
DOCTYPES = doc scn
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 +=
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
+29 -33
View File
@@ -1,19 +1,15 @@
/* Init
*
* This routine is the initialization task for this test program.
* It is a user initialization task and has the responsibility for creating
* 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. This test is based off of sp01.
* value by this function.
*
* 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.
@@ -21,52 +17,52 @@
* $Id$
*/
#define TEST_INIT
#include "system.h"
#warning "Task_id is really an rtems_id"
void Task_1_through_3( void ){}
#include <stdio.h>
void ITRON_Init( void )
{
rtems_time_of_day time;
ER status;
T_CTSK values;
T_CTSK pk_ctsk;
puts( "\n\n*** ITRONTASK01 - TICKER TEST ***" );
puts( "\n\n*** ITRON TEST 3 ***" );
/*
* XXX - Change this to an itron clock !!
*/
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;
pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.itskpri = 1;
pk_ctsk.task = Task_2_through_4;
status = cre_tsk( Task_id[1], &values );
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
status = cre_tsk( 2, &pk_ctsk );
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" );
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2;
status = cre_tsk( 3, &pk_ctsk );
directive_failed( status, "cre_tsk of TA2" );
values.stksz = RTEMS_MINIMUM_STACK_SIZE;
status = cre_tsk( Task_id[3], &values );
directive_failed( status, "cre_tsk of TA1" );
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3;
status = cre_tsk( 4, &pk_ctsk );
directive_failed( status, "cre_tsk of TA3" );
#if 0
status = sta_tsk( Task_id[1] );
directive_failed( status, "rtems_task_start of TA1" );
status = sta_tsk( 2, 0 );
directive_failed( status, "sta_tsk of TA1" );
directive_failed( status, "rtems_task_start of TA2" );
status = sta_tsk( 3, 0 );
directive_failed( status, "sta_tsk of TA1" );
status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
directive_failed( status, "rtems_task_start of TA3" );
status = sta_tsk( 4, 0 );
directive_failed( status, "sta_tsk of TA1" );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
#endif
exd_tsk();
directive_failed( 0, "exd_tsk" );
}
@@ -0,0 +1,60 @@
#
# $Id$
#
# 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.
#
This file describes the directives and concepts tested by this test set.
This test is based upon the test in sp01.
test set name: test1
directives:
cre_tsk, sta_tsk, exd_tsk, get_tid
ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
tm_set, tm_get, tm_wkafter
concepts: XXX verify
a. Verifies system can create and start both the executive's system
initialization and idle task.
b. Verifies executive can swap between three application tasks at the
same priority and the executive's internal idle task.
c. Verifies can print strings to the CRT on port 2 of the mvme136 board
using Print and Println in the board support package.
d. Verifies interrupt handler can handle a task switch from an interrupt
as specified with the i_return directive.
e. Verifies executive initialization performed correctly.
f. Verifies the executive trap handler except for the halt function.
g. Verifies that a task can get the task identification number of itself.
notes:
rtems clock directives should change to itron clock directives when
the clock directives are merged.
change rtems task wake after to itron routines.
output:
"TA1" is printed once every 5 seconds.
"TA2" is printed once every 10 seconds.
"TA3" is printed once every 15 seconds.
@@ -0,0 +1,16 @@
*** ITRON TEST 3 ***
TA1 - rtems_clock_get - 09:00:00 12/31/1988
TA2 - rtems_clock_get - 09:00:00 12/31/1988
TA3 - rtems_clock_get - 09:00:00 12/31/1988
TA1 - rtems_clock_get - 09:00:05 12/31/1988
TA2 - rtems_clock_get - 09:00:10 12/31/1988
TA1 - rtems_clock_get - 09:00:10 12/31/1988
TA3 - rtems_clock_get - 09:00:15 12/31/1988
TA1 - rtems_clock_get - 09:00:15 12/31/1988
TA2 - rtems_clock_get - 09:00:20 12/31/1988
TA1 - rtems_clock_get - 09:00:20 12/31/1988
TA1 - rtems_clock_get - 09:00:25 12/31/1988
TA3 - rtems_clock_get - 09:00:30 12/31/1988
TA2 - rtems_clock_get - 09:00:30 12/31/1988
TA1 - rtems_clock_get - 09:00:30 12/31/1988
*** END OF ITRON TEST 3 ***
+4 -5
View File
@@ -15,11 +15,11 @@
*/
#include <tmacros.h>
#include <itron.h>
/* functions */
void ITRON_Init( void );
void Task_2_through_4();
/* configuration information */
@@ -28,12 +28,11 @@ void ITRON_Init( void );
#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 */
@@ -0,0 +1,55 @@
/* Task_1_through_3
*
* This routine serves as a test task. It verifies the basic task
* switching capabilities of the executive.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
void Task_2_through_4()
{
ID tid;
int tid_index;
rtems_time_of_day time;
ER status;
char name[30];
status = get_tid( &tid );
directive_failed( status, "get_tid");
tid_index = tid - 1; /* account for init tasks */
sprintf(name, "TA%d", tid_index);
while( FOREVER ) {
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
directive_failed( status, "rtems_clock_get" );
if ( time.second >= 35 ) {
puts( "*** END OF ITRON TEST 3 ***" );
exit( 0 );
}
printf(name);
print_time( " - rtems_clock_get - ", &time, "\n" );
status = rtems_task_wake_after( tid_index * 5 * TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after" );
}
}
@@ -0,0 +1,74 @@
#
# $Id$
#
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ..
subdir = itrontask02
RTEMS_ROOT = @RTEMS_ROOT@
PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@
TEST = itrontask02
PGM = ${ARCH}/$(TEST).exe
MANAGERS = all
# C source names, if any, go here -- minus the .c
C_PIECES = init preempt
C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
H_FILES = system.h
DOCTYPES = doc scn
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 +=
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
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
#
# $Id$
#
# 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.
#
This file describes the directives and concepts tested by this test set.
This test forces and verifies error conditions for the task and task
synchronization managers..
test set name:
directives:
concepts:
@@ -0,0 +1,81 @@
*** ITRON04 -- ITRON TASK TEST 4 ***
*** Create Task Errors ***
Init - cre_tsk - Preempt Task
Init - cre_tsk - access violation ( id less than -4) - E_OACV
Init - cre_tsk - bad id (between 0 and -4) - E_ID
Init - cre_tsk - cannot create self (0) - E_ID
Init - cre_tsk - invalid id; id already exists - E_OBJ
Init - cre_tsk - tskatr is invalid - E_RSATR
Init - cre_tsk - pk_ctsk is invalid - E_PAR
Init - cre_tsk - itskpri is invalid - E_PAR
Init - cre_tsk - stksz is invalid - E_PAR
Init - cre_tsk - task is invalid - E_PAR
*** Delete Task Errors ***
Init - del_tsk - cannot delete self - E_OBJ
Init - del_tsk - task is not DORMANT - E_OBJ
Init - del_tsk - task does not exist - E_NOEXS
Init - del_tsk - access violation ( id less than -4) - E_OACV
Init - del_tsk - cannot delete SELF - E_OBJ
Init - del_tsk - bad id (between 0 and -4) - E_ID
*** Start Task Errors ***
Init - sta_tsk - access violation ( id less than -4) - E_OACV
Init - sta_tsk - bad id (between 0 and -4) - E_ID
Init - sta_tsk - cannot start SELF - E_OBJ
Init - sta_tsk - task is not DORMANT - E_OBJ
Init - sta_tsk - task does not exist - E_NOEXS
*** Terminate Other Task Errors ***
Init - ter_tsk - bad id (between 0 and -4) - E_ID
Init - ter_tsk - cannot terminate SELF (0) - E_OBJ
Init - ter_tsk - task is not DORMANT - E_OBJ
Init - ter_tsk - task does not exist - E_NOEXS
Init - ter_tsk - access violation ( id less than -4) - E_OACV
*** Change Priority Task Errors ***
Init - chg_pri - bad id (between 0 and -4) - E_ID
Init - chg_pri - task does not exist - E_NOEXS
Init - chg_pri - access violation ( id less than -4) - E_OACV
Init - chg_pri - invalid priority - E_PAR
*** Rotate Ready Queue Errors ***
Init - rot_rdq - invalid priority - E_PAR
*** Reference Task Status Errors ***
Init - ref_tsk - bad id (between 0 and -4) - E_ID
Init - ref_tsk - task does not exist - E_NOEXS
Init - ref_tsk - access violation ( id less than -4) - E_OACV
Init - ref_tsk - packet address is bad - E_PAR
*** Suspend Task Errors ***
Init - sus_tsk - access violation ( id less than -4) - E_OACV
Init - sus_tsk - bad id (between 0 and -4) - E_ID
Init - sus_tsk - cannot suspend SELF - E_OBJ
Init - sus_tsk - task does not exist - E_NOEXS
*** Resume Task Errors ***
Init - rsm_tsk - access violation ( id less than -4) - E_OACV
Init - rsm_tsk - bad id (between 0 and -4) - E_ID
Init - rsm_tsk - cannot resume SELF - E_OBJ
Init - rsm_tsk - task is DORMANT - E_OBJ
Init - rsm_tsk - task does not exist - E_NOEXS
*** Forcibly Resume Task Errors ***
Init - frsm_tsk - access violation ( id less than -4) - E_OACV
Init - frsm_tsk - bad id (between 0 and -4) - E_ID
Init - frsm_tsk - cannot forcibly resume SELF - E_OBJ
Init - frsm_tsk - task is DORMANT - E_OBJ
Init - frsm_tsk - task does not exist - E_NOEXS
*** END OF ITRON TEST 4 ***
@@ -0,0 +1,30 @@
/* Preempt_task
*
* This routine serves as a test task. It verifies the task manager.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include <assert.h>
#include "system.h"
void Preempt_task()
{
puts( "PREEMPT - ext_tsk - going to DORMANT state" );
ext_tsk( );
puts( "ext_tsk of RTEMS_PREEMPT" );
assert(0);
}
@@ -0,0 +1,42 @@
/* 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 );
void Preempt_task();
/* configuration information */
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_ITRON_INIT_TASK_TABLE
#include <confdefs.h>
/* global variables */
#define PREEMPT_TASK_ID 2
TEST_EXTERN rtems_id Global_variable; /* example global variable */
/* end of include file */
@@ -0,0 +1,74 @@
#
# $Id$
#
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ..
subdir = itrontask03
RTEMS_ROOT = @RTEMS_ROOT@
PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@
TEST = itrontask03
PGM = ${ARCH}/$(TEST).exe
MANAGERS = all
# C source names, if any, go here -- minus the .c
C_PIECES = init preempt spinit task1 task2 task3
C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
H_FILES = system.h
DOCTYPES = doc scn
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 +=
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
+94
View File
@@ -0,0 +1,94 @@
/* 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 )
{
ER status;
T_CTSK pk_ctsk;
puts( "\n\n*** ITRON TEST 5 ***" );
pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
pk_ctsk.itskpri = 1;
pk_ctsk.task = Preempt_task;
status = cre_tsk( PREEMPT_TASK_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of RTEMS_PREEMPT" );
status = sta_tsk( PREEMPT_TASK_ID, 0 );
directive_failed( status, "sta_tsk of RTEMS_PREEMPT" );
puts( "INIT - rot_rdq - yielding processor" );
status = rot_rdq( 1 );
directive_failed( status, "rot_rdq" );
pk_ctsk.itskpri = 3;
pk_ctsk.task = Task_1;
status = cre_tsk( TA1_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA1" );
pk_ctsk.task = Task_2;
status = cre_tsk( TA2_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA2" );
pk_ctsk.task = Task_3;
status = cre_tsk( TA3_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA3" );
status = sta_tsk( TA1_ID, 0 );
directive_failed( status, "sta_tsk of TA1" );
status = sta_tsk( TA2_ID, 0 );
directive_failed( status, "sta_tsk of TA2" );
status = sta_tsk( TA3_ID, 0 );
directive_failed( status, "sta_tsk of TA3" );
puts( "INIT - suspending TA2 while middle task on a ready chain" );
status = sus_tsk( TA2_ID );
directive_failed( status, "sus_tsk of TA2" );
status = ter_tsk( TA1_ID );
directive_failed( status, "ter_tsk of TA1" );
status = del_tsk( TA1_ID );
directive_failed( status, "del_tsk of TA1" );
status = ter_tsk( TA2_ID );
directive_failed( status, "ter_tsk of TA2" );
status = ter_tsk( TA3_ID );
directive_failed( status, "ter_tsk of TA3" );
pk_ctsk.itskpri = 1;
pk_ctsk.task = Task_1;
status = cre_tsk( TA1_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA1 at priority 1" );
status = sta_tsk( TA1_ID, 0 );
directive_failed( status, "sta_tsk of TA1" );
status = sta_tsk( TA2_ID, 0 );
directive_failed( status, "sta_tsk of TA2" );
status = sta_tsk( TA3_ID, 0 );
directive_failed( status, "sta_tsk of TA3" );
exd_tsk();
directive_failed( 0, "exd_tsk" );
}
@@ -0,0 +1,40 @@
#
# $Id$
#
# 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.
#
This file describes the directives and concepts tested by this test set.
test set name: test2
directives:
ext_tsk, cre_tsk, sta_tsk, rot_rdq
ex_start, t_create, t_start, tm_tick, i_return, t_ident,
t_delete, tm_wkafter, t_setpri, t_suspend
concepts:
a. Verifies that a task can delete another task and also delete itself.
b. Verifies that memory is freed back to the heap correctly.
c. Verifies that TCBs are freed back to the inactive chain correctly.
d. Verifies that a task can get the task identification number of
another task.
e. Verifies the _Set_state routine where the task is not READY.
f. Verifies the break statement in the _Block_activate routine.
g. Verifies the while loop in the _Prev_tcb routine.
@@ -0,0 +1,13 @@
*** ITRON TEST 5 ***
INIT - rot_rdq - yielding processor
PREEMPT - exd_tsk
INIT - suspending TA2 while middle task on a ready chain
TA1 - rtems_task_wake_after - sleep 1 second
TA2 - rtems_task_wake_after - sleep 1 minute
TA3 - rtems_task_wake_after - sleep 5 seconds
TA1 - chg_pri - set TA3's priority to 2
TA1 - rtems_task_suspend - suspend TA2
TA1 - - delete TA2
TA1 - rtems_task_wake_after - sleep for 5 seconds
TA3 - exd_tsk - exit and delete self
*** END OF TEST 5 ***
@@ -0,0 +1,31 @@
/* Preempt_task
*
* This routine serves as a test task. It verifies the task manager.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include <assert.h>
#include "system.h"
void Preempt_task()
{
ER status;
puts( "PREEMPT - exd_tsk" );
exd_tsk( );
assert( 0 );
}
+152
View File
@@ -0,0 +1,152 @@
/* 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.
*
* Input parameters:
* argument - task argument
*
* 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"
rtems_task Init(
rtems_task_argument argument
)
{
rtems_status_code status;
puts( "\n\n*** TEST 2 ***" );
Preempt_task_name = rtems_build_name( 'P', 'R', 'M', 'T' );
status = rtems_task_create(
Preempt_task_name,
1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Preempt_task_id
);
directive_failed( status, "rtems_task_create of RTEMS_PREEMPT" );
status = rtems_task_start( Preempt_task_id, Preempt_task, 0 );
directive_failed( status, "rtems_task_start of RTEMS_PREEMPT" );
puts( "INIT - rtems_task_wake_after - yielding processor" );
status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
directive_failed( status, "rtems_task_wake_after" );
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
status = rtems_task_create(
Task_name[ 1 ],
3,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 1 ]
);
directive_failed( status, "rtems_task_create of TA1" );
status = rtems_task_create(
Task_name[ 2 ],
3,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 2 ]
);
directive_failed( status, "rtems_task_create of TA2" );
status = rtems_task_create(
Task_name[ 3 ],
3,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 3 ]
);
directive_failed( status, "rtems_task_create of TA3" );
status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
directive_failed( status, "rtems_task_start of TA1" );
status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
directive_failed( status, "rtems_task_start of TA2" );
status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
directive_failed( status, "rtems_task_start of TA3" );
puts( "INIT - suspending TA2 while middle task on a ready chain" );
status = rtems_task_suspend( Task_id[ 2 ] );
directive_failed( status, "rtems_task_suspend of TA2" );
status = rtems_task_delete( Task_id[ 1 ] );
directive_failed( status, "rtems_task_delete of TA1" );
status = rtems_task_delete( Task_id[ 2 ] );
directive_failed( status, "rtems_task_delete of TA2" );
status = rtems_task_delete( Task_id[ 3 ] );
directive_failed( status, "rtems_task_delete of TA3" );
status = rtems_task_create(
Task_name[ 1 ],
1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 1 ]
);
directive_failed( status, "rtems_task_create of TA1" );
status = rtems_task_create(
Task_name[ 2 ],
3,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 2 ]
);
directive_failed( status, "rtems_task_create of TA2" );
status = rtems_task_create(
Task_name[ 3 ],
3,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 3 ]
);
directive_failed( status, "rtems_task_create of TA3" );
status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
directive_failed( status, "rtems_task_start of TA1" );
status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
directive_failed( status, "rtems_task_start of TA2" );
status = rtems_task_start( Task_id[ 3 ], Task_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" );
}
@@ -0,0 +1,44 @@
/* 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 );
void Preempt_task();
void Task_1();
void Task_2();
void Task_3();
/* configuration information */
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
#define CONFIGURE_ITRON_INIT_TASK_TABLE
#include <confdefs.h>
/* global variables */
#define PREEMPT_TASK_ID 2
#define TA1_ID 3
#define TA2_ID 4
#define TA3_ID 5
TEST_EXTERN rtems_id Global_variable; /* example global variable */
/* end of include file */
@@ -0,0 +1,59 @@
/* Task_1
*
* This routine serves as a test task. It verifies the task manager.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
void Task_1()
{
ER status;
PRI previous_priority;
/*
* XXX - Change to itron routine.
*/
puts( "TA1 - rtems_task_wake_after - sleep 1 second" );
status = rtems_task_wake_after( 1*TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after" );
status = chg_pri( TA3_ID , 2 );
directive_failed( status, "chg_pri" );
puts( "TA1 - chg_pri - set TA3's priority to 2" );
puts( "TA1 - rtems_task_suspend - suspend TA2" );
status = sus_tsk( TA2_ID );
directive_failed( status, "sus_tsk of TA2" );
puts( "TA1 - - delete TA2" );
status = ter_tsk( TA2_ID );
directive_failed( status, "ter_tsk of TA2" );
/*
* XXX - Change to itron routine.
*/
puts( "TA1 - rtems_task_wake_after - sleep for 5 seconds" );
status = rtems_task_wake_after( 5*TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after" );
puts( "*** END OF TEST 5 ***" );
exit( 0 );
}
@@ -0,0 +1,32 @@
/* Task_2
*
* This routine serves as a test task. It sleeps for 1 minute but
* does not expect to wake up. Task 1 should suspend then delete it
* so that it appears to never wake up.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
void Task_2()
{
rtems_status_code status;
puts( "TA2 - rtems_task_wake_after - sleep 1 minute" );
status = rtems_task_wake_after( 60*TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after in TA2" );
}
@@ -0,0 +1,40 @@
/* Task_3
*
* This routine serves as a test task. It simply sleeps for 5 seconds
* and then deletes itself.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
void Task_3()
{
rtems_status_code status;
/*
* XXX - Convert Later.
*/
puts( "TA3 - rtems_task_wake_after - sleep 5 seconds" );
status = rtems_task_wake_after( 5*TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after in TA3" );
puts( "TA3 - exd_tsk - exit and delete self" );
exd_tsk();
directive_failed( 0, "exd_tsk" );
}
@@ -0,0 +1,74 @@
#
# $Id$
#
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ..
subdir = itrontask04
RTEMS_ROOT = @RTEMS_ROOT@
PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@
TEST = itrontask04
PGM = ${ARCH}/$(TEST).exe
MANAGERS = all
# C source names, if any, go here -- minus the .c
C_PIECES = init task1 task2 task3
C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
H_FILES = system.h
DOCTYPES = doc scn
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 +=
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
+85
View File
@@ -0,0 +1,85 @@
/* 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 )
{
ER status;
T_CTSK pk_ctsk;
puts( "\n\n*** ITRON TEST 6 ***" );
status = chg_pri( 0, 20 );
directive_failed( status, "chg_pri to 20" );
pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
pk_ctsk.itskpri = 2;
pk_ctsk.task = Task_1;
status = cre_tsk( TA1_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA1" );
pk_ctsk.task = Task_2;
status = cre_tsk( TA2_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA2" );
pk_ctsk.itskpri = 1;
pk_ctsk.task = Task_3;
status = cre_tsk( TA3_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA3" );
puts("INIT - dis_dsp while starting tasks");
status = dis_dsp( );
directive_failed( status, "dis_dsp from ITRON_Init" );
status = sta_tsk( TA1_ID, 0 );
directive_failed( status, "sta_tsk of TA1" );
status = sta_tsk( TA2_ID, 0 );
directive_failed( status, "sta_tsk of TA2" );
status = sta_tsk( TA3_ID, 0 );
directive_failed( status, "sta_tsk of TA3" );
puts( "INIT - suspending TA2 3 times" );
status = sus_tsk( TA2_ID );
directive_failed( status, "sus_tsk of TA2" );
status = sus_tsk( TA2_ID );
directive_failed( status, "sus_tsk of TA2" );
status = sus_tsk( TA2_ID );
directive_failed( status, "sus_tsk of TA2" );
puts("INIT - ena_dsp while starting tasks");
status = ena_dsp( );
puts( "INIT - suspending TA1 3 times" );
status = sus_tsk( TA1_ID );
directive_failed( status, "sus_tsk of TA2" );
status = sus_tsk( TA1_ID );
directive_failed( status, "sus_tsk of TA2" );
status = sus_tsk( TA1_ID );
directive_failed( status, "sus_tsk of TA2" );
puts("INIT - exd_tsk");
exd_tsk();
directive_failed( 0, "exd_tsk" );
}
@@ -0,0 +1,23 @@
#
# $Id$
#
# 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.
#
This file describes the directives and concepts tested by this test set.
test set name: 2
This test check task suspend and resume functionality.
directives:
concepts:
a.
@@ -0,0 +1,35 @@
*** ITRON TEST 6 ***
INIT - dis_dsp while starting tasks
INIT - suspending TA2 3 times
INIT - ena_dsp while starting tasks
TA3 - frsm_tsk TA1
TA3 - rsm_tsk TA2
TA3 - rot_rdq priority 2 queue
TA3 - rtems_task_wake_after - sleep 1 second
TA2 - rtems_task_suspend RTEMS_SELF
INIT - suspending TA1 3 times
INIT - exd_tsk
TA3 - frsm_tsk TA1
TA3 - rsm_tsk TA2
TA3 - rot_rdq priority 2 queue
TA3 - rtems_task_wake_after - sleep 1 second
TA2 - rtems_task_suspend RTEMS_SELF
TA3 - frsm_tsk TA1
TA3 - rsm_tsk TA2
TA3 - rot_rdq priority 2 queue
TA3 - rtems_task_wake_after - sleep 1 second
TA2 - rtems_task_suspend RTEMS_SELF
TA2 - rtems_task_suspend RTEMS_SELF
TA3 - frsm_tsk TA1
TA3 - rsm_tsk TA2
TA3 - rot_rdq priority 2 queue
TA3 - rtems_task_wake_after - sleep 1 second
TA2 - rtems_task_suspend RTEMS_SELF
TA2 - rtems_task_suspend RTEMS_SELF
TA3 - frsm_tsk TA1
TA3 - rsm_tsk TA2
TA3 - rot_rdq priority 2 queue
TA3 - rtems_task_wake_after - sleep 1 second
TA2 - rtems_task_suspend RTEMS_SELF
TA2 - rtems_task_suspend RTEMS_SELF
*** END OF TEST 6 ***
@@ -0,0 +1,44 @@
/* 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 );
void Preempt_task();
void Task_1();
void Task_2();
void Task_3();
/* configuration information */
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
#define CONFIGURE_ITRON_INIT_TASK_TABLE
#include <confdefs.h>
/* global variables */
#define PREEMPT_TASK_ID 2
#define TA1_ID 3
#define TA2_ID 4
#define TA3_ID 5
TEST_EXTERN rtems_id Global_variable; /* example global variable */
/* end of include file */
@@ -0,0 +1,45 @@
/* Task_1
*
* This routine serves as a test task. It verifies the task manager.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
/*
* XXX - This test requires tasks to suspend self, yet ITRON defines
* this as an error.
*/
void Task_1()
{
rtems_status_code status;
while (1) {
puts( "TA2 - rtems_task_suspend RTEMS_SELF" );
status = rtems_task_suspend( RTEMS_SELF );
directive_failed( status, "TA2 rtems_task_suspend RTEMS_SELF" );
}
}
@@ -0,0 +1,41 @@
/* Task_2
*
* This routine serves as a test task. It sleeps for 1 minute but
* does not expect to wake up. Task 1 should suspend then delete it
* so that it appears to never wake up.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
/*
* XXX - This test requires tasks to suspend self, yet ITRON defines
* this as an error.
*/
void Task_2()
{
rtems_status_code status;
while (1) {
puts( "TA2 - rtems_task_suspend RTEMS_SELF" );
status = rtems_task_suspend( RTEMS_SELF );
directive_failed( status, "TA2 rtems_task_suspend RTEMS_SELF" );
}
}
@@ -0,0 +1,53 @@
/* Task_3
*
* This routine serves as a test task. It simply sleeps for 5 seconds
* and then deletes itself.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
void Task_3()
{
rtems_status_code status;
int i;
for(i=0; i<5; i++) {
puts("TA3 - frsm_tsk TA1");
status = frsm_tsk( TA1_ID );
directive_failed( status, "TA3 - frsm_tsk TA1" );
puts("TA3 - rsm_tsk TA2");
status = rsm_tsk( TA2_ID );
directive_failed( status, "TA3 - rsm_tsk TA2" );
puts( "TA3 - rot_rdq priority 2 queue");
status = rot_rdq( 2 );
directive_failed( status, "rot_rdq for 2" );
/*
* XXX - Convert Later.
*/
puts( "TA3 - rtems_task_wake_after - sleep 1 second" );
status = rtems_task_wake_after( TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after in TA3" );
}
puts( "*** END OF TEST 6 ***" );
exit( 0 );
}
@@ -0,0 +1,13 @@
#
# $Id$
#
# 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.
#
@@ -0,0 +1,3 @@
*** HELLO WORLD TEST ***
Hello World
*** END OF HELLO WORLD TEST ***
@@ -0,0 +1,13 @@
#
# $Id$
#
# 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.
#
@@ -0,0 +1,3 @@
*** HELLO WORLD TEST ***
Hello World
*** END OF HELLO WORLD TEST ***
@@ -0,0 +1,13 @@
#
# $Id$
#
# 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.
#
@@ -0,0 +1,3 @@
*** HELLO WORLD TEST ***
Hello World
*** END OF HELLO WORLD TEST ***
+29 -33
View File
@@ -1,19 +1,15 @@
/* Init
*
* This routine is the initialization task for this test program.
* It is a user initialization task and has the responsibility for creating
* 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. This test is based off of sp01.
* value by this function.
*
* 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.
@@ -21,52 +17,52 @@
* $Id$
*/
#define TEST_INIT
#include "system.h"
#warning "Task_id is really an rtems_id"
void Task_1_through_3( void ){}
#include <stdio.h>
void ITRON_Init( void )
{
rtems_time_of_day time;
ER status;
T_CTSK values;
T_CTSK pk_ctsk;
puts( "\n\n*** ITRONTASK01 - TICKER TEST ***" );
puts( "\n\n*** ITRON TEST 3 ***" );
/*
* XXX - Change this to an itron clock !!
*/
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;
pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.itskpri = 1;
pk_ctsk.task = Task_2_through_4;
status = cre_tsk( Task_id[1], &values );
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
status = cre_tsk( 2, &pk_ctsk );
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" );
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2;
status = cre_tsk( 3, &pk_ctsk );
directive_failed( status, "cre_tsk of TA2" );
values.stksz = RTEMS_MINIMUM_STACK_SIZE;
status = cre_tsk( Task_id[3], &values );
directive_failed( status, "cre_tsk of TA1" );
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3;
status = cre_tsk( 4, &pk_ctsk );
directive_failed( status, "cre_tsk of TA3" );
#if 0
status = sta_tsk( Task_id[1] );
directive_failed( status, "rtems_task_start of TA1" );
status = sta_tsk( 2, 0 );
directive_failed( status, "sta_tsk of TA1" );
directive_failed( status, "rtems_task_start of TA2" );
status = sta_tsk( 3, 0 );
directive_failed( status, "sta_tsk of TA1" );
status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
directive_failed( status, "rtems_task_start of TA3" );
status = sta_tsk( 4, 0 );
directive_failed( status, "sta_tsk of TA1" );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
#endif
exd_tsk();
directive_failed( 0, "exd_tsk" );
}
@@ -0,0 +1,60 @@
#
# $Id$
#
# 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.
#
This file describes the directives and concepts tested by this test set.
This test is based upon the test in sp01.
test set name: test1
directives:
cre_tsk, sta_tsk, exd_tsk, get_tid
ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
tm_set, tm_get, tm_wkafter
concepts: XXX verify
a. Verifies system can create and start both the executive's system
initialization and idle task.
b. Verifies executive can swap between three application tasks at the
same priority and the executive's internal idle task.
c. Verifies can print strings to the CRT on port 2 of the mvme136 board
using Print and Println in the board support package.
d. Verifies interrupt handler can handle a task switch from an interrupt
as specified with the i_return directive.
e. Verifies executive initialization performed correctly.
f. Verifies the executive trap handler except for the halt function.
g. Verifies that a task can get the task identification number of itself.
notes:
rtems clock directives should change to itron clock directives when
the clock directives are merged.
change rtems task wake after to itron routines.
output:
"TA1" is printed once every 5 seconds.
"TA2" is printed once every 10 seconds.
"TA3" is printed once every 15 seconds.
@@ -0,0 +1,16 @@
*** ITRON TEST 3 ***
TA1 - rtems_clock_get - 09:00:00 12/31/1988
TA2 - rtems_clock_get - 09:00:00 12/31/1988
TA3 - rtems_clock_get - 09:00:00 12/31/1988
TA1 - rtems_clock_get - 09:00:05 12/31/1988
TA2 - rtems_clock_get - 09:00:10 12/31/1988
TA1 - rtems_clock_get - 09:00:10 12/31/1988
TA3 - rtems_clock_get - 09:00:15 12/31/1988
TA1 - rtems_clock_get - 09:00:15 12/31/1988
TA2 - rtems_clock_get - 09:00:20 12/31/1988
TA1 - rtems_clock_get - 09:00:20 12/31/1988
TA1 - rtems_clock_get - 09:00:25 12/31/1988
TA3 - rtems_clock_get - 09:00:30 12/31/1988
TA2 - rtems_clock_get - 09:00:30 12/31/1988
TA1 - rtems_clock_get - 09:00:30 12/31/1988
*** END OF ITRON TEST 3 ***
+4 -5
View File
@@ -15,11 +15,11 @@
*/
#include <tmacros.h>
#include <itron.h>
/* functions */
void ITRON_Init( void );
void Task_2_through_4();
/* configuration information */
@@ -28,12 +28,11 @@ void ITRON_Init( void );
#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 */
+55
View File
@@ -0,0 +1,55 @@
/* Task_1_through_3
*
* This routine serves as a test task. It verifies the basic task
* switching capabilities of the executive.
*
* Input parameters:
* argument - task argument
*
* 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$
*/
#include "system.h"
void Task_2_through_4()
{
ID tid;
int tid_index;
rtems_time_of_day time;
ER status;
char name[30];
status = get_tid( &tid );
directive_failed( status, "get_tid");
tid_index = tid - 1; /* account for init tasks */
sprintf(name, "TA%d", tid_index);
while( FOREVER ) {
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
directive_failed( status, "rtems_clock_get" );
if ( time.second >= 35 ) {
puts( "*** END OF ITRON TEST 3 ***" );
exit( 0 );
}
printf(name);
print_time( " - rtems_clock_get - ", &time, "\n" );
status = rtems_task_wake_after( tid_index * 5 * TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after" );
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
#
# $Id$
#
# 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.
#
This file describes the directives and concepts tested by this test set.
This test forces and verifies error conditions for the task and task
synchronization managers..
test set name:
directives:
concepts:
@@ -0,0 +1,81 @@
*** ITRON04 -- ITRON TASK TEST 4 ***
*** Create Task Errors ***
Init - cre_tsk - Preempt Task
Init - cre_tsk - access violation ( id less than -4) - E_OACV
Init - cre_tsk - bad id (between 0 and -4) - E_ID
Init - cre_tsk - cannot create self (0) - E_ID
Init - cre_tsk - invalid id; id already exists - E_OBJ
Init - cre_tsk - tskatr is invalid - E_RSATR
Init - cre_tsk - pk_ctsk is invalid - E_PAR
Init - cre_tsk - itskpri is invalid - E_PAR
Init - cre_tsk - stksz is invalid - E_PAR
Init - cre_tsk - task is invalid - E_PAR
*** Delete Task Errors ***
Init - del_tsk - cannot delete self - E_OBJ
Init - del_tsk - task is not DORMANT - E_OBJ
Init - del_tsk - task does not exist - E_NOEXS
Init - del_tsk - access violation ( id less than -4) - E_OACV
Init - del_tsk - cannot delete SELF - E_OBJ
Init - del_tsk - bad id (between 0 and -4) - E_ID
*** Start Task Errors ***
Init - sta_tsk - access violation ( id less than -4) - E_OACV
Init - sta_tsk - bad id (between 0 and -4) - E_ID
Init - sta_tsk - cannot start SELF - E_OBJ
Init - sta_tsk - task is not DORMANT - E_OBJ
Init - sta_tsk - task does not exist - E_NOEXS
*** Terminate Other Task Errors ***
Init - ter_tsk - bad id (between 0 and -4) - E_ID
Init - ter_tsk - cannot terminate SELF (0) - E_OBJ
Init - ter_tsk - task is not DORMANT - E_OBJ
Init - ter_tsk - task does not exist - E_NOEXS
Init - ter_tsk - access violation ( id less than -4) - E_OACV
*** Change Priority Task Errors ***
Init - chg_pri - bad id (between 0 and -4) - E_ID
Init - chg_pri - task does not exist - E_NOEXS
Init - chg_pri - access violation ( id less than -4) - E_OACV
Init - chg_pri - invalid priority - E_PAR
*** Rotate Ready Queue Errors ***
Init - rot_rdq - invalid priority - E_PAR
*** Reference Task Status Errors ***
Init - ref_tsk - bad id (between 0 and -4) - E_ID
Init - ref_tsk - task does not exist - E_NOEXS
Init - ref_tsk - access violation ( id less than -4) - E_OACV
Init - ref_tsk - packet address is bad - E_PAR
*** Suspend Task Errors ***
Init - sus_tsk - access violation ( id less than -4) - E_OACV
Init - sus_tsk - bad id (between 0 and -4) - E_ID
Init - sus_tsk - cannot suspend SELF - E_OBJ
Init - sus_tsk - task does not exist - E_NOEXS
*** Resume Task Errors ***
Init - rsm_tsk - access violation ( id less than -4) - E_OACV
Init - rsm_tsk - bad id (between 0 and -4) - E_ID
Init - rsm_tsk - cannot resume SELF - E_OBJ
Init - rsm_tsk - task is DORMANT - E_OBJ
Init - rsm_tsk - task does not exist - E_NOEXS
*** Forcibly Resume Task Errors ***
Init - frsm_tsk - access violation ( id less than -4) - E_OACV
Init - frsm_tsk - bad id (between 0 and -4) - E_ID
Init - frsm_tsk - cannot forcibly resume SELF - E_OBJ
Init - frsm_tsk - task is DORMANT - E_OBJ
Init - frsm_tsk - task does not exist - E_NOEXS
*** END OF ITRON TEST 4 ***

Some files were not shown because too many files have changed in this diff Show More