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>
This commit is contained in:
Ivan Orlov
2024-03-04 21:45:51 +00:00
committed by Anup Patel
parent e5f53fdea3
commit 87d8fe7865
3 changed files with 110 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ libsbi-objs-$(CONFIG_SBIUNIT) += sbi_unit_tests.o
libsbi-objs-$(CONFIG_SBIUNIT) += sbi_bitmap_test.o
carray-sbi_unit_tests-$(CONFIG_SBIUNIT) += bitmap_test_suite
carray-sbi_unit_tests-$(CONFIG_SBIUNIT) += console_test_suite
libsbi-objs-y += sbi_ecall.o
libsbi-objs-y += sbi_ecall_exts.o