From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 09/10] test: Add a flag for tests that need console recording
Date: Sun, 7 Jun 2020 20:43:36 -0600 [thread overview]
Message-ID: <20200608024337.85575-4-sjg@chromium.org> (raw)
In-Reply-To: <20200608024337.85575-1-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 <sjg@chromium.org>
---
(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 <common.h>
#include <command.h>
+#include <console.h>
#include <test/suites.h>
#include <test/test.h>
@@ -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);
--
2.27.0.278.ge193c7cf3a9-goog
next prev parent reply other threads:[~2020-06-08 2:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 2:43 [PATCH v2 00/10] cmd: Fix 'md' and add a memory-search command Simon Glass
2020-06-08 2:43 ` [PATCH v2 01/10] Update MEM_SUPPORT_64BIT_DATA to be always defined Simon Glass
2020-06-08 2:43 ` [PATCH v2 02/10] cmd: mem: Use a macro to avoid #ifdef in help Simon Glass
2020-06-08 2:43 ` [PATCH v2 03/10] cmd: mem: Drop #ifdef for MEM_SUPPORT_64BIT_DATA Simon Glass
2020-06-08 2:43 ` [PATCH v2 04/10] display_options: " Simon Glass
2020-06-08 2:43 ` [PATCH v2 05/10] command: " Simon Glass
2020-06-08 2:43 ` [PATCH v2 06/10] test: Add a way to check part of a console line or skip it Simon Glass
2020-06-08 2:43 ` [PATCH v2 07/10] dm: test: Rename test flags to be generic Simon Glass
2020-06-08 2:43 ` [PATCH v2 08/10] console: Always define the console-recording functions Simon Glass
2020-06-08 2:43 ` Simon Glass [this message]
2020-06-08 2:43 ` [PATCH v2 10/10] cmd: Add a memory-search command Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200608024337.85575-4-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox