52 bool always_set_to_false,
59 #define RTEMS_TEST_INITIAL_EXTENSION \ 60 { NULL, NULL, NULL, NULL, NULL, NULL, NULL, rtems_test_fatal_extension } 67 RTEMS_TEST_STATE_PASS,
68 RTEMS_TEST_STATE_FAIL,
69 RTEMS_TEST_STATE_USER_INPUT,
70 RTEMS_TEST_STATE_INDETERMINATE,
71 RTEMS_TEST_STATE_BENCHMARK
74 #if (TEST_STATE_EXPECTED_FAIL && TEST_STATE_USER_INPUT) || \ 75 (TEST_STATE_EXPECTED_FAIL && TEST_STATE_INDETERMINATE) || \ 76 (TEST_STATE_EXPECTED_FAIL && TEST_STATE_BENCHMARK) || \ 77 (TEST_STATE_USER_INPUT && TEST_STATE_INDETERMINATE) || \ 78 (TEST_STATE_USER_INPUT && TEST_STATE_BENCHMARK) || \ 79 (TEST_STATE_INDETERMINATE && TEST_STATE_BENCHMARK) 80 #error Test states must be unique 83 #if TEST_STATE_EXPECTED_FAIL 84 #define TEST_STATE RTEMS_TEST_STATE_FAIL 85 #elif TEST_STATE_USER_INPUT 86 #define TEST_STATE RTEMS_TEST_STATE_USER_INPUT 87 #elif TEST_STATE_INDETERMINATE 88 #define TEST_STATE RTEMS_TEST_STATE_INDETERMINATE 89 #elif TEST_STATE_BENCHMARK 90 #define TEST_STATE RTEMS_TEST_STATE_BENCHMARK 92 #define TEST_STATE RTEMS_TEST_STATE_PASS 122 #define RTEMS_TEST_PARALLEL_PROCESSOR_MAX 32 133 rtems_id worker_ids[RTEMS_TEST_PARALLEL_PROCESSOR_MAX];
176 size_t active_workers
192 size_t active_workers,
210 size_t active_workers
240 return _Atomic_Load_ulong(&ctx->stop, ATOMIC_ORDER_RELAXED) != 0;
255 return worker_index == 0;
271 return ctx->worker_ids[worker_index];
static bool rtems_test_parallel_is_master_worker(size_t worker_index)
Indicates if a worker is the master worker.
rtems_interval(* init)(rtems_test_parallel_context *ctx, void *arg, size_t active_workers)
Job initialization handler.
const char rtems_test_name[]
Each test must define a test name string.
void(* rtems_test_parallel_worker_setup)(rtems_test_parallel_context *ctx, size_t worker_index, rtems_id worker_id)
Worker task setup handler.
Basic parallel job description.
RTEMS_TEST_STATE
Test states.
int rtems_test_begin(const char *name, const RTEMS_TEST_STATE state)
Prints a begin of test message using printf().
int rtems_test_printf(const char *format,...) RTEMS_PRINTFLIKE(1
Prints via the RTEMS printer.
CPU_Uint32ptr rtems_task_argument
This type is used to represent task argument values.
int rtems_test_end(const char *name)
Prints an end of test message using printf().
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
static bool rtems_test_parallel_stop_job(const rtems_test_parallel_context *ctx)
Indicates if a job body should stop its work loop.
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 tas...
#define RTEMS_NO_RETURN
Tells the compiler in a function declaration that this function does not return.
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...
Internal context for parallel job execution.
bool cascade
Job cascading flag.
void(* fini)(rtems_test_parallel_context *ctx, void *arg, size_t active_workers)
Job finalization handler.
void * arg
Job specific argument.
RTEMS_NO_RETURN RTEMS_PRINTFLIKE(1, 2) void rtems_panic(const char *fmt
%
This header file defines the RTEMS Classic API.
rtems_printer rtems_test_printer
Each test must define a printer.
Watchdog_Interval rtems_interval
This type is used to represent clock tick intervals.
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 executin...
Internal_errors_t rtems_fatal_code
%
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.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
void(* body)(rtems_test_parallel_context *ctx, void *arg, size_t active_workers, size_t worker_index)
Job body handler.
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.
User print interface to the bspIO print plug in.
void rtems_test_fatal_extension(rtems_fatal_source source, bool always_set_to_false, rtems_fatal_code code)
Fatal extension for tests.