samples/drivers/adc: Fix output specification

This is a follow-up to commit f5ffd05e6b.

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 <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2022-06-02 09:43:06 +02:00 committed by Carles Cufí
commit a78e7c5c90
2 changed files with 2 additions and 2 deletions

View file

@ -15,4 +15,4 @@ tests:
type: multi_line
regex:
- "ADC reading:"
- " - .+, channel \\d+: \\d+"
- "- .+, channel \\d+: -?\\d+"

View file

@ -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]);