rockchip: test: add log message need by LAVA

The LAVA system need message from log to show the test result.
"<LAVA_SIGNAL_*>" for start, end, test case result key;
"<LAVA_TEST_RUNNER>: exiting" for test complete key

Change-Id: I13522bf82da69f105f439853fa5c4b32c9f3d1ff
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Kever Yang 2019-07-18 17:29:38 +08:00
parent eae5fe32f1
commit 2a77afce30
3 changed files with 26 additions and 4 deletions

View File

@ -21,6 +21,12 @@ config TEST_ROCKCHIP
help help
This enables the test function for rockchip board modules. This enables the test function for rockchip board modules.
config LAVA_INFO
bool "Display test info need by LAVA system"
depends on TEST_ROCKCHIP
help
This enable the print info need by LAVA system
source "test/dm/Kconfig" source "test/dm/Kconfig"
source "test/env/Kconfig" source "test/env/Kconfig"
source "test/overlay/Kconfig" source "test/overlay/Kconfig"

View File

@ -155,8 +155,8 @@ static int do_rockchip_test(cmd_tbl_t *cmdtp, int flag,
goto finish; goto finish;
all_test: all_test:
lava_info("<LAVA_SIGNAL_STARTRUN u-boot-function 0>\n");
ms_start = get_timer(0); ms_start = get_timer(0);
for (i = 0; i < ARRAY_SIZE(cmd_groups); i++) { for (i = 0; i < ARRAY_SIZE(cmd_groups); i++) {
/* /*
* If 'grp_test_id != TEST_ID_UNK', now is group test, find * If 'grp_test_id != TEST_ID_UNK', now is group test, find
@ -173,6 +173,7 @@ all_test:
/* Skip this ignored cmd */ /* Skip this ignored cmd */
if (skip_this_cmd(cp, skip_mode)) { if (skip_this_cmd(cp, skip_mode)) {
printf("### Skip [%s]\n", cp->name); printf("### Skip [%s]\n", cp->name);
lava_info("<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=skip>\n", cp->name);
continue; continue;
} }
@ -184,10 +185,13 @@ all_test:
/* Execute command */ /* Execute command */
ret = cp->cmd(cmdtp, flag, argc, argv); ret = cp->cmd(cmdtp, flag, argc, argv);
if (ret) if (ret) {
lava_info("<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=fail>\n", cp->name);
fail++; fail++;
else } else {
lava_info("<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=pass>\n", cp->name);
okay++; okay++;
}
/* Result */ /* Result */
printf("### Finish, result: <%s>\n\n", printf("### Finish, result: <%s>\n\n",
@ -206,9 +210,14 @@ all_test:
sec = ms / 1000; sec = ms / 1000;
ms = ms % 1000; ms = ms % 1000;
} }
printf("[=== SUM: pass: %d; failed: %d; total: %lu.%lus ===]\n\n\n", printf("[=== SUM: pass: %d; failed: %d; total: %lu.%lus ===]\n\n\n",
okay, fail, sec, ms); okay, fail, sec, ms);
/*
* LAVA result with meansure data
* lava_info("<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=dd-write-mean RESULT=pass UNITS=MB/s MEASUREMENT=37.42>");
*/
lava_info("<LAVA_SIGNAL_ENDRUN u-boot-function 0>\n");
lava_info("<LAVA_TEST_RUNNER>: exiting u-boot-function\n");
finish: finish:
return 0; return 0;

View File

@ -46,4 +46,11 @@ struct cmd_group {
u32 cmd_n; u32 cmd_n;
}; };
#ifdef CONFIG_LAVA_INFO
#define lava_info(fmt, ...) \
printf(fmt, ##__VA_ARGS__)
#else
#define lava_info(fmt, ...)
#endif
#endif /* _TEST_ROCKCHIP_H */ #endif /* _TEST_ROCKCHIP_H */