]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: Enable console recording in tests
authorSimon Glass <sjg@chromium.org>
Mon, 27 Jan 2020 15:49:55 +0000 (08:49 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 6 Feb 2020 02:33:46 +0000 (19:33 -0700)
At present we reset the console buffer before each test but do not
actually set the recording flag. Without this, the output is not
recorded.

Update the code to set the flag before the test and clear it afterwards.

Signed-off-by: Simon Glass <sjg@chromium.org>
test/dm/test-main.c

index 72648162a917a4be80d8d76b547683ab5ed31e81..d7dc8d1f915b1fee314cba1066d74b6763099040 100644 (file)
@@ -97,11 +97,11 @@ static int dm_do_test(struct unit_test_state *uts, struct unit_test *test,
         * Silence the console and rely on console recording to get
         * our output.
         */
-       console_record_reset();
+       console_record_reset_enable();
        if (!state->show_test_output)
                gd->flags |= GD_FLG_SILENT;
        test->func(uts);
-       gd->flags &= ~GD_FLG_SILENT;
+       gd->flags &= ~(GD_FLG_SILENT | GD_FLG_RECORD);
        state_set_skip_delays(false);
 
        ut_assertok(dm_test_destroy(uts));