From 3fe4b72b067082f0f8a978ad66b45e23dff4fae6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 14 Dec 2023 11:31:00 +0100 Subject: libtest: Fix test printer in rtems_test_run() Route the test output through T_vprintf() only while the test suite runs. Otherwise, the begin/end of test message may not show up. --- cpukit/libtest/testrun.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cpukit/libtest') diff --git a/cpukit/libtest/testrun.c b/cpukit/libtest/testrun.c index 1fc8c82824..5b2eb61596 100644 --- a/cpukit/libtest/testrun.c +++ b/cpukit/libtest/testrun.c @@ -85,13 +85,22 @@ void rtems_test_run( const RTEMS_TEST_STATE state ) { + rtems_print_printer previous_printer; + int exit_code; + (void) arg; - rtems_test_printer.printer = printer; rtems_test_begin( rtems_test_name, state ); T_register(); - if ( T_main( &config ) == 0 ) { + previous_printer = rtems_test_printer.printer; + rtems_test_printer.printer = printer; + + exit_code = T_main( &config ); + + rtems_test_printer.printer = previous_printer; + + if ( exit_code == 0 ) { rtems_test_end( rtems_test_name ); } -- cgit v1.2.3