2021-09-22 12:30:09 +08:00
|
|
|
/* Copyright (c) 2021 Google LLC
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MODULES_FFF_TEST_INCLUDE_C_TEST_FRAMEWORK_H_
|
|
|
|
#define MODULES_FFF_TEST_INCLUDE_C_TEST_FRAMEWORK_H_
|
|
|
|
|
2022-07-19 22:16:24 +08:00
|
|
|
#include <zephyr/ztest.h>
|
2022-05-06 17:09:00 +08:00
|
|
|
#include <zephyr/sys/printk.h>
|
2021-09-22 12:30:09 +08:00
|
|
|
|
|
|
|
void setup(void);
|
|
|
|
void fff_test_suite(void);
|
|
|
|
|
|
|
|
#define PRINTF(FMT, args...)
|
|
|
|
#define TEST_F(SUITE, NAME) __attribute__((unused)) static void test_##NAME(void)
|
|
|
|
#define RUN_TEST(SUITE, NAME) \
|
|
|
|
do { \
|
|
|
|
ztest_test_suite( \
|
|
|
|
SUITE##_##NAME, \
|
|
|
|
ztest_unit_test_setup_teardown(test_##NAME, setup, unit_test_noop)); \
|
|
|
|
ztest_run_test_suite(SUITE##_##NAME); \
|
|
|
|
} while (0)
|
|
|
|
#define ASSERT_EQ(A, B) zassert_equal((A), (B), NULL)
|
|
|
|
#define ASSERT_TRUE(A) zassert_true((A), NULL)
|
|
|
|
|
|
|
|
#endif /* MODULES_FFF_TEST_INCLUDE_C_TEST_FRAMEWORK_H_ */
|