Changeset 93ebc9d in rtems


Ignore:
Timestamp:
01/14/22 06:59:34 (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
944c210
Parents:
671f126
git-author:
Sebastian Huber <sebastian.huber@…> (01/14/22 06:59:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/14/22 07:02:38)
Message:

libtests/dl10: Enter shell on demand

Use rtems_shell_wait_for_input() similar to other potentially
interactive test programs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/dl10/init.c

    r671f126 r93ebc9d  
    2828const char rtems_test_name[] = "libdl (RTL) 10";
    2929
    30 /* forward declarations to avoid warnings */
    31 static rtems_task Init(rtems_task_argument argument);
    32 
    3330#include "dl10-tar.h"
    3431
     
    4744}
    4845
     46static void notification(int fd, int seconds_remaining, void *arg)
     47{
     48  printf(
     49    "Press any key to enter shell (%is remaining)\n",
     50    seconds_remaining
     51  );
     52}
     53
    4954static void Init(rtems_task_argument arg)
    5055{
    5156  int e;
     57  rtems_status_code sc;
    5258
    5359  TEST_BEGIN();
     
    7783  }
    7884
    79   rtems_shell_init ("SHLL",
    80                     RTEMS_MINIMUM_STACK_SIZE * 4,
    81                     100,
    82                     "/dev/foobar",
    83                     false,
    84                     true,
    85                     NULL);
     85
     86  sc = rtems_shell_wait_for_input (STDIN_FILENO,
     87                                   20,
     88                                   notification,
     89                                   NULL);
     90  if (sc == RTEMS_SUCCESSFUL) {
     91    rtems_shell_init ("SHLL",
     92                      RTEMS_MINIMUM_STACK_SIZE * 4,
     93                      100,
     94                      "/dev/foobar",
     95                      false,
     96                      true,
     97                      NULL);
     98  }
    8699
    87100  TEST_END();
Note: See TracChangeset for help on using the changeset viewer.