From: Simon Glass <simon.glass@canonical.com> Some tests cannot run when the console is silent. An example is an expo test which checks text entry into a textline object. The console must be enabled so that the characters actually reach the putc_xy() in console_truetype, since in scene_textline_send_key(), the lineedit restores the vidconsole state, outputs the character and then saves the state again. If the character is never output, then the state won't be updated and the lineedit will be inconsistent. Rather than having individual tests handle this manually, add an explicit flag, in the hope that this quirk does not trip anyone else up. Put the flag next to the existing UTF_CONSOLE flag, since they are related. Signed-off-by: Simon Glass <simon.glass@canonical.com> --- include/test/test.h | 17 +++++++++-------- test/test-main.c | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/test/test.h b/include/test/test.h index f2d956e913c..086fff1ca26 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -90,20 +90,21 @@ enum ut_flags { UTF_FLAT_TREE = BIT(3), /* test needs flat DT */ UTF_LIVE_TREE = BIT(4), /* needs live device tree */ UTF_CONSOLE = BIT(5), /* needs console recording */ + UTF_NO_SILENT = BIT(6), /* console cannot be silent */ /* do extra driver model init and uninit */ - UTF_DM = BIT(6), - UTF_OTHER_FDT = BIT(7), /* read in other device tree */ + UTF_DM = BIT(7), + UTF_OTHER_FDT = BIT(8), /* read in other device tree */ /* * Only run if explicitly requested with 'ut -f <suite> <test>'. The * test name must end in "_norun" so that pytest detects this also, * since it cannot access the flags. */ - UTF_MANUAL = BIT(8), - UTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */ - UTF_SF_BOOTDEV = BIT(10), /* enable SPI flash bootdevs */ - UFT_BLOBLIST = BIT(11), /* test changes gd->bloblist */ - UTF_INIT = BIT(12), /* test inits a suite */ - UTF_UNINIT = BIT(13), /* test uninits a suite */ + UTF_MANUAL = BIT(9), + UTF_ETH_BOOTDEV = BIT(10), /* enable Ethernet bootdevs */ + UTF_SF_BOOTDEV = BIT(11), /* enable SPI flash bootdevs */ + UFT_BLOBLIST = BIT(12), /* test changes gd->bloblist */ + UTF_INIT = BIT(13), /* test inits a suite */ + UTF_UNINIT = BIT(14), /* test uninits a suite */ }; /** diff --git a/test/test-main.c b/test/test-main.c index b27f892140c..941b883e156 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -410,7 +410,8 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) gd_set_bloblist(NULL); } - ut_silence_console(uts); + if (!(test->flags & UTF_NO_SILENT)) + ut_silence_console(uts); return 0; } -- 2.43.0