subsys/testsuite/ztest: create stub headers at CMake configure time
Create unittest stub headers at CMake configure time. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
parent
b1020b0bc8
commit
af78efaa4d
10 changed files with 21 additions and 49 deletions
|
@ -58,6 +58,27 @@ include(${ZEPHYR_BASE}/cmake/kobj.cmake)
|
||||||
add_dependencies(test_interface ${KOBJ_TYPES_H_TARGET})
|
add_dependencies(test_interface ${KOBJ_TYPES_H_TARGET})
|
||||||
gen_kobj(KOBJ_GEN_DIR)
|
gen_kobj(KOBJ_GEN_DIR)
|
||||||
|
|
||||||
|
# Generates empty header files to build
|
||||||
|
set(INCL_GENERATED_DIR ${APPLICATION_BINARY_DIR}/zephyr/include/generated)
|
||||||
|
set(INCL_GENERATED_SYSCALL_DIR ${INCL_GENERATED_DIR}/syscalls)
|
||||||
|
list(APPEND INCL_GENERATED_HEADERS
|
||||||
|
${INCL_GENERATED_DIR}/devicetree_generated.h
|
||||||
|
${INCL_GENERATED_DIR}/offsets.h
|
||||||
|
${INCL_GENERATED_DIR}/syscall_list.h
|
||||||
|
${INCL_GENERATED_DIR}/syscall_macros.h
|
||||||
|
${INCL_GENERATED_SYSCALL_DIR}/kernel.h
|
||||||
|
${INCL_GENERATED_SYSCALL_DIR}/kobject.h
|
||||||
|
${INCL_GENERATED_SYSCALL_DIR}/log_core.h
|
||||||
|
${INCL_GENERATED_SYSCALL_DIR}/log_ctrl.h
|
||||||
|
${INCL_GENERATED_SYSCALL_DIR}/log_msg.h
|
||||||
|
${INCL_GENERATED_SYSCALL_DIR}/sys_clock.h
|
||||||
|
)
|
||||||
|
|
||||||
|
file(MAKE_DIRECTORY ${INCL_GENERATED_SYSCALL_DIR})
|
||||||
|
foreach(header ${INCL_GENERATED_HEADERS})
|
||||||
|
file(TOUCH ${header})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
list(APPEND INCLUDE
|
list(APPEND INCLUDE
|
||||||
subsys/testsuite/ztest/include/zephyr
|
subsys/testsuite/ztest/include/zephyr
|
||||||
subsys/testsuite/include/zephyr
|
subsys/testsuite/include/zephyr
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
#ifndef __GEN_OFFSETS_H__
|
|
||||||
#define __GEN_OFFSETS_H__
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is a fake replacement for
|
|
||||||
* $build_dir/zephyr/include/generated/offsets.h
|
|
||||||
*
|
|
||||||
* The unittest infrastructure does not know how to generate
|
|
||||||
* offsets.h, so until this is supported we fake it with this
|
|
||||||
* file. This allows us to test source files that include offsets.h,
|
|
||||||
* but don't actually use anything from it when unit testing.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,3 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
|
@ -1,3 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
|
@ -1,3 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
|
@ -1,5 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2020 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
|
@ -1,5 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2019 Nordic Semiconductor ASA
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
|
@ -1,5 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2019 Nordic Semiconductor ASA
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
|
@ -1,5 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
|
@ -1,3 +0,0 @@
|
||||||
/*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
Loading…
Add table
Add a link
Reference in a new issue