25#include <rusefi/true_false.h>
26#include "efifeatures.h"
66static BaseSequentialStream *
chp;
77 chSequentialStreamPut(
chp,
'0');
81 *p++ = (n % 10) +
'0', n /= 10;
83 chSequentialStreamPut(
chp, *--p);
95 chSequentialStreamPut(
chp, *msgp++);
106 chSequentialStreamWrite(
chp, (
const uint8_t *)
"\r\n", 2);
121 chSequentialStreamPut(
chp, *cp++);
157 if (*cp++ != *expected++)
181 for (i = 0; i < MAX_THREADS; i++)
192 for (i = 0; i < MAX_THREADS; i++)
199#if CH_DBG_THREADS_PROFILING
209 start = chThdSelf()->p_time;
210 end = start + TIME_MS2I(duration);
212 now = chThdSelf()->p_time;
213#if defined(SIMULATOR)
217 while (end > start ? (now >= start) && (now < end) :
218 (now >= start) || (now < end));
242static VirtualTimer
vt;
258 chVTSet(&
vt, duration,
tmr, NULL);
270 for (i = 0; i < MAX_THREADS; i++)
273 if (tcp->
setup != NULL)
285 for (i = 0; i < 76; i++)
286 chSequentialStreamPut(
chp,
'-');
287 chSequentialStreamWrite(
chp, (
const uint8_t *)
"\r\n", 2);
307#ifdef CH_COMPILER_NAME
313#ifdef CH_CORE_VARIANT_NAME
344#if DELAY_BETWEEN_TESTS > 0
345 chThdSleepMilliseconds(DELAY_BETWEEN_TESTS);
bool _test_fail(unsigned point)
static char tokens_buffer[MAX_TOKENS]
static void execute_test(const struct testcase *tcp)
void test_wait_threads(void)
Waits for the completion of all the test-spawned threads.
void test_printn(uint32_t n)
Prints a decimal unsigned number.
msg_t TestThread(void *p)
Test execution thread function.
bool _test_assert_sequence(unsigned point, char *expected)
static BaseSequentialStream * chp
thread_t * threads[MAX_THREADS]
static void print_line(void)
static void clear_tokens(void)
void test_cpu_pulse(unsigned duration)
CPU pulse.
void test_terminate_threads(void)
Sets a termination request in all the test-spawned threads.
static void print_tokens(void)
void test_emit_token(char token)
Emits a token into the tokens buffer.
systime_t test_wait_tick(void)
Delays execution until next system time tick.
static ROMCONST struct testcase *ROMCONST * patterns[]
void test_start_timer(unsigned ms)
Starts the test timer.
bool _test_assert(unsigned point, bool condition)
void test_print(const char *msgp)
Prints a line without final end-of-line.
bool test_timer_done
Set to TRUE when the test timer reaches its deadline.
bool _test_assert_time_window(unsigned point, systime_t start, systime_t end)
void test_println(const char *msgp)
Prints a line.
static unsigned failpoint
Structure representing a test case.
void(* execute)(void)
Test case execution function.
void(* setup)(void)
Test case preparation function.
void(* teardown)(void)
Test case clean up function.
ROMCONST struct testcase *ROMCONST patternbmk[]
Test sequence for benchmarks.
Kernel Benchmarks header file.
struct test_buffers::@28 wa