blob: 098e4aea7b669093b1e9234721b5956e950037eb [file] [log] [blame]
#
# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
include(UnitTest)
unit_test_add_suite(
NAME fdt
SOURCES
${CMAKE_CURRENT_LIST_DIR}/test_fdt.cpp
${TF_A_UNIT_TESTS_PATH}/mocks/common/debug.cpp
${TF_A_PATH}/common/fdt_wrappers.c
${TF_A_PATH}/lib/libc/strlcpy.c
${TF_A_PATH}/lib/libfdt/fdt.c
${TF_A_PATH}/lib/libfdt/fdt_addresses.c
${TF_A_PATH}/lib/libfdt/fdt_empty_tree.c
${TF_A_PATH}/lib/libfdt/fdt_overlay.c
${TF_A_PATH}/lib/libfdt/fdt_ro.c
${TF_A_PATH}/lib/libfdt/fdt_rw.c
${TF_A_PATH}/lib/libfdt/fdt_strerror.c
${TF_A_PATH}/lib/libfdt/fdt_sw.c
${TF_A_PATH}/lib/libfdt/fdt_wip.c
INCLUDE_DIRECTORIES
${TF_A_UNIT_TESTS_PATH}/mocks/include/
${TF_A_UNIT_TESTS_PATH}/mocks/include/lib/libc/
${TF_A_PATH}/include/
${TF_A_PATH}/include/lib/libfdt/
COMPILE_DEFINITIONS
# Several additional DTB files from the Linux kernel and the TFA source
# are needed to run these tests. They cannot be included here due to
# license restrictions but can be built from the sources using the
# script device_trees/build_dtb.sh. The script takes the paths to these
# two source repositories as arguments, builds the DTB files, and places
# them in a folder here called dtb.
TFA_FVP_DTB_PATH="${CMAKE_CURRENT_LIST_DIR}/device_trees/dtb/fvp-base-gicv3-psci.dtb"
LINUX64_JUNO_R1_DTB="${CMAKE_CURRENT_LIST_DIR}/device_trees/dtb/juno-r1.dtb"
LINUX64_SUN50I_PINE64_PLUS_DTB="${CMAKE_CURRENT_LIST_DIR}/device_trees/dtb/sun50i-a64-pine64-plus.dtb"
LINUX32_ATLAS7_EVB_DTB="${CMAKE_CURRENT_LIST_DIR}/device_trees/dtb/atlas7-evb.dtb"
LINUX32_BCM2837_RPI_3_B_DTB="${CMAKE_CURRENT_LIST_DIR}/device_trees/dtb/bcm2837-rpi-3-b-plus.dtb"
TEST_DTB="${CMAKE_CURRENT_LIST_DIR}/device_trees/dtb/test.dtb"
)