summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/libtest/testrun.c13
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 );
}