Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
ztest.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
20#ifndef ZEPHYR_TESTSUITE_INCLUDE_ZTEST_H_
21#define ZEPHYR_TESTSUITE_INCLUDE_ZTEST_H_
22
27#if !defined(CONFIG_ZTEST) && !defined(ZTEST_UNITTEST)
28#error "You need to add CONFIG_ZTEST to your config file."
29#endif
30
31#ifndef KERNEL
32#define CONFIG_STDOUT_CONSOLE 1
33#define CONFIG_ZTEST_ASSERT_VERBOSE 1
34#define CONFIG_ZTEST_MOCKING
35#define CONFIG_NUM_COOP_PRIORITIES 16
36#define CONFIG_COOP_ENABLED 1
37#define CONFIG_PREEMPT_ENABLED 1
38#define CONFIG_MP_NUM_CPUS 1
39#define CONFIG_SYS_CLOCK_TICKS_PER_SEC 100
40#define CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC 10000000
41#define ARCH_STACK_PTR_ALIGN 8
42/* FIXME: Properly integrate with Zephyr's arch specific code */
43#define CONFIG_X86 1
44#define CONFIG_PRINTK 1
45#ifdef __cplusplus
46extern "C" {
47#endif
48struct esf;
49typedef struct esf z_arch_esf_t;
50#ifdef __cplusplus
51}
52#endif
53#endif /* KERNEL */
54
55#include <sys/printk.h>
56#define PRINT printk
57
58#include <zephyr.h>
59
60#include <ztest_assert.h>
61#include <ztest_mock.h>
62#include <ztest_test.h>
63#include <tc_util.h>
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69void test_main(void);
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif /* ZEPHYR_TESTSUITE_INCLUDE_ZTEST_H_ */
void test_main(void)
Definition: main.c:120
Zephyr testing framework assertion macros.
Ztest mocking support.
Zephyr testing framework _test.