lib: tests: Add test suite init function
authorIvan Orlov <ivan.orlov0322@gmail.com>
Tue, 23 Apr 2024 15:52:43 +0000 (16:52 +0100)
committerAnup Patel <anup@brainfault.org>
Tue, 7 May 2024 05:57:13 +0000 (11:27 +0530)
commitf6243d9ce591b3a2085feff23ab2fbe1a6d51a14
tree77e45848934e0ea0e5d09f1b6d232bc122cf8689
parentd4d2582eef7aac442076f955e4024403f8ff3d96
lib: tests: Add test suite init function

Allow to define an init function for the test suite. It could help us
to initialize global variable once, and use them in multiple test cases
after the initialization.

For instance, if multiple test cases use the same atomic_t var, it
could be helpful to call ATOMIC_INIT once during the suite
initialization.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
include/sbi/sbi_unit_test.h
lib/sbi/tests/sbi_unit_test.c