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