From patchwork Mon Jun 8 02:43:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 241903 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 7 Jun 2020 20:43:36 -0600 Subject: [PATCH v2 09/10] test: Add a flag for tests that need console recording In-Reply-To: <20200608024337.85575-1-sjg@chromium.org> References: <20200608024337.85575-1-sjg@chromium.org> Message-ID: <20200608024337.85575-4-sjg@chromium.org> Allow tests that need console recording to be marked, so they can be skipped if it is not available. Signed-off-by: Simon Glass --- (no changes since v1) include/test/test.h | 1 + test/cmd_ut.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/test/test.h b/include/test/test.h index ff92c39006..d66cd9e889 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -35,6 +35,7 @@ enum { UT_TESTF_SCAN_FDT = BIT(2), /* scan device tree */ UT_TESTF_FLAT_TREE = BIT(3), /* test needs flat DT */ UT_TESTF_LIVE_TREE = BIT(4), /* needs live device tree */ + UT_TESTF_CONSOLE_REC = BIT(4), /* needs console recording */ }; /** diff --git a/test/cmd_ut.c b/test/cmd_ut.c index cc9543c315..1963f3792c 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -34,6 +35,15 @@ int cmd_ut_category(const char *name, const char *prefix, continue; printf("Test: %s\n", test->name); + if (test->flags & UT_TESTF_CONSOLE_REC) { + int ret = console_record_reset_enable(); + + if (ret) { + printf("Skipping: Console recording disabled\n"); + continue; + } + } + uts.start = mallinfo(); test->func(&uts);