forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot_test.h
More file actions
39 lines (33 loc) · 731 Bytes
/
boot_test.h
File metadata and controls
39 lines (33 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2023 Intel Corporation. All rights reserved.
*/
#ifndef __SOF_BOOT_TEST_H__
#define __SOF_BOOT_TEST_H__
#if !CONFIG_LIBRARY
#include <zephyr/logging/log.h>
#else
#define LOG_ERR(...) do {} while (0)
#endif
#include <stdbool.h>
#if CONFIG_SOF_BOOT_TEST
#define TEST_RUN_ONCE(fn, ...) do { \
static bool once; \
if (!once) { \
once = true; \
fn(__VA_ARGS__); \
} \
} while (0)
#else
#define TEST_RUN_ONCE(fn, ...) do {} while (0)
#endif
#define TEST_CHECK_RET(ret, testname) do { \
if ((ret) < 0) { \
LOG_ERR(testname " failed: %d", (ret)); \
ztest_test_fail(); \
} else { \
ztest_test_pass(); \
} \
} while (0)
void sof_run_boot_tests(void);
#endif