1# SPDX-License-Identifier: Apache-2.0
2
3zephyr_syscall_header(
4  ${ZEPHYR_BASE}/subsys/testsuite/ztest/include/zephyr/ztest_error_hook.h
5  ${ZEPHYR_BASE}/subsys/testsuite/ztest/include/zephyr/ztest_test.h
6)
7
8zephyr_include_directories(
9  ${ZEPHYR_BASE}/subsys/testsuite/include
10  ${ZEPHYR_BASE}/subsys/testsuite/coverage
11  ${ZEPHYR_BASE}/subsys/testsuite/ztest/include
12  )
13
14if(DEFINED TC_RUNID)
15  zephyr_compile_definitions(TC_RUNID=${TC_RUNID})
16endif()
17
18zephyr_library()
19
20# For strtok_r() and strdup()
21zephyr_library_compile_options(-D_POSIX_C_SOURCE=200809L)
22
23zephyr_library_sources(
24  src/ztest.c
25  src/ztest_error_hook.c
26  src/ztest_rules.c
27	)
28zephyr_library_sources_ifdef(CONFIG_ZTEST_MOCKING  src/ztest_mock.c)
29zephyr_library_sources_ifdef(CONFIG_ZTRESS         src/ztress.c)
30
31
32if(CONFIG_ARCH_POSIX)
33  zephyr_library_sources(src/ztest_posix.c)
34elseif(CONFIG_ZTEST_SHELL)
35  zephyr_library_sources(src/ztest_shell.c)
36else()
37  zephyr_library_sources(src/ztest_defaults.c)
38endif()
39