lib: tests: Move tests to a separate directory

Move all of the SBIUnit-related code into the lib/sbi/tests directory.
Update 'Makefile' to index objects from the tests subdirectory.

I don't think creating the full separate list of Makefile variables
(libsbitests-objs-path-y, libsbitests-object-mks, etc. as it is done for
libsbiutils) is necessary for the tests because:

1) `lib/sbi/tests/objects.mk` is already indexed into
'libsbi-objects-mks' since the find expression for the libsbi-object-mks
variable looks for objects.mk files in the nested directories as well).

2) Tests are tightly coupled with the `lib/sbi/` sources, therefore it
may be reasonable to store the list of lib/sbi and lib/sbi/tests object
files together in the libsbi-objs-path-y variable.

Additionally, update relative paths in the tests where necessary.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Ivan Orlov
2024-03-13 15:01:57 +00:00
committed by Anup Patel
parent 81e3ba77a6
commit 5c992a115a
7 changed files with 14 additions and 14 deletions

View File

@@ -472,7 +472,7 @@ const struct sbi_console_device *sbi_console_get_device(void)
void sbi_console_set_device(const struct sbi_console_device *dev)
{
if (!dev || console_dev)
if (!dev)
return;
console_dev = dev;
@@ -488,7 +488,3 @@ int sbi_console_init(struct sbi_scratch *scratch)
return rc;
}
#ifdef CONFIG_SBIUNIT
#include "sbi_console_test.c"
#endif