lib: tests: Move tests to a separate directory
authorIvan Orlov <ivan.orlov0322@gmail.com>
Wed, 13 Mar 2024 15:01:57 +0000 (15:01 +0000)
committerAnup Patel <anup@brainfault.org>
Tue, 19 Mar 2024 05:50:40 +0000 (11:20 +0530)
commit5c992a115a15ce2f2518f0ff7a655b42c3a8ebad
tree5ba709080b7a62d96dfb719b92734eb71d3c76de
parent81e3ba77a6dae8763972fffb6e4a833adccbeb1b
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>
lib/sbi/objects.mk
lib/sbi/sbi_bitmap_test.c [deleted file]
lib/sbi/sbi_console.c
lib/sbi/sbi_console_test.c [deleted file]
lib/sbi/sbi_unit_test.c [deleted file]
lib/sbi/sbi_unit_tests.carray [deleted file]
lib/sbi/tests/objects.mk [new file with mode: 0644]
lib/sbi/tests/sbi_bitmap_test.c [new file with mode: 0644]
lib/sbi/tests/sbi_console_test.c [new file with mode: 0644]
lib/sbi/tests/sbi_unit_test.c [new file with mode: 0644]
lib/sbi/tests/sbi_unit_tests.carray [new file with mode: 0644]