Boost.Test > Components > The Unit Test Framework > Components > The Test Result
Boost Test logo

The Test Result


defined in unit_test_result.hpp

class unit_test_result
    static unit_test_result& instance();
    static void              set_report_format( std::string const& reportformat );

    void                     report( std::string const& reportlevel, std::ostream& where_to );
    void                     confirmation_report( std::ostream& where_to );
    void                     short_report( std::ostream& where_to );
    void                     detailed_report( std::ostream& where_to );

    int                      result_code() const;
    bool                     has_passed() const;

The Unit Test Framework keeps testing results as the instances of the class unit_test_result. This class is responsible for test result storage, analysis and presentation to the user in output stream. There two formats supported for results presentation: human readable format and XML format. This class provides several methods for the result reporting. In most cases you do not need to use this interface directly. The framework provides a report for overall testing results automatically. You could also configure report format using the framework parameter. See the Framework parameters for details.


The instances of this class are created automatically by the framework for each test case. To access instance of class unit_test_result holding results for the current test case use static method unit_test_result::instance().