From e0991809991a2c5547d45881978212d5efc0e1de Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 9 Nov 1999 23:27:05 +0000 Subject: Merged tests from Task group. --- testsuites/itrontests/itrontask01/init.c | 62 +++++++++++------------ testsuites/itrontests/itrontask01/itrontask01.doc | 60 ++++++++++++++++++++++ testsuites/itrontests/itrontask01/itrontask01.scn | 16 ++++++ testsuites/itrontests/itrontask01/system.h | 9 ++-- testsuites/itrontests/itrontask01/task1.c | 55 ++++++++++++++++++++ 5 files changed, 164 insertions(+), 38 deletions(-) create mode 100644 testsuites/itrontests/itrontask01/itrontask01.doc create mode 100644 testsuites/itrontests/itrontask01/itrontask01.scn create mode 100644 testsuites/itrontests/itrontask01/task1.c (limited to 'testsuites/itrontests/itrontask01') diff --git a/testsuites/itrontests/itrontask01/init.c b/testsuites/itrontests/itrontask01/init.c index 3b36e2e9ec..62525bf578 100644 --- a/testsuites/itrontests/itrontask01/init.c +++ b/testsuites/itrontests/itrontask01/init.c @@ -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 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" ); } diff --git a/testsuites/itrontests/itrontask01/itrontask01.doc b/testsuites/itrontests/itrontask01/itrontask01.doc new file mode 100644 index 0000000000..2ae309239f --- /dev/null +++ b/testsuites/itrontests/itrontask01/itrontask01.doc @@ -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. + + + + + + + diff --git a/testsuites/itrontests/itrontask01/itrontask01.scn b/testsuites/itrontests/itrontask01/itrontask01.scn new file mode 100644 index 0000000000..735b8e14cc --- /dev/null +++ b/testsuites/itrontests/itrontask01/itrontask01.scn @@ -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 *** diff --git a/testsuites/itrontests/itrontask01/system.h b/testsuites/itrontests/itrontask01/system.h index 8a5b4ad378..7523bb5890 100644 --- a/testsuites/itrontests/itrontask01/system.h +++ b/testsuites/itrontests/itrontask01/system.h @@ -15,11 +15,11 @@ */ #include -#include /* 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 /* global variables */ -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ - /* end of include file */ + + + diff --git a/testsuites/itrontests/itrontask01/task1.c b/testsuites/itrontests/itrontask01/task1.c new file mode 100644 index 0000000000..2df961c35c --- /dev/null +++ b/testsuites/itrontests/itrontask01/task1.c @@ -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" ); + } +} + -- cgit v1.2.3