Changeset 7b00c2fa in rtems for testsuites/samples


Ignore:
Timestamp:
Nov 6, 2017, 6:56:17 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
bceb9db6
Parents:
d71542c
git-author:
Sebastian Huber <sebastian.huber@…> (11/06/17 06:56:17)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/06/17 08:06:20)
Message:

tests: Use <tmacros.h> in all tests

Update #3170.
Update #3199.

Location:
testsuites/samples
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • testsuites/samples/capture/Makefile.am

    rd71542c r7b00c2fa  
    1010include $(top_srcdir)/../automake/leaf.am
    1111
     12AM_CPPFLAGS += -I$(top_srcdir)/../support/include
    1213
    1314LINK_OBJS = $(capture_OBJECTS)
  • testsuites/samples/capture/init.c

    rd71542c r7b00c2fa  
    1515
    1616#include "system.h"
    17 #include <stdio.h>
    18 #include <stdlib.h>
    1917
    2018#include <rtems.h>
     
    2220#include <rtems/monitor.h>
    2321#include <rtems/shell.h>
    24 
    25 /* forward declarations to avoid warnings */
    26 rtems_task Init(rtems_task_argument argument);
    27 static void notification(int fd, int seconds_remaining, void *arg);
     22#include <tmacros.h>
    2823
    2924const char rtems_test_name[] = "CAPTURE ENGINE";
     
    4843
    4944  rtems_print_printer_fprintf_putc(&rtems_test_printer);
    50   rtems_test_begin();
     45  TEST_BEGIN();
    5146
    5247  status = rtems_shell_wait_for_input(
     
    7570    rtems_task_delete (RTEMS_SELF);
    7671  } else {
    77     rtems_test_end();
    78 
    79     exit( 0 );
     72    TEST_END();
     73    rtems_test_exit( 0 );
    8074  }
    8175}
  • testsuites/samples/hello/Makefile.am

    rd71542c r7b00c2fa  
    1010include $(top_srcdir)/../automake/leaf.am
    1111
     12AM_CPPFLAGS += -I$(top_srcdir)/../support/include
    1213
    1314LINK_OBJS = $(hello_OBJECTS)
  • testsuites/samples/hello/init.c

    rd71542c r7b00c2fa  
    1212#endif
    1313
    14 #include <rtems/printer.h>
    15 #include <rtems/test.h>
    16 
    17 #include <bsp.h> /* for device driver prototypes */
    18 
    19 #include <stdio.h>
    20 #include <stdlib.h>
    21 
    22 /* forward declarations to avoid warnings */
    23 rtems_task Init(rtems_task_argument argument);
     14#include <rtems.h>
     15#include <tmacros.h>
    2416
    2517const char rtems_test_name[] = "HELLO WORLD";
    2618
    27 rtems_task Init(
     19static rtems_task Init(
    2820  rtems_task_argument ignored
    2921)
    3022{
    3123  rtems_print_printer_fprintf_putc(&rtems_test_printer);
    32   rtems_test_begin();
     24  TEST_BEGIN();
    3325  printf( "Hello World\n" );
    34   rtems_test_end();
    35   exit( 0 );
     26  TEST_END();
     27  rtems_test_exit( 0 );
    3628}
    3729
  • testsuites/samples/loopback/Makefile.am

    rd71542c r7b00c2fa  
    99include $(top_srcdir)/../automake/leaf.am
    1010
     11AM_CPPFLAGS += -I$(top_srcdir)/../support/include
    1112
    1213LINK_OBJS = $(loopback_OBJECTS)
  • testsuites/samples/loopback/init.c

    rd71542c r7b00c2fa  
    99#endif
    1010
    11 #include <rtems/test.h>
    12 
    13 #include <bsp.h>
     11#include <tmacros.h>
    1412
    1513const char rtems_test_name[] = "LOOPBACK";
     
    7472    0
    7573};
    76 
    77 /*
    78  * Thread-safe output routines
    79  */
    80 static rtems_id printMutex;
    81 static void printSafe(const char *fmt, ...)
    82 {
    83     va_list args;
    84     va_start(args, fmt);
    85     rtems_semaphore_obtain(printMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    86     vprintf(fmt, args);
    87     rtems_semaphore_release(printMutex);
    88     va_end(args);
    89 }
    90 #define printf printSafe
    9174
    9275/*
     
    247230Init (rtems_task_argument ignored)
    248231{
    249     rtems_status_code sc;
    250 
    251232    rtems_print_printer_fprintf_putc(&rtems_test_printer);
    252233
    253     rtems_test_begin();
    254 
    255     sc = rtems_semaphore_create(rtems_build_name('P','m','t','x'),
    256                 1,
    257                 RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY|
    258                                     RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
    259                 0,
    260                 &printMutex);
    261     if (sc != RTEMS_SUCCESSFUL)
    262         rtems_panic("Can't create printf mutex:", rtems_status_text(sc));
     234    TEST_BEGIN();
     235
    263236    printf("\"Network\" initializing!\n");
    264237    rtems_bsdnet_initialize_network();
     
    287260
    288261    rtems_task_wake_after(500);
    289     rtems_test_end();
     262    TEST_END();
    290263    exit( 0 );
    291264}
  • testsuites/samples/paranoia/Makefile.am

    rd71542c r7b00c2fa  
    99include $(top_srcdir)/../automake/compile.am
    1010include $(top_srcdir)/../automake/leaf.am
     11
     12AM_CPPFLAGS += -I$(top_srcdir)/../support/include
    1113
    1214#  -DCYGNUS   turns on more verbose msgs
  • testsuites/samples/paranoia/init.c

    rd71542c r7b00c2fa  
    1515#include "system.h"
    1616#include <stdio.h>
    17 #include <stdlib.h> /* exit */
     17#include <tmacros.h>
    1818
    1919extern int paranoia(int, char **);
     
    3737
    3838  rtems_print_printer_fprintf_putc(&rtems_test_printer);
    39   rtems_test_begin();
     39  TEST_BEGIN();
    4040  paranoia(1, args);
    41   rtems_test_end();
    42   exit( 0 );
     41  TEST_END();
     42  rtems_test_exit( 0 );
    4343}
  • testsuites/samples/pppd/init.c

    rd71542c r7b00c2fa  
    2323#include <rtems/shell.h>
    2424#include "netconfig.h"
     25#include <tmacros.h>
    2526
    2627const char rtems_test_name[] = "PPPD";
     
    4041  rtems_print_printer_fprintf_putc(&rtems_test_printer);
    4142
    42   rtems_test_begin();
     43  TEST_BEGIN();
    4344
    4445  status = rtems_shell_wait_for_input(
     
    4950  );
    5051  if (status != RTEMS_SUCCESSFUL) {
    51     rtems_test_end();
     52    TEST_END();
    5253    exit( 0 );
    5354  }
Note: See TracChangeset for help on using the changeset viewer.