diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-12-14 11:31:00 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-12-14 11:32:22 +0100 |
commit | 3fe4b72b067082f0f8a978ad66b45e23dff4fae6 (patch) | |
tree | 5f603ee9942ac8214e04f088681fc17e10dca1a1 | |
parent | psxftw01: Simplify and use rtems_test_run() (diff) | |
download | rtems-3fe4b72b067082f0f8a978ad66b45e23dff4fae6.tar.bz2 |
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.
-rw-r--r-- | cpukit/libtest/testrun.c | 13 |
1 files changed, 11 insertions, 2 deletions
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 ); } |