Commit af78efaa authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Carles Cufi
Browse files

subsys/testsuite/ztest: create stub headers at CMake configure time



Create unittest stub headers at CMake configure time.

Signed-off-by: default avatarYong Cong Sin <ycsin@meta.com>
parent b1020b0b
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -58,6 +58,27 @@ include(${ZEPHYR_BASE}/cmake/kobj.cmake)
add_dependencies(test_interface ${KOBJ_TYPES_H_TARGET})
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
  subsys/testsuite/ztest/include/zephyr
  subsys/testsuite/include/zephyr
+0 −17
Original line number Diff line number Diff line
/*
 * 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
+0 −3
Original line number Diff line number Diff line
/*
 * SPDX-License-Identifier: Apache-2.0
 */
+0 −3
Original line number Diff line number Diff line
/*
 * SPDX-License-Identifier: Apache-2.0
 */
+0 −3
Original line number Diff line number Diff line
/*
 * SPDX-License-Identifier: Apache-2.0
 */
Loading