Skip to contentSkip to conversation

docs: writing_tests: Make docs correspond the latest changes

PATCH New Ivan Orlov 2 participants 2 messages Mar 19, 2024 – Mar 20, 2024

lore
Share & tools
lore

Ivan Orlov

author
#0 lore raw

PATCH 1/1 docs: writing_tests: Make docs correspond the latest changes

We should store test object files list in the libsbi-objs-y Makefile variable, not in libsbitests-objs-y. Update the documentation correspondingly.

Since we don't use the console_dev static variable directly in the sbi_console_test unit test anymore, remove the paragraph which says that we do.

Fixes 86224ec36aed ("docs/writing_tests: Update tests paths")
---
 docs/writing_tests.md | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
docs/writing_tests.md +1 -4
index 816adba..2ce887a 100644
@@ -53,8 +53,8 @@ SBIUNIT_TEST_SUITE(string_test_suite, string_test_cases);
 Then, add the corresponding Makefile entries to `lib/sbi/tests/objects.mk`:
 ```lang-makefile
 ...
-libsbitests-objs-$(CONFIG_SBIUNIT) += sbi_string_test.o
 carray-sbi_unit_tests-$(CONFIG_SBIUNIT) += string_test_suite
+libsbi-objs-$(CONFIG_SBIUNIT) += sbi_string_test.o
 ```
 
 If you compiled OpenSBI with CONFIG_SBIUNIT enabled before, you may need to
@@ -113,9 +113,6 @@ carray-sbi_unit_tests-$(CONFIG_SBIUNIT) += string_test_suite
 You don't have to compile the `sbi_string_test.o` separately, because the
 test code will be included into the `sbi_string` object file.
 
-See example in `lib/sbi/tests/sbi_console_test.c`, where statically declared
-`console_dev` variable is used to mock the `sbi_console_device` structure.
-
 "Mocking" the structures
 ------------------------
 See the example of structure "mocking" in `lib/sbi/tests/sbi_console_test.c`,
Signature · 1 line
2.34.1
Applied
#1 lore raw

PATCH 1/1 docs: writing_tests: Make docs correspond the latest changes

Quoted 11 lines · On Tue, Mar 19, 2024 at 9:32?PM Ivan Orlov <[email protected]> wrote:

We should store test object files list in the libsbi-objs-y Makefile variable, not in libsbitests-objs-y. Update the documentation correspondingly.

Since we don't use the console_dev static variable directly in the sbi_console_test unit test anymore, remove the paragraph which says that we do.

Fixes 86224ec36aed ("docs/writing_tests: Update tests paths")

LGTM.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 31 lines
---
 docs/writing_tests.md | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
docs/writing_tests.md +1 -5
index 816adba..2ce887a 100644
@@ -53,8 +53,8 @@ SBIUNIT_TEST_SUITE(string_test_suite, string_test_cases);
 Then, add the corresponding Makefile entries to `lib/sbi/tests/objects.mk`:
 ```lang-makefile
...
-libsbitests-objs-$(CONFIG_SBIUNIT) += sbi_string_test.o
 carray-sbi_unit_tests-$(CONFIG_SBIUNIT) += string_test_suite
+libsbi-objs-$(CONFIG_SBIUNIT) += sbi_string_test.o
 ```
 
 If you compiled OpenSBI with CONFIG_SBIUNIT enabled before, you may need to
@@ -113,9 +113,6 @@ carray-sbi_unit_tests-$(CONFIG_SBIUNIT) += string_test_suite
 You don't have to compile the `sbi_string_test.o` separately, because the
 test code will be included into the `sbi_string` object file.
 
-See example in `lib/sbi/tests/sbi_console_test.c`, where statically declared
-`console_dev` variable is used to mock the `sbi_console_device` structure.
-
 "Mocking" the structures
 ------------------------
 See the example of structure "mocking" in `lib/sbi/tests/sbi_console_test.c`,
--

2.34.1