summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-11-06 15:42:46 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-07 02:52:46 +0000
commit5773fade5e363800a9d8d1952f45c4dd4c49fd8e (patch)
tree1368c7b7869889d38ed3896a10357de804476a2b
parentd0a914b5b4537021da6b170abeca18503b90cee2 (diff)
downloadchrome-ec-5773fade5e363800a9d8d1952f45c4dd4c49fd8e.tar.gz
test_util: use ztest only if CONFIG_ZTEST is defined, not CONFIG_ZEPHYR
This header can be included from shimmed modules for an actual build (not just tests). In that case, CONFIG_ZEPHYR would be defined, but not CONFIG_ZTEST, and headers like ztest.h are not available. BUG=b:172678200 BRANCH=none TEST=compile both host_command.c and hooks test Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I24c704f6288eac9a8ca53580ec00e43073a6fef0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2522968 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rw-r--r--include/test_util.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/test_util.h b/include/test_util.h
index 159aac2d61..10cc415401 100644
--- a/include/test_util.h
+++ b/include/test_util.h
@@ -8,7 +8,7 @@
#ifndef __CROS_EC_TEST_UTIL_H
#define __CROS_EC_TEST_UTIL_H
-#ifdef CONFIG_ZEPHYR
+#ifdef CONFIG_ZTEST
#include <ztest.h>
@@ -24,7 +24,7 @@
#define EC_TEST_RETURN void
#define EC_SUCCESS
-#else /* CONFIG_ZEPHYR */
+#else /* CONFIG_ZTEST */
#include "common.h"
#include "console.h"
@@ -354,6 +354,6 @@ int test_attach_i2c(const int port, const uint16_t slave_addr_flags);
#define zassert_mem_equal(buf, exp, size, msg, ...) \
TEST_ASSERT_ARRAY_EQ(buf, exp, size)
-#endif /* CONFIG_ZEPHYR */
+#endif /* CONFIG_ZTEST */
#endif /* __CROS_EC_TEST_UTIL_H */