Test support functions.
More...
|
enum | RTEMS_TEST_STATE {
RTEMS_TEST_STATE_PASS,
RTEMS_TEST_STATE_FAIL,
RTEMS_TEST_STATE_USER_INPUT,
RTEMS_TEST_STATE_INDETERMINATE,
RTEMS_TEST_STATE_BENCHMARK
} |
| Test states.
|
|
|
void | rtems_test_fatal_extension (rtems_fatal_source source, bool always_set_to_false, rtems_fatal_code code) |
| Fatal extension for tests.
|
|
int | rtems_test_begin (const char *name, const RTEMS_TEST_STATE state) |
| Prints a begin of test message using printf(). More...
|
|
int | rtems_test_end (const char *name) |
| Prints an end of test message using printf(). More...
|
|
void | rtems_test_exit (int status) RTEMS_NO_RETURN |
| Exit the test without calling exit() since it closes stdin, etc and pulls in stdio code.
|
|
int | rtems_test_printf (const char *format,...) RTEMS_PRINTFLIKE(1 |
| Prints via the RTEMS printer. More...
|
|
static bool | rtems_test_parallel_stop_job (const rtems_test_parallel_context *ctx) |
| Indicates if a job body should stop its work loop. More...
|
|
static bool | rtems_test_parallel_is_master_worker (size_t worker_index) |
| Indicates if a worker is the master worker. More...
|
|
static rtems_id | rtems_test_parallel_get_task_id (const rtems_test_parallel_context *ctx, size_t worker_index) |
| Returns the task identifier for a worker. More...
|
|
void | rtems_test_parallel (rtems_test_parallel_context *ctx, rtems_test_parallel_worker_setup worker_setup, const rtems_test_parallel_job *jobs, size_t job_count) |
| Runs a bunch of jobs in parallel on all processors of the system. More...
|
|
void | rtems_test_busy_cpu_usage (time_t seconds, long nanoseconds) |
| Performs a busy loop for the specified seconds and nanoseconds based on the CPU usage of the executing thread. More...
|
|
RTEMS_NO_RETURN void | rtems_test_run (rtems_task_argument arg, const RTEMS_TEST_STATE state) |
| Runs the test cases of the RTEMS Test Framework using a default configuration in the context of a task. More...
|
|
Test support functions.
◆ rtems_test_parallel_worker_setup
Worker task setup handler.
Called during rtems_test_parallel() to optionally setup a worker task before it is started.
- Parameters
-
[in] | ctx | The parallel context. |
[in] | worker_index | The worker index. |
[in] | worker_id | The worker task identifier. |
Definition at line 149 of file test-info.h.
◆ rtems_test_begin()
Prints a begin of test message using printf().
- Returns
- As specified by printf().
Definition at line 38 of file testbeginend.c.
◆ rtems_test_busy_cpu_usage()
void rtems_test_busy_cpu_usage |
( |
time_t |
seconds, |
|
|
long |
nanoseconds |
|
) |
| |
Performs a busy loop for the specified seconds and nanoseconds based on the CPU usage of the executing thread.
This function continuously reads the CPU usage of the executing thread. This operation may lead to a scheduler instance lock contention in SMP configurations.
- Parameters
-
[in] | seconds | The busy seconds. |
[in] | nanoseconds | The busy nanoseconds. |
◆ rtems_test_end()
int rtems_test_end |
( |
const char * |
name | ) |
|
Prints an end of test message using printf().
- Returns
- As specified by printf().
Definition at line 75 of file testbeginend.c.
◆ rtems_test_parallel()
Runs a bunch of jobs in parallel on all processors of the system.
The worker tasks inherit the priority of the executing task.
There are SMP barriers before and after the job body.
- Parameters
-
[in] | ctx | The parallel context. |
[in] | worker_setup | Optional handler to setup a worker task before it is started. |
[in] | jobs | The table of jobs. |
[in] | job_count | The count of jobs in the job table. |
◆ rtems_test_parallel_get_task_id()
Returns the task identifier for a worker.
- Parameters
-
[in] | ctx | The parallel context. |
[in] | worker_index | The worker index. |
- Returns
- The task identifier of the worker.
Definition at line 266 of file test-info.h.
◆ rtems_test_parallel_is_master_worker()
static bool rtems_test_parallel_is_master_worker |
( |
size_t |
worker_index | ) |
|
|
inlinestatic |
Indicates if a worker is the master worker.
The master worker is the thread that called rtems_test_parallel().
- Parameters
-
[in] | worker_index | The worker index. |
- Return values
-
true | This is the master worker. |
false | Otherwise. |
Definition at line 253 of file test-info.h.
◆ rtems_test_parallel_stop_job()
Indicates if a job body should stop its work loop.
- Parameters
-
[in] | ctx | The parallel context. |
- Return values
-
true | The job body should stop its work loop and return to the caller. |
false | Otherwise. |
Definition at line 236 of file test-info.h.
◆ rtems_test_printf()
int rtems_test_printf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Prints via the RTEMS printer.
- Returns
- As specified by printf().
◆ rtems_test_run()
Runs the test cases of the RTEMS Test Framework using a default configuration in the context of a task.
The application must provide rtems_test_name.
- Parameters
-
arg | is the task argument. |
state | is the test state. |
Definition at line 72 of file testrun.c.