summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-12-16 23:35:09 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-12-16 23:35:09 +0000
commite4571904d7e7271b2d461438181494f95992d816 (patch)
tree1e872b8ca626e6c6369c098d6b9578cc900c9bcc /testsuites/sptests
parent2003-12-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff)
downloadrtems-e4571904d7e7271b2d461438181494f95992d816.tar.bz2
2003-12-16 Joel Sherrill <joel@OARcorp.com>
PR 544/tests * sp07/Makefile.am, sp07/init.c, sp07/system.h, sp07/task4.c, sp07/tcreate.c, sp07/tdelete.c, sp07/trestart.c, sp07/tstart.c, sp09/system.h, sp19/system.h, sp20/system.h: Various modifications to make tests account for resources and not print at inappropriate times. * sp07/buffered_io.c: New file.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/ChangeLog10
-rw-r--r--testsuites/sptests/sp07/Makefile.am4
-rw-r--r--testsuites/sptests/sp07/buffered_io.c38
-rw-r--r--testsuites/sptests/sp07/init.c4
-rw-r--r--testsuites/sptests/sp07/system.h10
-rw-r--r--testsuites/sptests/sp07/task4.c2
-rw-r--r--testsuites/sptests/sp07/tcreate.c14
-rw-r--r--testsuites/sptests/sp07/tdelete.c21
-rw-r--r--testsuites/sptests/sp07/trestart.c14
-rw-r--r--testsuites/sptests/sp07/tstart.c14
-rw-r--r--testsuites/sptests/sp09/system.h2
-rw-r--r--testsuites/sptests/sp19/system.h2
-rw-r--r--testsuites/sptests/sp20/system.h2
13 files changed, 121 insertions, 16 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index d11b88d41a..0e50adcf2d 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,13 @@
+2003-12-16 Joel Sherrill <joel@OARcorp.com>
+
+ PR 544/tests
+ * sp07/Makefile.am, sp07/init.c, sp07/system.h, sp07/task4.c,
+ sp07/tcreate.c, sp07/tdelete.c, sp07/trestart.c, sp07/tstart.c,
+ sp09/system.h, sp19/system.h, sp20/system.h: Various modifications to
+ make tests account for resources and not print at inappropriate
+ times.
+ * sp07/buffered_io.c: New file.
+
2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Require automake >= 1.8, autoconf >= 2.59.
diff --git a/testsuites/sptests/sp07/Makefile.am b/testsuites/sptests/sp07/Makefile.am
index aebc250f69..9f3eed6f35 100644
--- a/testsuites/sptests/sp07/Makefile.am
+++ b/testsuites/sptests/sp07/Makefile.am
@@ -6,8 +6,8 @@ TEST = sp07
MANAGERS = io
-C_FILES = init.c task1.c task2.c task3.c task4.c taskexit.c tcreate.c \
- tdelete.c trestart.c tstart.c
+C_FILES = init.c buffered_io.c task1.c task2.c task3.c task4.c taskexit.c \
+ tcreate.c tdelete.c trestart.c tstart.c
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
H_FILES = system.h
diff --git a/testsuites/sptests/sp07/buffered_io.c b/testsuites/sptests/sp07/buffered_io.c
new file mode 100644
index 0000000000..440f649053
--- /dev/null
+++ b/testsuites/sptests/sp07/buffered_io.c
@@ -0,0 +1,38 @@
+/*
+ * $Id$
+ */
+
+#include <rtems.h>
+
+#include "system.h"
+
+#define RINGBUF_QUEUE_LENGTH 512
+
+#include <ringbuf.h>
+
+Ring_buffer_t Buffer;
+
+void buffered_io_initialize( void )
+{
+ Ring_buffer_Initialize( &Buffer );
+}
+
+void buffered_io_flush(void)
+{
+ char ch;
+
+ while ( !Ring_buffer_Is_empty(&Buffer) ) {
+ Ring_buffer_Remove_character( &Buffer, ch );
+ fprintf( stderr, "%c", ch );
+ }
+ FLUSH_OUTPUT();
+}
+
+void buffered_io_add_string( char *s )
+{
+ char *p = s;
+
+ while ( *s ) {
+ Ring_buffer_Add_character( &Buffer, *s++ );
+ }
+}
diff --git a/testsuites/sptests/sp07/init.c b/testsuites/sptests/sp07/init.c
index 356321b57e..4913d07558 100644
--- a/testsuites/sptests/sp07/init.c
+++ b/testsuites/sptests/sp07/init.c
@@ -43,6 +43,8 @@ rtems_task Init(
puts( "\n\n*** TEST 7 ***" );
+ buffered_io_initialize();
+
Extension_name[ 1 ] = rtems_build_name( 'E', 'X', 'T', ' ' );
status = rtems_extension_create(
@@ -112,6 +114,8 @@ rtems_task Init(
status = rtems_task_restart( Task_id[ 3 ], 0 );
directive_failed( status, "rtems_task_restart of TA3" );
+ buffered_io_flush();
+
status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 );
directive_failed( status, "task_set_node of TA1" );
printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " );
diff --git a/testsuites/sptests/sp07/system.h b/testsuites/sptests/sp07/system.h
index 67d01b96e2..0730137b7f 100644
--- a/testsuites/sptests/sp07/system.h
+++ b/testsuites/sptests/sp07/system.h
@@ -15,6 +15,16 @@
#include <tmacros.h>
+/* buffered IO */
+
+void buffered_io_initialize( void );
+
+void buffered_io_flush(void);
+
+void buffered_io_add_string( char *s );
+
+/* end of buffered IO */
+
/* functions */
rtems_task Init(
diff --git a/testsuites/sptests/sp07/task4.c b/testsuites/sptests/sp07/task4.c
index 05280bf31e..1e44fba25b 100644
--- a/testsuites/sptests/sp07/task4.c
+++ b/testsuites/sptests/sp07/task4.c
@@ -25,5 +25,7 @@ rtems_task Task_4(
rtems_task_argument argument
)
{
+ buffered_io_flush();
+
puts( "TA4 - exitting task" );
}
diff --git a/testsuites/sptests/sp07/tcreate.c b/testsuites/sptests/sp07/tcreate.c
index 0dbbe0c219..3be5079394 100644
--- a/testsuites/sptests/sp07/tcreate.c
+++ b/testsuites/sptests/sp07/tcreate.c
@@ -25,10 +25,18 @@ rtems_boolean Task_create_extension(
rtems_tcb *created_task
)
{
+ char line[80];
+ rtems_name name;
+
if ( task_number( created_task->Object.id ) > 0 ) {
- puts_nocr( "TASK_CREATE - " );
- put_name( Task_name[ task_number( created_task->Object.id ) ], FALSE );
- puts( " - created." );
+ name = Task_name[ task_number( created_task->Object.id ) ];
+ sprintf( line, "TASK_CREATE - %c%c%c%c - created\n",
+ (name >> 24) & 0xff,
+ (name >> 16) & 0xff,
+ (name >> 8) & 0xff,
+ name & 0xff
+ );
+ buffered_io_add_string( line );
}
return TRUE;
}
diff --git a/testsuites/sptests/sp07/tdelete.c b/testsuites/sptests/sp07/tdelete.c
index 799b7000a9..efe6d68511 100644
--- a/testsuites/sptests/sp07/tdelete.c
+++ b/testsuites/sptests/sp07/tdelete.c
@@ -25,12 +25,29 @@ rtems_extension Task_delete_extension(
rtems_tcb *deleted_task
)
{
+ char line[80];
+ rtems_name name;
+
if ( task_number( running_task->Object.id ) > 0 ) {
+ name = Task_name[ task_number( running_task->Object.id ) ];
+ sprintf( line, "TASK_DELETE - %c%c%c%c",
+ (name >> 24) & 0xff,
+ (name >> 16) & 0xff,
+ (name >> 8) & 0xff,
+ name & 0xff
+ );
+ buffered_io_add_string( line );
puts_nocr( "TASK_DELETE - " );
put_name( Task_name[ task_number( running_task->Object.id ) ], FALSE );
}
if ( task_number( deleted_task->Object.id ) > 0 ) {
- puts_nocr( " deleting " );
- put_name( Task_name[ task_number( deleted_task->Object.id ) ], TRUE );
+ name = Task_name[ task_number( deleted_task->Object.id ) ];
+ sprintf( line, "deleting - %c%c%c%c\n",
+ (name >> 24) & 0xff,
+ (name >> 16) & 0xff,
+ (name >> 8) & 0xff,
+ name & 0xff
+ );
+ buffered_io_add_string( line );
}
}
diff --git a/testsuites/sptests/sp07/trestart.c b/testsuites/sptests/sp07/trestart.c
index 6e5ca7b6ee..32cd2e0822 100644
--- a/testsuites/sptests/sp07/trestart.c
+++ b/testsuites/sptests/sp07/trestart.c
@@ -25,9 +25,17 @@ void Task_restart_extension(
rtems_tcb *restarted_task
)
{
+ char line[80];
+ rtems_name name;
+
if ( task_number( restarted_task->Object.id ) > 0 ) {
- puts_nocr( "TASK_RESTART - " );
- put_name( Task_name[ task_number( restarted_task->Object.id ) ], FALSE );
- puts( " - restarted." );
+ name = Task_name[ task_number( restarted_task->Object.id ) ];
+ sprintf( line, "TASK_RESTART - %c%c%c%c - restarted\n",
+ (name >> 24) & 0xff,
+ (name >> 16) & 0xff,
+ (name >> 8) & 0xff,
+ name & 0xff
+ );
+ buffered_io_add_string( line );
}
}
diff --git a/testsuites/sptests/sp07/tstart.c b/testsuites/sptests/sp07/tstart.c
index f3f75be3ee..3053113a3c 100644
--- a/testsuites/sptests/sp07/tstart.c
+++ b/testsuites/sptests/sp07/tstart.c
@@ -25,9 +25,17 @@ rtems_extension Task_start_extension(
rtems_tcb *started_task
)
{
+ char line[80];
+ rtems_name name;
+
if ( task_number( started_task->Object.id ) > 0 ) {
- puts_nocr( "TASK_START - " );
- put_name( Task_name[ task_number( started_task->Object.id ) ], FALSE );
- puts( " - started." );
+ name = Task_name[ task_number( started_task->Object.id ) ];
+ sprintf( line, "TASK_START - %c%c%c%c - started\n",
+ (name >> 24) & 0xff,
+ (name >> 16) & 0xff,
+ (name >> 8) & 0xff,
+ name & 0xff
+ );
+ buffered_io_add_string( line );
}
}
diff --git a/testsuites/sptests/sp09/system.h b/testsuites/sptests/sp09/system.h
index d7fbfbeccb..2efc5f1354 100644
--- a/testsuites/sptests/sp09/system.h
+++ b/testsuites/sptests/sp09/system.h
@@ -95,7 +95,7 @@ void Screen14( void );
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_EXTRA_TASK_STACKS (2 * RTEMS_MINIMUM_STACK_SIZE)
+#define CONFIGURE_EXTRA_TASK_STACKS (20 * RTEMS_MINIMUM_STACK_SIZE)
#include <confdefs.h>
diff --git a/testsuites/sptests/sp19/system.h b/testsuites/sptests/sp19/system.h
index 1542a4ecae..f52abd1bbd 100644
--- a/testsuites/sptests/sp19/system.h
+++ b/testsuites/sptests/sp19/system.h
@@ -44,7 +44,7 @@ rtems_task Task_1(
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_EXTRA_TASK_STACKS (18 * RTEMS_MINIMUM_STACK_SIZE)
+#define CONFIGURE_EXTRA_TASK_STACKS (24 * RTEMS_MINIMUM_STACK_SIZE)
#include <confdefs.h>
diff --git a/testsuites/sptests/sp20/system.h b/testsuites/sptests/sp20/system.h
index 2d462d02b5..86d96507b7 100644
--- a/testsuites/sptests/sp20/system.h
+++ b/testsuites/sptests/sp20/system.h
@@ -45,7 +45,7 @@ void Get_all_counters( void );
#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_EXTRA_TASK_STACKS (6 * 3 * RTEMS_MINIMUM_STACK_SIZE)
+#define CONFIGURE_EXTRA_TASK_STACKS (6 * 4 * RTEMS_MINIMUM_STACK_SIZE)
#include <confdefs.h>