aboutsummaryrefslogtreecommitdiff
path: root/test/ut.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-08 21:08:43 -0700
committerTom Rini <trini@konsulko.com>2021-01-16 14:49:09 -0500
commitef7e264944a21c0a78378bf4d28db5bcacbc5b45 (patch)
tree654fc9a85ca17cc9bed616f68f09ab016799bd5a /test/ut.c
parent12fc1f3bb2237c6eee7bc775599c14df5c997534 (diff)
downloadu-boot-ef7e264944a21c0a78378bf4d28db5bcacbc5b45.zip
u-boot-ef7e264944a21c0a78378bf4d28db5bcacbc5b45.tar.gz
u-boot-ef7e264944a21c0a78378bf4d28db5bcacbc5b45.tar.bz2
test: Avoid assuming sandbox board for bloblist test
This tests assumes it is running on sandbox. Add a few functions to handle silencing the console on any board and use those instead. Reported-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/ut.c')
-rw-r--r--test/ut.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ut.c b/test/ut.c
index 95bdd66..44ed1ba 100644
--- a/test/ut.c
+++ b/test/ut.c
@@ -8,6 +8,9 @@
#include <common.h>
#include <console.h>
#include <malloc.h>
+#ifdef CONFIG_SANDBOX
+#include <asm/state.h>
+#endif
#include <test/test.h>
#include <test/ut.h>
@@ -114,3 +117,18 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes)
return upto == total_bytes ? 0 : 1;
}
+
+void ut_silence_console(struct unit_test_state *uts)
+{
+#ifdef CONFIG_SANDBOX
+ struct sandbox_state *state = state_get_current();
+
+ if (!state->show_test_output)
+ gd->flags |= GD_FLG_SILENT;
+#endif
+}
+
+void ut_unsilence_console(struct unit_test_state *uts)
+{
+ gd->flags &= ~(GD_FLG_SILENT | GD_FLG_RECORD);
+}