diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-11-20 08:52:50 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-11-20 08:54:10 +0100 |
commit | 3eade71044461829e9553720fbab3102dfe8ad4d (patch) | |
tree | c4953c0a26a19c0d3094dffc2742dac3b9abf2ac /testsuites | |
parent | ARM removed shared/abort from several ARM BSPs (diff) | |
download | rtems-3eade71044461829e9553720fbab3102dfe8ad4d.tar.bz2 |
libtests/top: End test after some time if no input
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/libtests/top/init.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuites/libtests/top/init.c b/testsuites/libtests/top/init.c index c0e980bc4f..8a824ae194 100644 --- a/testsuites/libtests/top/init.c +++ b/testsuites/libtests/top/init.c @@ -24,6 +24,8 @@ #define CONFIGURE_INIT #include "system.h" +#include <rtems/shell.h> + const char rtems_test_name[] = "TOP"; /* @@ -46,6 +48,14 @@ void add_some( } } +static void notification(int fd, int seconds_remaining, void *arg) +{ + printf( + "Press any key to enter top test (%is remaining)\n", + seconds_remaining + ); +} + rtems_task Init( rtems_task_argument argument ) @@ -54,6 +64,19 @@ rtems_task Init( rtems_time_of_day time; TEST_BEGIN(); + + status = rtems_shell_wait_for_input( + STDIN_FILENO, + 20, + notification, + NULL + ); + if ( status != RTEMS_SUCCESSFUL ) { + TEST_END(); + + rtems_test_exit( 0 ); + } + build_time( &time, 12, 31, 1988, 9, 15, 0, 0 ); status = rtems_clock_set( &time ); |