From 2a77afce30a3be0d5c7f9049479f0aef6e90d4ab Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Thu, 18 Jul 2019 17:29:38 +0800 Subject: [PATCH] rockchip: test: add log message need by LAVA The LAVA system need message from log to show the test result. "" for start, end, test case result key; ": exiting" for test complete key Change-Id: I13522bf82da69f105f439853fa5c4b32c9f3d1ff Signed-off-by: Kever Yang --- test/Kconfig | 6 ++++++ test/rockchip/test-rockchip.c | 17 +++++++++++++---- test/rockchip/test-rockchip.h | 7 +++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/test/Kconfig b/test/Kconfig index b53d2d948c..9a22d50255 100644 --- a/test/Kconfig +++ b/test/Kconfig @@ -21,6 +21,12 @@ config TEST_ROCKCHIP help 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/env/Kconfig" source "test/overlay/Kconfig" diff --git a/test/rockchip/test-rockchip.c b/test/rockchip/test-rockchip.c index 6ede00316a..3d69dc4172 100644 --- a/test/rockchip/test-rockchip.c +++ b/test/rockchip/test-rockchip.c @@ -155,8 +155,8 @@ static int do_rockchip_test(cmd_tbl_t *cmdtp, int flag, goto finish; all_test: + lava_info("\n"); ms_start = get_timer(0); - for (i = 0; i < ARRAY_SIZE(cmd_groups); i++) { /* * If 'grp_test_id != TEST_ID_UNK', now is group test, find @@ -173,6 +173,7 @@ all_test: /* Skip this ignored cmd */ if (skip_this_cmd(cp, skip_mode)) { printf("### Skip [%s]\n", cp->name); + lava_info("\n", cp->name); continue; } @@ -184,10 +185,13 @@ all_test: /* Execute command */ ret = cp->cmd(cmdtp, flag, argc, argv); - if (ret) + if (ret) { + lava_info("\n", cp->name); fail++; - else + } else { + lava_info("\n", cp->name); okay++; + } /* Result */ printf("### Finish, result: <%s>\n\n", @@ -206,9 +210,14 @@ all_test: sec = ms / 1000; ms = ms % 1000; } - printf("[=== SUM: pass: %d; failed: %d; total: %lu.%lus ===]\n\n\n", okay, fail, sec, ms); +/* + * LAVA result with meansure data + * lava_info(""); + */ + lava_info("\n"); + lava_info(": exiting u-boot-function\n"); finish: return 0; diff --git a/test/rockchip/test-rockchip.h b/test/rockchip/test-rockchip.h index bc38d2ff24..4e4d2607a2 100644 --- a/test/rockchip/test-rockchip.h +++ b/test/rockchip/test-rockchip.h @@ -46,4 +46,11 @@ struct cmd_group { 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 */