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:51 +0000
commita9691611c515d7ef57aa69d738909d607461b7b1 (patch)
treeabaef1bd7b4d11c386d048aa80b4c7aaaa8b529a
parentee369dba3700d80de61d2e1693c7fdc52474edbc (diff)
downloadchrome-ec-a9691611c515d7ef57aa69d738909d607461b7b1.tar.gz
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 <jettrink@chromium.org> Change-Id: I4a7232c98397600d578e18b67935924b088f377b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532687 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--zephyr/test/base32/CMakeLists.txt17
-rw-r--r--zephyr/test/base32/prj.conf1
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