From 11b9b5d0356d924dfcde7652c0616ad987dafaa7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 16 Sep 2011 09:24:52 +0000 Subject: 2011-09-16 Sebastian Huber * monitor/monitor.scn, termios/termios.scn: New files. * monitor/init.c, termios01/init.c: Use rtems_shell_wait_for_input(). --- testsuites/libtests/monitor/init.c | 29 ++++++++++++++++++++++++----- testsuites/libtests/monitor/monitor.scn | 22 ++++++++++++++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 testsuites/libtests/monitor/monitor.scn (limited to 'testsuites/libtests/monitor') diff --git a/testsuites/libtests/monitor/init.c b/testsuites/libtests/monitor/init.c index 0ae10b1c77..5983851e5f 100644 --- a/testsuites/libtests/monitor/init.c +++ b/testsuites/libtests/monitor/init.c @@ -21,6 +21,7 @@ #include "system.h" #include +#include rtems_task_priority Priorities[6] = { 0, 1, 1, 3, 4, 5 }; @@ -36,7 +37,13 @@ rtems_task Task_1_through_5( } } - +static void notification(int fd, int seconds_remaining, void *arg) +{ + printf( + "Press any key to enter monitor (%is remaining)\n", + seconds_remaining + ); +} rtems_task Init( rtems_task_argument argument @@ -45,7 +52,7 @@ rtems_task Init( uint32_t index; rtems_status_code status; - puts( "\n\n*** MONITOR TASK TEST ***" ); + puts( "\n\n*** TEST MONITOR ***" ); Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); @@ -70,8 +77,20 @@ rtems_task Init( directive_failed( status, "rtems_task_start loop" ); } - rtems_monitor_init( 0 ); + status = rtems_shell_wait_for_input( + STDIN_FILENO, + 20, + notification, + NULL + ); + if (status == RTEMS_SUCCESSFUL) { + rtems_monitor_init( 0 ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); + status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); + } else { + puts( "*** END OF TEST MONITOR ***" ); + + rtems_test_exit( 0 ); + } } diff --git a/testsuites/libtests/monitor/monitor.scn b/testsuites/libtests/monitor/monitor.scn new file mode 100644 index 0000000000..b39954965c --- /dev/null +++ b/testsuites/libtests/monitor/monitor.scn @@ -0,0 +1,22 @@ +*** TEST MONITOR *** +Press any key to enter monitor (20s remaining) +Press any key to enter monitor (19s remaining) +Press any key to enter monitor (18s remaining) +Press any key to enter monitor (17s remaining) +Press any key to enter monitor (16s remaining) +Press any key to enter monitor (15s remaining) +Press any key to enter monitor (14s remaining) +Press any key to enter monitor (13s remaining) +Press any key to enter monitor (12s remaining) +Press any key to enter monitor (11s remaining) +Press any key to enter monitor (10s remaining) +Press any key to enter monitor (9s remaining) +Press any key to enter monitor (8s remaining) +Press any key to enter monitor (7s remaining) +Press any key to enter monitor (6s remaining) +Press any key to enter monitor (5s remaining) +Press any key to enter monitor (4s remaining) +Press any key to enter monitor (3s remaining) +Press any key to enter monitor (2s remaining) +Press any key to enter monitor (1s remaining) +*** END OF TEST MONITOR *** -- cgit v1.2.3