summaryrefslogtreecommitdiffstats
path: root/testsuites/samples/fileio
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2011-09-16 09:23:19 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2011-09-16 09:23:19 +0000
commit7c9d27e83125cd3b7051dcc23fa2fcde1255cc7c (patch)
tree23f7d993f50e54c1c883d2e553b7144c1fd988c1 /testsuites/samples/fileio
parent2011-09-16 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-7c9d27e83125cd3b7051dcc23fa2fcde1255cc7c.tar.bz2
2011-09-16 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* fileio/fileio.scn: New file. * capture/init.c, fileio/init.c: Use rtems_shell_wait_for_input().
Diffstat (limited to 'testsuites/samples/fileio')
-rw-r--r--testsuites/samples/fileio/fileio.scn22
-rw-r--r--testsuites/samples/fileio/init.c47
2 files changed, 56 insertions, 13 deletions
diff --git a/testsuites/samples/fileio/fileio.scn b/testsuites/samples/fileio/fileio.scn
new file mode 100644
index 0000000000..4e8c3e5ab0
--- /dev/null
+++ b/testsuites/samples/fileio/fileio.scn
@@ -0,0 +1,22 @@
+*** TEST FILE I/O SAMPLE ***
+Press any key to start file I/O sample (20s remaining)
+Press any key to start file I/O sample (19s remaining)
+Press any key to start file I/O sample (18s remaining)
+Press any key to start file I/O sample (17s remaining)
+Press any key to start file I/O sample (16s remaining)
+Press any key to start file I/O sample (15s remaining)
+Press any key to start file I/O sample (14s remaining)
+Press any key to start file I/O sample (13s remaining)
+Press any key to start file I/O sample (12s remaining)
+Press any key to start file I/O sample (11s remaining)
+Press any key to start file I/O sample (10s remaining)
+Press any key to start file I/O sample (9s remaining)
+Press any key to start file I/O sample (8s remaining)
+Press any key to start file I/O sample (7s remaining)
+Press any key to start file I/O sample (6s remaining)
+Press any key to start file I/O sample (5s remaining)
+Press any key to start file I/O sample (4s remaining)
+Press any key to start file I/O sample (3s remaining)
+Press any key to start file I/O sample (2s remaining)
+Press any key to start file I/O sample (1s remaining)
+*** END OF TEST FILE I/O SAMPLE ***
diff --git a/testsuites/samples/fileio/init.c b/testsuites/samples/fileio/init.c
index b0ebc69629..14a0de20b5 100644
--- a/testsuites/samples/fileio/init.c
+++ b/testsuites/samples/fileio/init.c
@@ -43,6 +43,7 @@
#include <rtems/ramdisk.h>
#include <rtems/nvdisk.h>
#include <rtems/nvdisk-sram.h>
+#include <rtems/shell.h>
#if FILEIO_BUILD
@@ -226,7 +227,6 @@ fstab_t fs_table[] = {
#define USE_SHELL
#ifdef USE_SHELL
-#include <rtems/shell.h>
int
shell_nvdisk_trace (int argc, char* argv[])
@@ -1213,6 +1213,15 @@ fileio_task (rtems_task_argument ignored)
fileio_menu();
}
+static void
+notification (int fd, int seconds_remaining, void *arg)
+{
+ printf(
+ "Press any key to start file I/O sample (%is remaining)\n",
+ seconds_remaining
+ );
+}
+
/*
* RTEMS Startup Task
*/
@@ -1223,22 +1232,34 @@ Init (rtems_task_argument ignored)
rtems_id Task_id;
rtems_status_code status;
- puts( "\n\n*** FILE I/O SAMPLE AND TEST ***" );
-
- Task_name = rtems_build_name('F','M','N','U');
+ puts( "\n\n*** TEST FILE I/O SAMPLE ***" );
- status = rtems_task_create(
- Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_DEFAULT_MODES ,
- RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
+ status = rtems_shell_wait_for_input(
+ STDIN_FILENO,
+ 20,
+ notification,
+ NULL
);
- directive_failed( status, "create" );
+ if (status == RTEMS_SUCCESSFUL) {
+ Task_name = rtems_build_name('F','M','N','U');
- status = rtems_task_start( Task_id, fileio_task, 1 );
- directive_failed( status, "start" );
+ status = rtems_task_create(
+ Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2,
+ RTEMS_DEFAULT_MODES ,
+ RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
+ );
+ directive_failed( status, "create" );
- status = rtems_task_delete( RTEMS_SELF );
- directive_failed( status, "delete" );
+ status = rtems_task_start( Task_id, fileio_task, 1 );
+ directive_failed( status, "start" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "delete" );
+ } else {
+ puts( "*** END OF TEST FILE I/O SAMPLE ***" );
+
+ rtems_test_exit( 0 );
+ }
}
#if defined(USE_SHELL)