Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 1 | // (C) Copyright Gennadiy Rozental 2001-2008. |
| 2 | // Distributed under the Boost Software License, Version 1.0. |
| 3 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 4 | // http://www.boost.org/LICENSE_1_0.txt) |
| 5 | |
| 6 | // See http://www.boost.org/libs/test for the library home page. |
| 7 | // |
| 8 | // File : $RCSfile$ |
| 9 | // |
| 10 | // Version : $Revision: 49312 $ |
| 11 | // |
| 12 | // Description : defines class unit_test_result that is responsible for |
| 13 | // gathering test results and presenting this information to end-user |
| 14 | // *************************************************************************** |
| 15 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 16 | #ifndef NDNBOOST_TEST_RESULTS_REPORTER_HPP_021205GER |
| 17 | #define NDNBOOST_TEST_RESULTS_REPORTER_HPP_021205GER |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 18 | |
| 19 | // Boost.Test |
| 20 | #include <ndnboost/test/detail/global_typedef.hpp> |
| 21 | #include <ndnboost/test/detail/fwd_decl.hpp> |
| 22 | |
| 23 | // STL |
| 24 | #include <iosfwd> // for std::ostream& |
| 25 | |
| 26 | #include <ndnboost/test/detail/suppress_warnings.hpp> |
| 27 | |
| 28 | //____________________________________________________________________________// |
| 29 | |
| 30 | namespace ndnboost { |
| 31 | |
| 32 | namespace unit_test { |
| 33 | |
| 34 | namespace results_reporter { |
| 35 | |
| 36 | // ************************************************************************** // |
| 37 | // ************** formatter interface ************** // |
| 38 | // ************************************************************************** // |
| 39 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 40 | class NDNBOOST_TEST_DECL format { |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 41 | public: |
| 42 | // Destructor |
| 43 | virtual ~format() {} |
| 44 | |
| 45 | virtual void results_report_start( std::ostream& ostr ) = 0; |
| 46 | virtual void results_report_finish( std::ostream& ostr ) = 0; |
| 47 | |
| 48 | virtual void test_unit_report_start( test_unit const&, std::ostream& ostr ) = 0; |
| 49 | virtual void test_unit_report_finish( test_unit const&, std::ostream& ostr ) = 0; |
| 50 | |
| 51 | virtual void do_confirmation_report( test_unit const&, std::ostream& ostr ) = 0; |
| 52 | }; |
| 53 | |
| 54 | // ************************************************************************** // |
| 55 | // ************** report configuration ************** // |
| 56 | // ************************************************************************** // |
| 57 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 58 | NDNBOOST_TEST_DECL void set_level( report_level ); |
| 59 | NDNBOOST_TEST_DECL void set_stream( std::ostream& ); |
| 60 | NDNBOOST_TEST_DECL void set_format( output_format ); |
| 61 | NDNBOOST_TEST_DECL void set_format( results_reporter::format* ); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 62 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 63 | NDNBOOST_TEST_DECL std::ostream& get_stream(); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 64 | |
| 65 | // ************************************************************************** // |
| 66 | // ************** report initiation ************** // |
| 67 | // ************************************************************************** // |
| 68 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 69 | NDNBOOST_TEST_DECL void make_report( report_level l = INV_REPORT_LEVEL, test_unit_id = INV_TEST_UNIT_ID ); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 70 | inline void confirmation_report( test_unit_id id = INV_TEST_UNIT_ID ) |
| 71 | { make_report( CONFIRMATION_REPORT, id ); } |
| 72 | inline void short_report( test_unit_id id = INV_TEST_UNIT_ID ) |
| 73 | { make_report( SHORT_REPORT, id ); } |
| 74 | inline void detailed_report( test_unit_id id = INV_TEST_UNIT_ID ) |
| 75 | { make_report( DETAILED_REPORT, id ); } |
| 76 | |
| 77 | } // namespace results_reporter |
| 78 | |
| 79 | } // namespace unit_test |
| 80 | |
| 81 | } // namespace ndnboost |
| 82 | |
| 83 | //____________________________________________________________________________// |
| 84 | |
| 85 | #include <ndnboost/test/detail/enable_warnings.hpp> |
| 86 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 87 | #endif // NDNBOOST_TEST_RESULTS_REPORTER_HPP_021205GER |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 88 | |