125125 { \
126126 (__lt_operation__) ;\
127127 } \
128+ catch (std::exception& e) \
129+ { \
130+ std::stringstream __lt_ss__; \
131+ __lt_ss__ << " (" << __lt_file__ << " :" << __lt_line__ << " ) - error in " << " \" " << __lt_name__ << " \" : exceptions thown by " << #__lt_operation__; \
132+ __lt_ss__ << " [ " << e.what () << " ]" ; \
133+ LT_SWITCH_MODE (__lt_mode__) \
134+ } \
128135 catch (...) \
129136 { \
130137 std::stringstream __lt_ss__; \
@@ -522,12 +529,14 @@ class test : public test_base
522529 }
523530 catch (std::exception& e)
524531 {
525- std::cout << " Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " set up" << std::endl;
532+ std::cout << " [FAILURE] Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " set up" << std::endl;
526533 std::cout << e.what () << std::endl;
534+ tr->add_failure ();
527535 }
528536 catch (...)
529537 {
530- std::cout << " Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " set up" << std::endl;
538+ std::cout << " [FAILURE] Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " set up" << std::endl;
539+ tr->add_failure ();
531540 }
532541 try
533542 {
@@ -540,16 +549,18 @@ class test : public test_base
540549 }
541550 catch (std::exception& e)
542551 {
543- std::cout << " Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " run" << std::endl;
552+ std::cout << " [FAILURE] Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " run" << std::endl;
544553 std::cout << e.what () << std::endl;
545554 if (tr->last_checkpoint_line != -1 )
546555 std::cout << " Last checkpoint in " << tr->last_checkpoint_file << " :" << tr->last_checkpoint_line << std::endl;
556+ tr->add_failure ();
547557 }
548558 catch (...)
549559 {
550- std::cout << " Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " run" << std::endl;
560+ std::cout << " [FAILURE] Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " run" << std::endl;
551561 if (tr->last_checkpoint_line != -1 )
552562 std::cout << " Last checkpoint in " << tr->last_checkpoint_file << " :" << tr->last_checkpoint_line << std::endl;
563+ tr->add_failure ();
553564 }
554565 gettimeofday (&after, NULL );
555566
@@ -569,12 +580,14 @@ class test : public test_base
569580 }
570581 catch (std::exception& e)
571582 {
572- std::cout << " Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " tear down" << std::endl;
583+ std::cout << " [FAILURE] Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " tear down" << std::endl;
573584 std::cout << e.what () << std::endl;
585+ tr->add_failure ();
574586 }
575587 catch (...)
576588 {
577- std::cout << " Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " tear down" << std::endl;
589+ std::cout << " [FAILURE] Exception during " << static_cast <test_impl* >(this )->__lt_name__ << " tear down" << std::endl;
590+ tr->add_failure ();
578591 }
579592 double total = set_up_duration + test_duration + tear_down_duration;
580593 tr->add_total_time (total);
0 commit comments