summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-11-11 11:42:48 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-12 03:51:50 +0000
commitee369dba3700d80de61d2e1693c7fdc52474edbc (patch)
tree1e2be82135a58a264d664f483af3f06ecf6a4cd8
parentd28c10498cdbf007b97b5c0a9a951373574d4eea (diff)
downloadchrome-ec-ee369dba3700d80de61d2e1693c7fdc52474edbc.tar.gz
zephyr/test/hooks: 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 hooks test to only include the two files it needs to link to perform the shim test. BRANCH=none BUG=b:172512307 TEST=hooks test builds and passes Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I0613670fe3cc056e33035ccc5ad1418e5e3d6db0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532686 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--zephyr/test/hooks/CMakeLists.txt18
-rw-r--r--zephyr/test/hooks/prj.conf6
2 files changed, 18 insertions, 6 deletions
diff --git a/zephyr/test/hooks/CMakeLists.txt b/zephyr/test/hooks/CMakeLists.txt
index 9c6f0058fe..1347a8f75f 100644
--- a/zephyr/test/hooks/CMakeLists.txt
+++ b/zephyr/test/hooks/CMakeLists.txt
@@ -3,7 +3,25 @@
# found in the LICENSE file.
cmake_minimum_required(VERSION 3.13.1)
+set(BOARD native_posix)
project(hooks)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
+# 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")
+zephyr_compile_definitions("CONFIG_PLATFORM_EC_HOOKS")
+
+# 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 hooks.c)
+target_sources(app PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../shim/src/hooks.c")
+target_sources(app PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../shim/src/console.c")
diff --git a/zephyr/test/hooks/prj.conf b/zephyr/test/hooks/prj.conf
index 43c0c9b8e5..3940ec99eb 100644
--- a/zephyr/test/hooks/prj.conf
+++ b/zephyr/test/hooks/prj.conf
@@ -3,9 +3,3 @@
# found in the LICENSE file.
CONFIG_ZTEST=y
-CONFIG_PLATFORM_EC=y
-
-# TODO(b/172512307): timer introduces dependency on system module,
-# which has build issues right now for native_posix board. Remove
-# this once the system module has been corrected.
-CONFIG_PLATFORM_EC_TIMER=n