lib: tests: Add sbi_console test
authorIvan Orlov <ivan.orlov0322@gmail.com>
Mon, 4 Mar 2024 21:45:51 +0000 (21:45 +0000)
committerAnup Patel <anup@brainfault.org>
Sun, 10 Mar 2024 04:42:52 +0000 (10:12 +0530)
commit87d8fe78653e77de33cc12b9df07fc3a202f7d49
tree72dcede42594f559b484092726f8bc1e5287ad3f
parente5f53fdea30e1a3d2e22e5b7fec34b26f59f310f
lib: tests: Add sbi_console test

Add the test suite covering some of the functions from
lib/sbi/sbi_console.c: putc, puts and printf. The test covers a variety
of format specifiers for printf and different strings and characters for
putc and puts.

In order to do that, the test "mocks" the sbi_console_device structure
by setting the 'console_dev' variable to the virtual console.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
lib/sbi/objects.mk
lib/sbi/sbi_console.c
lib/sbi/sbi_console_test.c [new file with mode: 0644]