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

@@ -488,3 +488,7 @@ int sbi_console_init(struct sbi_scratch *scratch)
return rc;
}
#ifdef CONFIG_SBIUNIT
#include "sbi_console_test.c"
#endif