summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/dl10/init.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-01-14 07:59:34 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-01-14 08:02:38 +0100
commit93ebc9da6926b683862b84112e83a1811ec9ad6d (patch)
tree95fd491adbb7280411f2ca6e21a2fd22affbc240 /testsuites/libtests/dl10/init.c
parentlibtests/ofw01: Fix device tree blob alignment (diff)
downloadrtems-93ebc9da6926b683862b84112e83a1811ec9ad6d.tar.bz2
libtests/dl10: Enter shell on demand
Use rtems_shell_wait_for_input() similar to other potentially interactive test programs.
Diffstat (limited to '')
-rw-r--r--testsuites/libtests/dl10/init.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/testsuites/libtests/dl10/init.c b/testsuites/libtests/dl10/init.c
index b488a321ab..ac9d378700 100644
--- a/testsuites/libtests/dl10/init.c
+++ b/testsuites/libtests/dl10/init.c
@@ -27,9 +27,6 @@
const char rtems_test_name[] = "libdl (RTL) 10";
-/* forward declarations to avoid warnings */
-static rtems_task Init(rtems_task_argument argument);
-
#include "dl10-tar.h"
#define TARFILE_START dl10_tar
@@ -46,9 +43,18 @@ static int test(void)
return 0;
}
+static void notification(int fd, int seconds_remaining, void *arg)
+{
+ printf(
+ "Press any key to enter shell (%is remaining)\n",
+ seconds_remaining
+ );
+}
+
static void Init(rtems_task_argument arg)
{
int e;
+ rtems_status_code sc;
TEST_BEGIN();
@@ -76,13 +82,20 @@ static void Init(rtems_task_argument arg)
exit (1);
}
- rtems_shell_init ("SHLL",
- RTEMS_MINIMUM_STACK_SIZE * 4,
- 100,
- "/dev/foobar",
- false,
- true,
- NULL);
+
+ sc = rtems_shell_wait_for_input (STDIN_FILENO,
+ 20,
+ notification,
+ NULL);
+ if (sc == RTEMS_SUCCESSFUL) {
+ rtems_shell_init ("SHLL",
+ RTEMS_MINIMUM_STACK_SIZE * 4,
+ 100,
+ "/dev/foobar",
+ false,
+ true,
+ NULL);
+ }
TEST_END();