aboutsummaryrefslogtreecommitdiff
path: root/test/ut.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-01-18 07:55:54 -0500
committerTom Rini <trini@konsulko.com>2021-01-18 07:55:54 -0500
commit19c5fdffdc41bfd606b455b46e834d1bff4b2c1e (patch)
treedb1c5abebf12e9aaef80d8e22a472357027b5287 /test/ut.c
parent14ea1b3635b4af8d9e283e3671f7ee872d50b859 (diff)
parentad80a8d0877922db95fd0410314504c840d9d850 (diff)
Merge branch '2021-01-16-assorted-improvements'
- Assorted testing improvements and fixes - Assorted code cleanups
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 95bdd66de6..44ed1ba2d3 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);
+}