lib: Add SBIUnit testing macros and functions
authorIvan Orlov <ivan.orlov0322@gmail.com>
Mon, 4 Mar 2024 21:45:49 +0000 (21:45 +0000)
committerAnup Patel <anup@brainfault.org>
Sun, 10 Mar 2024 04:35:28 +0000 (10:05 +0530)
commit874fcefdf5883c042b4b1f61f6265e03e16f2e79
treee499c0a570bad230077c367b70a23f1e47d0db3a
parentb9e4de0641a0b4e4ed9cb0439d3b7b66fe6ef75f
lib: Add SBIUnit testing macros and functions

This patch introduces all of the SBIUnit macros and functions which
can be used during the test development process. Also, it defines
the 'run_all_tests' function, which is being called during the
'init_coldboot' right after printing the boot hart information.

Also, add the CONFIG_SBIUNIT Kconfig entry in order to be able to
turn the tests on and off. When the CONFIG_SBIUNIT is disabled,
the tests and all related code is excluded completely on the
compilation stage.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
include/sbi/sbi_unit_test.h [new file with mode: 0644]
lib/sbi/Kconfig
lib/sbi/objects.mk
lib/sbi/sbi_init.c
lib/sbi/sbi_unit_test.c [new file with mode: 0644]
lib/sbi/sbi_unit_tests.carray [new file with mode: 0644]