summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2022-08-24 23:50:52 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-31 18:05:06 +0000
commit887a3f6c0e556bfb8308cf124edf087e53635ea8 (patch)
treead7dbe259962aa2bdfacd75d75b2d31978b44257 /builtin
parent5242100ccb366df8c3a5c6897733f02c8c31cabd (diff)
downloadchrome-ec-887a3f6c0e556bfb8308cf124edf087e53635ea8.tar.gz
test: Add basic tests exercising the panic output API
Exercise some of the panic output API. Some of the basic printing API cannot yet be fully tested. But a fix upstream is coming to allow us to use the 'console' harness features to parse the output log and pass/fail the test based on output. BRANCH=none BUG=none TEST=twister -s zephyr/test/drivers/drivers.default Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I8e56e8bcdaa0e095891c38a26e56ced8f3a8d4d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3855593 Reviewed-by: Simon Glass <sjg@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/assert.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/assert.h b/builtin/assert.h
index 010198fd1b..7008e24976 100644
--- a/builtin/assert.h
+++ b/builtin/assert.h
@@ -11,6 +11,8 @@
/* Include CONFIG definitions for EC sources. */
#ifndef THIRD_PARTY
#include "common.h"
+#else
+#define test_mockable_noreturn noreturn
#endif
#ifdef __cplusplus
@@ -21,7 +23,7 @@ extern "C" {
#ifdef CONFIG_DEBUG_ASSERT_REBOOTS
#ifdef CONFIG_DEBUG_ASSERT_BRIEF
-noreturn void panic_assert_fail(const char *fname, int linenum);
+test_mockable_noreturn void panic_assert_fail(const char *fname, int linenum);
#define ASSERT(cond) \
do { \
if (!(cond)) \
@@ -30,8 +32,8 @@ noreturn void panic_assert_fail(const char *fname, int linenum);
#else /* !CONFIG_DEBUG_ASSERT_BRIEF */
-noreturn void panic_assert_fail(const char *msg, const char *func,
- const char *fname, int linenum);
+test_mockable_noreturn void panic_assert_fail(const char *msg, const char *func,
+ const char *fname, int linenum);
#define ASSERT(cond) \
do { \
if (!(cond)) \