mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 01:39:57 +08:00
testsuite: Using RTEMS tester functions at beginning and at the end of tests
puts() was replaced with rtems_test_begin() and rtems_test_end()
This commit is contained in:
parent
508836451b
commit
89be2af266
@ -39,6 +39,7 @@
|
|||||||
#include <rtems/console.h>
|
#include <rtems/console.h>
|
||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#define TEST_NAME "LIBBSD EVDEV"
|
#define TEST_NAME "LIBBSD EVDEV"
|
||||||
|
|
||||||
@ -563,7 +564,7 @@ Init(rtems_task_argument arg)
|
|||||||
struct evdev_test_message msg;
|
struct evdev_test_message msg;
|
||||||
|
|
||||||
(void) arg;
|
(void) arg;
|
||||||
puts("*** " TEST_NAME " TEST ***");
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
sc = rtems_semaphore_create(
|
sc = rtems_semaphore_create(
|
||||||
rtems_build_name('E', 'V', 'D', 'S'),
|
rtems_build_name('E', 'V', 'D', 'S'),
|
||||||
@ -696,6 +697,8 @@ Init(rtems_task_argument arg)
|
|||||||
sc = rtems_semaphore_delete(psema);
|
sc = rtems_semaphore_delete(psema);
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
rtems_test_end(TEST_NAME);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <rtems/printer.h>
|
#include <rtems/printer.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
#include <rtems/stackchk.h>
|
#include <rtems/stackchk.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ static void default_on_exit( int exit_code, void *arg )
|
|||||||
rtems_stack_checker_report_usage_with_plugin(&printer);
|
rtems_stack_checker_report_usage_with_plugin(&printer);
|
||||||
|
|
||||||
if ( exit_code == 0 ) {
|
if ( exit_code == 0 ) {
|
||||||
puts( "*** END OF TEST " TEST_NAME " ***" );
|
rtems_test_end(TEST_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ rtems_task Init(
|
|||||||
*/
|
*/
|
||||||
rtems_bsd_setlogpriority("debug");
|
rtems_bsd_setlogpriority("debug");
|
||||||
|
|
||||||
puts( "*** " TEST_NAME " TEST ***" );
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BSD must support the new "shared IRQ PIC implementation" at this point.
|
* BSD must support the new "shared IRQ PIC implementation" at this point.
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
|
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
#include <rtems/printer.h>
|
#include <rtems/printer.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
#include <rtems/stackchk.h>
|
#include <rtems/stackchk.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
#include <rtems/bsd/modules.h>
|
#include <rtems/bsd/modules.h>
|
||||||
@ -170,7 +171,7 @@ default_network_on_exit(int exit_code, void *arg)
|
|||||||
rtems_stack_checker_report_usage_with_plugin(&printer);
|
rtems_stack_checker_report_usage_with_plugin(&printer);
|
||||||
|
|
||||||
if (exit_code == 0) {
|
if (exit_code == 0) {
|
||||||
puts("*** END OF TEST " TEST_NAME " ***");
|
rtems_test_end(TEST_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +192,7 @@ Init(rtems_task_argument arg)
|
|||||||
rtems_bsd_setlogpriority("debug");
|
rtems_bsd_setlogpriority("debug");
|
||||||
|
|
||||||
(void)arg;
|
(void)arg;
|
||||||
puts("*** " TEST_NAME " TEST ***");
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
on_exit(default_network_on_exit, NULL);
|
on_exit(default_network_on_exit, NULL);
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <rtems/printer.h>
|
#include <rtems/printer.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
#include <rtems/stackchk.h>
|
#include <rtems/stackchk.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ static void default_on_exit( int exit_code, void *arg )
|
|||||||
rtems_stack_checker_report_usage_with_plugin(&printer);
|
rtems_stack_checker_report_usage_with_plugin(&printer);
|
||||||
|
|
||||||
if ( exit_code == 0 ) {
|
if ( exit_code == 0 ) {
|
||||||
puts( "*** END OF TEST " TEST_NAME " ***" );
|
rtems_test_end(TEST_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ rtems_task Init(
|
|||||||
*/
|
*/
|
||||||
rtems_bsd_setlogpriority("debug");
|
rtems_bsd_setlogpriority("debug");
|
||||||
|
|
||||||
puts( "*** " TEST_NAME " TEST ***" );
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BSD must support the new "shared IRQ PIC implementation" at this point.
|
* BSD must support the new "shared IRQ PIC implementation" at this point.
|
||||||
|
@ -36,9 +36,12 @@
|
|||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
|
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#include "swi_test.h"
|
#include "swi_test.h"
|
||||||
|
|
||||||
|
#define TEST_NAME "LIBBSD SOFTWARE INTERRUPT 1"
|
||||||
|
|
||||||
uintptr_t rtems_bsd_allocator_domain_page_mbuf_size =
|
uintptr_t rtems_bsd_allocator_domain_page_mbuf_size =
|
||||||
RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT;
|
RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT;
|
||||||
|
|
||||||
@ -46,14 +49,14 @@ static void Init(rtems_task_argument arg)
|
|||||||
{
|
{
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
|
|
||||||
puts("\n\n*** TEST SOFTWARE INTERRUPT 1 ***");
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
sc = rtems_bsd_initialize();
|
sc = rtems_bsd_initialize();
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
swi_test();
|
swi_test();
|
||||||
|
|
||||||
puts("*** END OF TEST SOFTWARE INTERRUPT 1 ***");
|
rtems_test_end(TEST_NAME);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -700,8 +700,6 @@ test_main(void)
|
|||||||
char c;
|
char c;
|
||||||
struct termios orig_termios, test_termios;
|
struct termios orig_termios, test_termios;
|
||||||
|
|
||||||
puts( "*** " TEST_NAME " TEST ***" );
|
|
||||||
|
|
||||||
test_termios_make_dev();
|
test_termios_make_dev();
|
||||||
|
|
||||||
status = rtems_shell_wait_for_input(
|
status = rtems_shell_wait_for_input(
|
||||||
|
@ -36,9 +36,12 @@
|
|||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
|
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#include "timeout_test.h"
|
#include "timeout_test.h"
|
||||||
|
|
||||||
|
#define TEST_NAME "LIBBSD TIMEOUT 1"
|
||||||
|
|
||||||
uintptr_t rtems_bsd_allocator_domain_page_mbuf_size =
|
uintptr_t rtems_bsd_allocator_domain_page_mbuf_size =
|
||||||
RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT;
|
RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT;
|
||||||
|
|
||||||
@ -46,14 +49,14 @@ static void Init(rtems_task_argument arg)
|
|||||||
{
|
{
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
|
|
||||||
puts("\n\n*** TEST TIMOUT 1 ***");
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
sc = rtems_bsd_initialize();
|
sc = rtems_bsd_initialize();
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
timeout_test();
|
timeout_test();
|
||||||
|
|
||||||
puts("*** END OF TEST TIMOUT 1 ***");
|
rtems_test_end(TEST_NAME);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include <rtems/media.h>
|
#include <rtems/media.h>
|
||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#define TEST_NAME "LIBBSD USB 1"
|
#define TEST_NAME "LIBBSD USB 1"
|
||||||
|
|
||||||
@ -88,7 +89,7 @@ Init(rtems_task_argument arg)
|
|||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
|
|
||||||
(void) arg;
|
(void) arg;
|
||||||
puts( "*** " TEST_NAME " TEST ***" );
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
sc = rtems_bdbuf_init();
|
sc = rtems_bdbuf_init();
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
@ -114,6 +115,8 @@ Init(rtems_task_argument arg)
|
|||||||
false, true, NULL);
|
false, true, NULL);
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
rtems_test_end(TEST_NAME);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include <rtems/console.h>
|
#include <rtems/console.h>
|
||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#define TEST_NAME "LIBBSD USB KEYBOARD"
|
#define TEST_NAME "LIBBSD USB KEYBOARD"
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ Init(rtems_task_argument arg)
|
|||||||
struct usb_test_message msg;
|
struct usb_test_message msg;
|
||||||
|
|
||||||
(void) arg;
|
(void) arg;
|
||||||
puts("*** " TEST_NAME " TEST ***");
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
sc = rtems_message_queue_create(
|
sc = rtems_message_queue_create(
|
||||||
rtems_build_name ('M', 'U', 'O', 'P'),
|
rtems_build_name ('M', 'U', 'O', 'P'),
|
||||||
@ -209,6 +210,8 @@ Init(rtems_task_argument arg)
|
|||||||
sc = rtems_message_queue_delete(omid);
|
sc = rtems_message_queue_delete(omid);
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
rtems_test_end(TEST_NAME);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <rtems/console.h>
|
#include <rtems/console.h>
|
||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#define TEST_NAME "LIBBSD USB MOUSE"
|
#define TEST_NAME "LIBBSD USB MOUSE"
|
||||||
|
|
||||||
@ -146,7 +147,7 @@ Init(rtems_task_argument arg)
|
|||||||
struct usb_test_message msg;
|
struct usb_test_message msg;
|
||||||
|
|
||||||
(void) arg;
|
(void) arg;
|
||||||
puts("*** " TEST_NAME " TEST ***");
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
sc = rtems_message_queue_create(
|
sc = rtems_message_queue_create(
|
||||||
rtems_build_name ('M', 'U', 'O', 'P'),
|
rtems_build_name ('M', 'U', 'O', 'P'),
|
||||||
@ -214,6 +215,8 @@ Init(rtems_task_argument arg)
|
|||||||
sc = rtems_message_queue_delete(omid);
|
sc = rtems_message_queue_delete(omid);
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
rtems_test_end(TEST_NAME);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <rtems/console.h>
|
#include <rtems/console.h>
|
||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
#include <rtems/bsd/bsd.h>
|
#include <rtems/bsd/bsd.h>
|
||||||
|
#include <rtems/test.h>
|
||||||
|
|
||||||
#define TEST_NAME "LIBBSD USB SERIAL"
|
#define TEST_NAME "LIBBSD USB SERIAL"
|
||||||
|
|
||||||
@ -177,7 +178,7 @@ Init(rtems_task_argument arg)
|
|||||||
struct usb_test_message msg;
|
struct usb_test_message msg;
|
||||||
|
|
||||||
(void) arg;
|
(void) arg;
|
||||||
puts("*** " TEST_NAME " TEST ***");
|
rtems_test_begin(TEST_NAME, TEST_STATE);
|
||||||
|
|
||||||
sc = rtems_message_queue_create(
|
sc = rtems_message_queue_create(
|
||||||
rtems_build_name ('M', 'U', 'O', 'P'),
|
rtems_build_name ('M', 'U', 'O', 'P'),
|
||||||
@ -271,6 +272,8 @@ Init(rtems_task_argument arg)
|
|||||||
sc = rtems_message_queue_delete(omid);
|
sc = rtems_message_queue_delete(omid);
|
||||||
assert(sc == RTEMS_SUCCESSFUL);
|
assert(sc == RTEMS_SUCCESSFUL);
|
||||||
|
|
||||||
|
rtems_test_end(TEST_NAME);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,7 +520,7 @@ class Builder(builder.ModuleManager):
|
|||||||
for testName in sorted(tests):
|
for testName in sorted(tests):
|
||||||
test = self.data['tests'][testName]['all']
|
test = self.data['tests'][testName]['all']
|
||||||
test_source = []
|
test_source = []
|
||||||
libs = ['bsd', 'm', 'z']
|
libs = ['bsd', 'm', 'z', 'rtemstest']
|
||||||
for cfg in test:
|
for cfg in test:
|
||||||
build_test = True
|
build_test = True
|
||||||
if cfg != 'default':
|
if cfg != 'default':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user