From a9691611c515d7ef57aa69d738909d607461b7b1 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Wed, 11 Nov 2020 11:42:48 -0700 Subject: zephyr/test/base32: change test to depend on less As we add more shim code and configs, we don't want to remove the functionality in all of the tests. Convert this test to only include the files it needs to link to perform the shim test. BRANCH=none BUG=b:172512307 TEST=base32 test builds and passes Signed-off-by: Jett Rink Change-Id: I4a7232c98397600d578e18b67935924b088f377b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532687 Reviewed-by: Jack Rosenthal --- zephyr/test/base32/CMakeLists.txt | 17 ++++++++++++++++- zephyr/test/base32/prj.conf | 1 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/zephyr/test/base32/CMakeLists.txt b/zephyr/test/base32/CMakeLists.txt index 2706e8986a..e6172218d6 100644 --- a/zephyr/test/base32/CMakeLists.txt +++ b/zephyr/test/base32/CMakeLists.txt @@ -5,4 +5,19 @@ set(BOARD native_posix) project(base32) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -target_sources(app PRIVATE ${PLATFORM_EC}/test/base32.c) +# Need to ensure that we are including only zephyr definitions in include files +# We cannot set these via kconfig, since this unit test does not bring in the +# zephyr-chrome repository +zephyr_compile_definitions("CONFIG_ZEPHYR") + +# We need to include the EC include directory and this local test directory +# for the task defines +zephyr_include_directories( + "${PLATFORM_EC}/zephyr/shim/include" + "${PLATFORM_EC}/fuzz" + "${PLATFORM_EC}/test" + "${PLATFORM_EC}/include") + +# Include test file, test under test and console dependency +target_sources(app PRIVATE "${PLATFORM_EC}/test/base32.c") +target_sources(app PRIVATE "${PLATFORM_EC}/common/base32.c") diff --git a/zephyr/test/base32/prj.conf b/zephyr/test/base32/prj.conf index 4d4bf11d07..3940ec99eb 100644 --- a/zephyr/test/base32/prj.conf +++ b/zephyr/test/base32/prj.conf @@ -3,4 +3,3 @@ # found in the LICENSE file. CONFIG_ZTEST=y -CONFIG_PLATFORM_EC=y -- cgit v1.2.1