forked from Imagelibrary/rtems
libtests/dl10: Enter shell on demand
Use rtems_shell_wait_for_input() similar to other potentially interactive test programs.
This commit is contained in:
@@ -27,9 +27,6 @@
|
|||||||
|
|
||||||
const char rtems_test_name[] = "libdl (RTL) 10";
|
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"
|
#include "dl10-tar.h"
|
||||||
|
|
||||||
#define TARFILE_START dl10_tar
|
#define TARFILE_START dl10_tar
|
||||||
@@ -46,9 +43,18 @@ static int test(void)
|
|||||||
return 0;
|
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)
|
static void Init(rtems_task_argument arg)
|
||||||
{
|
{
|
||||||
int e;
|
int e;
|
||||||
|
rtems_status_code sc;
|
||||||
|
|
||||||
TEST_BEGIN();
|
TEST_BEGIN();
|
||||||
|
|
||||||
@@ -76,6 +82,12 @@ static void Init(rtems_task_argument arg)
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sc = rtems_shell_wait_for_input (STDIN_FILENO,
|
||||||
|
20,
|
||||||
|
notification,
|
||||||
|
NULL);
|
||||||
|
if (sc == RTEMS_SUCCESSFUL) {
|
||||||
rtems_shell_init ("SHLL",
|
rtems_shell_init ("SHLL",
|
||||||
RTEMS_MINIMUM_STACK_SIZE * 4,
|
RTEMS_MINIMUM_STACK_SIZE * 4,
|
||||||
100,
|
100,
|
||||||
@@ -83,6 +95,7 @@ static void Init(rtems_task_argument arg)
|
|||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
NULL);
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_END();
|
TEST_END();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user