forked from Imagelibrary/rtems
tests/samples: Use <rtems/test.h>
This commit is contained in:
@@ -37,6 +37,6 @@ rtems_task Application_task(
|
||||
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
||||
printf( "This task was invoked with the node argument (%" PRIdrtems_task_argument ")\n", node );
|
||||
printf( "This task has the id of 0x%" PRIxrtems_id "\n", tid );
|
||||
printf( "*** END OF SAMPLE MULTIPROCESSOR APPLICATION ***\n" );
|
||||
TEST_END();
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
/* forward declarations to avoid warnings */
|
||||
rtems_task Init(rtems_task_argument argument);
|
||||
|
||||
const char rtems_test_name[] = "SAMPLE MULTIPROCESSOR APPLICATION";
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
)
|
||||
@@ -26,7 +28,7 @@ rtems_task Init(
|
||||
rtems_id tid;
|
||||
rtems_status_code status;
|
||||
|
||||
printf( "\n\n*** SAMPLE MULTIPROCESSOR APPLICATION ***\n" );
|
||||
TEST_BEGIN();
|
||||
printf( "Creating and starting an application task\n" );
|
||||
task_name = rtems_build_name( 'T', 'A', '1', ' ' );
|
||||
status = rtems_task_create( task_name, 1, RTEMS_MINIMUM_STACK_SIZE,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
@@ -36,6 +37,8 @@ rtems_task Application_task(
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
/*
|
||||
* Put the overrides of default configuration parameters here.
|
||||
*/
|
||||
|
||||
@@ -41,6 +41,6 @@ rtems_task Application_task(
|
||||
"and has id of 0x%" PRIxrtems_id "\n", argument, tid
|
||||
);
|
||||
|
||||
printf( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
|
||||
TEST_END();
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
/* forward declarations to avoid warnings */
|
||||
rtems_task Init(rtems_task_argument argument);
|
||||
|
||||
const char rtems_test_name[] = "SAMPLE SINGLE PROCESSOR APPLICATION";
|
||||
|
||||
#define ARGUMENT 0
|
||||
|
||||
rtems_task Init(
|
||||
@@ -29,7 +31,7 @@ rtems_task Init(
|
||||
rtems_id tid;
|
||||
rtems_status_code status;
|
||||
|
||||
printf( "\n\n*** SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
|
||||
TEST_BEGIN();
|
||||
printf( "Creating and starting an application task\n" );
|
||||
|
||||
task_name = rtems_build_name( 'T', 'A', '1', ' ' );
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
@@ -33,6 +34,8 @@ rtems_task Application_task(
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -28,6 +28,8 @@ rtems_task Init(rtems_task_argument argument);
|
||||
static void notification(int fd, int seconds_remaining, void *arg);
|
||||
#endif
|
||||
|
||||
const char rtems_test_name[] = "CAPTURE ENGINE";
|
||||
|
||||
volatile int can_proceed = 1;
|
||||
|
||||
#if !BSP_SMALL_MEMORY
|
||||
@@ -51,7 +53,7 @@ rtems_task Init(
|
||||
rtems_task_priority old_priority;
|
||||
rtems_mode old_mode;
|
||||
|
||||
puts( "\n\n*** TEST CAPTURE ENGINE ***" );
|
||||
rtems_test_begin();
|
||||
|
||||
status = rtems_shell_wait_for_input(
|
||||
STDIN_FILENO,
|
||||
@@ -78,7 +80,7 @@ rtems_task Init(
|
||||
|
||||
rtems_task_delete (RTEMS_SELF);
|
||||
} else {
|
||||
puts( "*** END OF TEST CAPTURE ENGINE ***" );
|
||||
rtems_test_end();
|
||||
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
@@ -49,6 +50,8 @@ extern void setup_tasks_to_watch(void);
|
||||
|
||||
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS (5)
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/*
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
@@ -31,6 +32,8 @@
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
const char rtems_test_name[] = "CONSTRUCTOR/DESTRUCTOR";
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <tmacros.h>
|
||||
@@ -176,12 +179,11 @@ rtems_task main_task(
|
||||
rtems_task_argument
|
||||
)
|
||||
{
|
||||
printf( "\n\n*** CONSTRUCTOR/DESTRUCTOR TEST ***\n" );
|
||||
TEST_BEGIN();
|
||||
|
||||
cdtest();
|
||||
|
||||
printf( "*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***\n\n\n" );
|
||||
|
||||
TEST_END();
|
||||
|
||||
printf( "*** TESTING C++ EXCEPTIONS ***\n\n" );
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
@@ -33,6 +34,8 @@ rtems_task main_task(
|
||||
#define CONFIGURE_INIT_TASK_ENTRY_POINT main_task
|
||||
#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'C', 'T', 'O', 'R' )
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#include <rtems/nvdisk-sram.h>
|
||||
#include <rtems/shell.h>
|
||||
|
||||
const char rtems_test_name[] = "FILE I/O";
|
||||
|
||||
#if FILEIO_BUILD
|
||||
|
||||
/**
|
||||
@@ -1220,7 +1222,7 @@ Init (rtems_task_argument ignored)
|
||||
rtems_id Task_id;
|
||||
rtems_status_code status;
|
||||
|
||||
puts( "\n\n*** TEST FILE I/O SAMPLE ***" );
|
||||
TEST_BEGIN();
|
||||
|
||||
status = rtems_shell_wait_for_input(
|
||||
STDIN_FILENO,
|
||||
@@ -1244,7 +1246,7 @@ Init (rtems_task_argument ignored)
|
||||
status = rtems_task_delete( RTEMS_SELF );
|
||||
directive_failed( status, "delete" );
|
||||
} else {
|
||||
puts( "*** END OF TEST FILE I/O SAMPLE ***" );
|
||||
TEST_END();
|
||||
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
#include "tmacros.h"
|
||||
|
||||
/* functions */
|
||||
@@ -72,6 +73,9 @@ rtems_task Init(
|
||||
#define CONFIGURE_MALLOC_STATISTICS
|
||||
|
||||
#define CONFIGURE_UNIFIED_WORK_AREAS
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <rtems/test.h>
|
||||
|
||||
#include <bsp.h> /* for device driver prototypes */
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -19,13 +21,15 @@
|
||||
/* forward declarations to avoid warnings */
|
||||
rtems_task Init(rtems_task_argument argument);
|
||||
|
||||
const char rtems_test_name[] = "HELLO WORLD";
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
{
|
||||
printf( "\n\n*** HELLO WORLD TEST ***\n" );
|
||||
rtems_test_begin();
|
||||
printf( "Hello World\n" );
|
||||
printf( "*** END OF HELLO WORLD TEST ***\n" );
|
||||
rtems_test_end();
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
@@ -39,5 +43,7 @@ rtems_task Init(
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
const char rtems_test_name[] = "HELLO WORLD";
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
@@ -36,9 +38,9 @@ rtems_task Init(
|
||||
#if BSP_SMALL_MEMORY
|
||||
printf ("NO STDC++. MEMORY TOO SMALL");
|
||||
#else
|
||||
std::cout << "\n\n*** HELLO WORLD TEST ***" << std::endl;
|
||||
std::cout << "\n\n*** " << rtems_test_name << " TEST ***" << std::endl;
|
||||
std::cout << "Hello World" << std::endl;
|
||||
std::cout << "*** END OF HELLO WORLD TEST ***" << std::endl;
|
||||
std::cout << "*** END OF " << rtems_test_name << " TEST ***" << std::endl;
|
||||
#endif
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
@@ -33,6 +34,8 @@
|
||||
/* Only remove when this macro is removed from confdefs.h. It tests it. */
|
||||
#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <rtems/test.h>
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
const char rtems_test_name[] = "LOOPBACK";
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
@@ -33,6 +37,8 @@
|
||||
#define CONFIGURE_INIT
|
||||
rtems_task Init(rtems_task_argument argument);
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
#if !BSP_SMALL_MEMORY
|
||||
@@ -241,6 +247,8 @@ Init (rtems_task_argument ignored)
|
||||
{
|
||||
rtems_status_code sc;
|
||||
|
||||
rtems_test_begin();
|
||||
|
||||
sc = rtems_semaphore_create(rtems_build_name('P','m','t','x'),
|
||||
1,
|
||||
RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY|
|
||||
@@ -275,7 +283,7 @@ Init (rtems_task_argument ignored)
|
||||
spawnTask(clientTask, 120, 6);
|
||||
|
||||
rtems_task_wake_after(500);
|
||||
puts( "*** END OF LOOPBACK TEST ***" );
|
||||
rtems_test_end();
|
||||
exit( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include "tmacros.h"
|
||||
#include "pritime.h"
|
||||
|
||||
const char rtems_test_name[] = "NANOSECOND CLOCK";
|
||||
|
||||
static char *my_ctime( time_t t )
|
||||
{
|
||||
static char b[32];
|
||||
@@ -62,7 +64,7 @@ rtems_task Init(
|
||||
rtems_time_of_day time;
|
||||
int index;
|
||||
|
||||
puts( "\n\n*** NANOSECOND CLOCK TEST ***" );
|
||||
TEST_BEGIN();
|
||||
|
||||
time.year = 2007;
|
||||
time.month = 03;
|
||||
@@ -137,7 +139,7 @@ rtems_task Init(
|
||||
|
||||
sleep(1);
|
||||
|
||||
puts( "*** END OF NANOSECOND CLOCK TEST ***" );
|
||||
TEST_END();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef SYSTEM_H
|
||||
#define SYSTEM_H
|
||||
|
||||
#include <rtems/test.h>
|
||||
|
||||
#include <bsp.h> /* for device driver prototypes */
|
||||
|
||||
extern void dummy_function_empty_body_to_force_call(void);
|
||||
@@ -12,5 +14,7 @@ extern void dummy_function_empty_body_to_force_call(void);
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
extern int paranoia(int, char **);
|
||||
|
||||
const char rtems_test_name[] = "PARANOIA";
|
||||
|
||||
char *args[2] = { "paranoia", 0 };
|
||||
|
||||
rtems_task Init(
|
||||
@@ -37,9 +39,9 @@ rtems_task Init(
|
||||
M68KFPSPInstallExceptionHandlers ();
|
||||
#endif
|
||||
|
||||
printf( "\n\n*** PARANOIA TEST ***\n" );
|
||||
rtems_test_begin();
|
||||
paranoia(1, args);
|
||||
printf( "*** END OF PARANOIA TEST ***\n" );
|
||||
rtems_test_end();
|
||||
#endif /* BSP_SMALL_MEMORY */
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
@@ -34,6 +35,8 @@ rtems_task Init(
|
||||
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -24,11 +24,15 @@
|
||||
#include "netconfig.h"
|
||||
#endif
|
||||
|
||||
const char rtems_test_name[] = "PPPD";
|
||||
|
||||
rtems_task Init(rtems_task_argument argument)
|
||||
{
|
||||
#if BSP_SMALL_MEMORY
|
||||
printf("NO NETWORKING. MEMORY TOO SMALL");
|
||||
#else
|
||||
rtems_test_begin();
|
||||
|
||||
/* initialize network */
|
||||
rtems_bsdnet_initialize_network();
|
||||
rtems_pppd_initialize();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define SYSTEM_H
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
#include <rtems/console.h>
|
||||
#include <rtems/clockdrv.h>
|
||||
|
||||
@@ -40,6 +41,8 @@ extern int pppdapp_initialize(void);
|
||||
RTEMS_NO_ASR | \
|
||||
RTEMS_INTERRUPT_LEVEL(0))
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
|
||||
const char rtems_test_name[] = "CLOCK TICK";
|
||||
|
||||
/*
|
||||
* Keep the names and IDs in global variables so another task can use them.
|
||||
*/
|
||||
@@ -28,7 +30,7 @@ rtems_task Init(
|
||||
rtems_status_code status;
|
||||
rtems_time_of_day time;
|
||||
|
||||
puts( "\n\n*** CLOCK TICK TEST ***" );
|
||||
TEST_BEGIN();
|
||||
|
||||
time.year = 1988;
|
||||
time.month = 12;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/test.h>
|
||||
#include <inttypes.h>
|
||||
#include "tmacros.h"
|
||||
|
||||
@@ -48,6 +49,8 @@ extern rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
/*
|
||||
|
||||
@@ -37,7 +37,7 @@ rtems_task Test_task(
|
||||
for ( ; ; ) {
|
||||
status = rtems_clock_get_tod( &time );
|
||||
if ( time.second >= 35 ) {
|
||||
puts( "*** END OF CLOCK TICK TEST ***" );
|
||||
TEST_END();
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
put_name( Task_name[ task_index ], FALSE );
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
const char rtems_test_name[] = "UNLIMITED TASK";
|
||||
|
||||
rtems_id task_id[MAX_TASKS];
|
||||
|
||||
rtems_task Init(
|
||||
@@ -28,14 +30,14 @@ rtems_task Init(
|
||||
rtems_mode old_mode;
|
||||
uint32_t task;
|
||||
|
||||
TEST_BEGIN();
|
||||
|
||||
/* lower the task priority to allow created tasks to execute */
|
||||
|
||||
rtems_task_set_priority(
|
||||
RTEMS_SELF, RTEMS_MAXIMUM_PRIORITY - 1, &old_priority);
|
||||
rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode);
|
||||
|
||||
printf( "\n*** UNLIMITED TASK TEST ***\n" );
|
||||
|
||||
/*
|
||||
* Invalid state if the task id is 0
|
||||
*/
|
||||
@@ -47,7 +49,7 @@ rtems_task Init(
|
||||
test2();
|
||||
test3();
|
||||
|
||||
printf( "\n*** END OF UNLIMITED TASK TEST ***\n" );
|
||||
TEST_END();
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user