Sound Open Firmware
Loading...
Searching...
No Matches
boot_test.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
*
3
* Copyright(c) 2023 Intel Corporation. All rights reserved.
4
*/
5
6
#ifndef __SOF_BOOT_TEST_H__
7
#define __SOF_BOOT_TEST_H__
8
9
#if !CONFIG_LIBRARY
10
#include <zephyr/logging/log.h>
11
#else
12
#define LOG_ERR(...) do {} while (0)
13
#endif
14
#include <stdbool.h>
15
16
struct
k_thread;
17
18
#if CONFIG_SOF_BOOT_TEST
19
#define TEST_RUN_ONCE(fn, ...) do { \
20
static bool once; \
21
if (!once) { \
22
once = true; \
23
fn(__VA_ARGS__); \
24
} \
25
} while (0)
26
#else
27
#define TEST_RUN_ONCE(fn, ...) do {} while (0)
28
#endif
29
30
#define TEST_CHECK_RET(ret, testname) do { \
31
if ((ret) < 0) { \
32
LOG_ERR(testname " failed: %d", (ret)); \
33
ztest_test_fail(); \
34
} else { \
35
ztest_test_pass(); \
36
} \
37
} while (0)
38
39
void
sof_run_boot_tests
(
void
);
40
46
#if CONFIG_SOF_BOOT_TEST
47
void
sof_boot_test_set_fault_valid
(
struct
k_thread *thread);
48
#else
49
static
inline
void
sof_boot_test_set_fault_valid
(
struct
k_thread *thread)
50
{
51
(void)thread;
52
}
53
#endif
54
55
#endif
sof_run_boot_tests
void sof_run_boot_tests(void)
sof_boot_test_set_fault_valid
static void sof_boot_test_set_fault_valid(struct k_thread *thread)
Mark a boot-test thread as expected to trigger a fatal error.
Definition
boot_test.h:49
src
include
sof
boot_test.h
Generated by
1.15.0