/* Declare a new driver model test */
#define DM_TEST(_name, _flags) \
- UNIT_TEST(_name, UT_TESTF_DM | (_flags), dm_test)
+ UNIT_TEST(_name, UT_TESTF_DM | UT_TESTF_CONSOLE_REC | (_flags), dm_test)
/*
* struct sandbox_sdl_plat - Platform data for the SDL video driver
(test->flags & UT_TESTF_SCAN_FDT))
ut_assertok(dm_extended_scan(false));
- /*
- * Silence the console and rely on console recording to get
- * our output.
- */
- console_record_reset_enable();
+ ut_assertok(test_pre_run(uts, test));
+
if (!state->show_test_output)
gd->flags |= GD_FLG_SILENT;
test->func(uts);
+
+ ut_assertok(test_post_run(uts, test));
+
gd->flags &= ~(GD_FLG_SILENT | GD_FLG_RECORD);
state_set_skip_delays(false);
#include <console.h>
#include <test/test.h>
+DECLARE_GLOBAL_DATA_PTR;
+
int test_pre_run(struct unit_test_state *uts, struct unit_test *test)
{
- uts->start = mallinfo();
+ /* DM tests have already done this */
+ if (!(test->flags & UT_TESTF_DM))
+ uts->start = mallinfo();
if (test->flags & UT_TESTF_CONSOLE_REC) {
int ret = console_record_reset_enable();
int test_post_run(struct unit_test_state *uts, struct unit_test *test)
{
+ gd->flags &= ~GD_FLG_RECORD;
+
return 0;
}