From 0625adeadc3198bd9e453bbd79b0041e34224a8f Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Thu, 12 Sep 2024 11:04:43 +0000 Subject: [PATCH] app: add console harness Add console harness to the firmware application. Signed-off-by: Henrik Brix Andersen --- app/sample.yaml | 6 +++++- app/src/main.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/sample.yaml b/app/sample.yaml index e2aba08..70b8bab68 100644 --- a/app/sample.yaml +++ b/app/sample.yaml @@ -6,9 +6,13 @@ sample: name: cannectivity common: tags: usb can - build_only: true platform_exclude: - native_sim + harness: console + harness_config: + type: one_line + regex: + - "CANnectivity firmware initialized with .*" tests: app.cannectivity: depends_on: usb_device can diff --git a/app/src/main.c b/app/src/main.c index 8f52874..1d3669d 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -86,4 +86,7 @@ int main(void) LOG_ERR("failed to enable USB device"); return err; } + + LOG_INF("CANnectivity firmware initialized with %u channel%s\n", ARRAY_SIZE(channels), + ARRAY_SIZE(channels) > 1 ? "s" : ""); }