tests: Use <tmacros.h> in all tests

Update #3170.
Update #3199.
This commit is contained in:
Sebastian Huber
2017-11-06 07:56:17 +01:00
parent d71542c8be
commit 7b00c2fac5
19 changed files with 57 additions and 95 deletions

View File

@@ -9,6 +9,7 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(capture_OBJECTS)
LINK_LIBS = $(capture_LDLIBS)

View File

@@ -14,17 +14,12 @@
#endif
#include "system.h"
#include <stdio.h>
#include <stdlib.h>
#include <rtems.h>
#include <rtems/capture-cli.h>
#include <rtems/monitor.h>
#include <rtems/shell.h>
/* forward declarations to avoid warnings */
rtems_task Init(rtems_task_argument argument);
static void notification(int fd, int seconds_remaining, void *arg);
#include <tmacros.h>
const char rtems_test_name[] = "CAPTURE ENGINE";
@@ -47,7 +42,7 @@ rtems_task Init(
rtems_mode old_mode;
rtems_print_printer_fprintf_putc(&rtems_test_printer);
rtems_test_begin();
TEST_BEGIN();
status = rtems_shell_wait_for_input(
STDIN_FILENO,
@@ -74,8 +69,7 @@ rtems_task Init(
rtems_task_delete (RTEMS_SELF);
} else {
rtems_test_end();
exit( 0 );
TEST_END();
rtems_test_exit( 0 );
}
}

View File

@@ -9,6 +9,7 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(hello_OBJECTS)
LINK_LIBS = $(hello_LDLIBS)

View File

@@ -11,28 +11,20 @@
#include "config.h"
#endif
#include <rtems/printer.h>
#include <rtems/test.h>
#include <bsp.h> /* for device driver prototypes */
#include <stdio.h>
#include <stdlib.h>
/* forward declarations to avoid warnings */
rtems_task Init(rtems_task_argument argument);
#include <rtems.h>
#include <tmacros.h>
const char rtems_test_name[] = "HELLO WORLD";
rtems_task Init(
static rtems_task Init(
rtems_task_argument ignored
)
{
rtems_print_printer_fprintf_putc(&rtems_test_printer);
rtems_test_begin();
TEST_BEGIN();
printf( "Hello World\n" );
rtems_test_end();
exit( 0 );
TEST_END();
rtems_test_exit( 0 );
}

View File

@@ -8,6 +8,7 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(loopback_OBJECTS)
LINK_LIBS = $(loopback_LDLIBS)

View File

@@ -8,9 +8,7 @@
#include "config.h"
#endif
#include <rtems/test.h>
#include <bsp.h>
#include <tmacros.h>
const char rtems_test_name[] = "LOOPBACK";
@@ -74,21 +72,6 @@ struct rtems_bsdnet_config rtems_bsdnet_config = {
0
};
/*
* Thread-safe output routines
*/
static rtems_id printMutex;
static void printSafe(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
rtems_semaphore_obtain(printMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
vprintf(fmt, args);
rtems_semaphore_release(printMutex);
va_end(args);
}
#define printf printSafe
/*
* Spawn a task
*/
@@ -246,20 +229,10 @@ static rtems_task clientTask(rtems_task_argument arg)
rtems_task
Init (rtems_task_argument ignored)
{
rtems_status_code sc;
rtems_print_printer_fprintf_putc(&rtems_test_printer);
rtems_test_begin();
TEST_BEGIN();
sc = rtems_semaphore_create(rtems_build_name('P','m','t','x'),
1,
RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY|
RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
0,
&printMutex);
if (sc != RTEMS_SUCCESSFUL)
rtems_panic("Can't create printf mutex:", rtems_status_text(sc));
printf("\"Network\" initializing!\n");
rtems_bsdnet_initialize_network();
printf("\"Network\" initialized!\n");
@@ -286,6 +259,6 @@ Init (rtems_task_argument ignored)
spawnTask(clientTask, 120, 6);
rtems_task_wake_after(500);
rtems_test_end();
TEST_END();
exit( 0 );
}

View File

@@ -9,6 +9,8 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
# -DCYGNUS turns on more verbose msgs
AM_CPPFLAGS += -DNOSIGNAL -DCYGNUS -DNOMAIN

View File

@@ -14,7 +14,7 @@
#define CONFIGURE_INIT
#include "system.h"
#include <stdio.h>
#include <stdlib.h> /* exit */
#include <tmacros.h>
extern int paranoia(int, char **);
@@ -36,8 +36,8 @@ rtems_task Init(
#endif
rtems_print_printer_fprintf_putc(&rtems_test_printer);
rtems_test_begin();
TEST_BEGIN();
paranoia(1, args);
rtems_test_end();
exit( 0 );
TEST_END();
rtems_test_exit( 0 );
}

View File

@@ -22,6 +22,7 @@
#include <rtems/rtemspppd.h>
#include <rtems/shell.h>
#include "netconfig.h"
#include <tmacros.h>
const char rtems_test_name[] = "PPPD";
@@ -39,7 +40,7 @@ rtems_task Init(rtems_task_argument argument)
rtems_print_printer_fprintf_putc(&rtems_test_printer);
rtems_test_begin();
TEST_BEGIN();
status = rtems_shell_wait_for_input(
STDIN_FILENO,
@@ -48,7 +49,7 @@ rtems_task Init(rtems_task_argument argument)
NULL
);
if (status != RTEMS_SUCCESSFUL) {
rtems_test_end();
TEST_END();
exit( 0 );
}