mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: unit: add test function name to logs
This patch adds the test function name to output logs to make it easier to establish traceability between SWUTS and test results. Also, the unit test name as defined in the UNIT_TEST macro can now be used to clarify the subcase when a given test function is used several times with different arguments. JIRA NVGPU-3510 Change-Id: I652ecd8c06fd89e4d78d419f73b35b69ae71a8ef Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2241879 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
1ab3f73230
commit
86f1b2336a
@@ -35,16 +35,24 @@ typedef int (*module_test_fn)(struct unit_module *m,
|
||||
#define UNIT_FAIL -1
|
||||
|
||||
struct unit_module_test {
|
||||
/*
|
||||
* Name of the test.
|
||||
*/
|
||||
const char *name;
|
||||
|
||||
/*
|
||||
* Function to call to execute the test.
|
||||
*/
|
||||
module_test_fn fn;
|
||||
|
||||
/*
|
||||
* Name of the test function. It will be used to match the test
|
||||
* results with its SWUTS.
|
||||
*/
|
||||
const char *fn_name;
|
||||
|
||||
/*
|
||||
* Name of the test. It can be used to describe a subcase when the
|
||||
* same test function is used several times.
|
||||
*/
|
||||
const char *case_name;
|
||||
|
||||
/*
|
||||
* Minimum test plan level (L0, L1) to execute the test.
|
||||
*/
|
||||
@@ -148,7 +156,8 @@ struct unit_module {
|
||||
|
||||
#define UNIT_TEST(__name, __fn, __args, __test_lvl) \
|
||||
{ \
|
||||
.name = #__name, \
|
||||
.fn_name = #__fn, \
|
||||
.case_name = #__name, \
|
||||
.fn = __fn, \
|
||||
.args = __args, \
|
||||
.test_lvl = __test_lvl, \
|
||||
@@ -163,7 +172,8 @@ struct unit_module {
|
||||
*/
|
||||
#define UNIT_TEST_REQ(__req, __uid, __vc, __name, __fn, __args, __test_lvl) \
|
||||
{ \
|
||||
.name = #__name, \
|
||||
.fn_name = #__fn, \
|
||||
.case_name = #__name, \
|
||||
.fn = __fn, \
|
||||
.args = __args, \
|
||||
.test_lvl = __test_lvl, \
|
||||
|
||||
Reference in New Issue
Block a user