From a78e7c5c90d8cb31ec550ce289503bd698675585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 2 Jun 2022 09:43:06 +0200 Subject: [PATCH] samples/drivers/adc: Fix output specification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit f5ffd05e6b3f5e7e64ba59d0dbe0380bedede345. Since twister removes leading spaces from received lines before further processing, the regular expression for checking the output produced by the sample cannot contain such space. Also negative values read from ADC channels need to be allowed. For consistency, remove the leading space also in the actual string printed by the sample. Signed-off-by: Andrzej Głąbek --- samples/drivers/adc/sample.yaml | 2 +- samples/drivers/adc/src/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/drivers/adc/sample.yaml b/samples/drivers/adc/sample.yaml index c643de513ce..83112fd4dad 100644 --- a/samples/drivers/adc/sample.yaml +++ b/samples/drivers/adc/sample.yaml @@ -15,4 +15,4 @@ tests: type: multi_line regex: - "ADC reading:" - - " - .+, channel \\d+: \\d+" + - "- .+, channel \\d+: -?\\d+" diff --git a/samples/drivers/adc/src/main.c b/samples/drivers/adc/src/main.c index d4b2f77331b..0d74e6abb73 100644 --- a/samples/drivers/adc/src/main.c +++ b/samples/drivers/adc/src/main.c @@ -141,7 +141,7 @@ void main(void) while (1) { printk("ADC reading:\n"); for (uint8_t i = 0; i < ARRAY_SIZE(adc_channels); i++) { - printk(" - %s, channel %d: ", + printk("- %s, channel %d: ", adc_labels[i], adc_channels[i].channel_id); prepare_sequence(&sequence, &adc_channels[i]);