Files
bacnet_stack/zephyr/tests/unit/bacnet/bacint/CMakeLists.txt
T
Greg Shue 7f7b419411 Fix decode_signed32(); Add unit/bacnet/bacint tests (#392)
Fix decode_signed32() length for -8388608 and NULL apdu handling.

Add comprehensive unit tests for bacint.c functionality.

Verified by:

1. (Pass) From $bacnet-stack/test:
            make clean test
2. (Pass) From $workspace (above $bacnet-stack):
            west build -p always -b unit_testing \
              bacnet-stack/zephyr/tests/unit/bacnet/bacint/ && \
            ./build/testbinary

3. (Pass) From $workspace (above $bacnet-stack):
            ./zephyr/scripts/twister -p unit_testing \
              -T bacnet-stack/zephyr/tests/unit/bacnet/bacint/

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>
Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2023-02-03 09:47:42 -06:00

27 lines
780 B
CMake

# Copyright (c) 2022 Legrand North America, LLC.
#
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
if(NOT ZEPHYR_CURRENT_MODULE_DIR)
string(REGEX REPLACE "/zephyr/tests/[a-zA-Z_/-]*$" ""
ZEPHYR_CURRENT_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()
set(SOURCES
${ZEPHYR_CURRENT_MODULE_DIR}/test/unit/bacnet/bacint/src/main.c
)
project(bacnet_bacint)
find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
# NOTE for Zephyr >= v3.2.0:
# - Zephyr unittest builds for target 'testbinary' instead of 'app'.
# - Zephyr unittest does not generate ZEPHYR_<modulename>_MODULE_DIR.
# So we have to use relative paths to get to the source.
target_include_directories(testbinary PRIVATE
${ZEPHYR_CURRENT_MODULE_DIR}/src
)