metatest::test_result

test_result instances represent results of a compile-time tests at runtime. Instances are immutable, thus their state can not be changed after construction.

#include <metatest/test_result.hpp>

Constructors

test_result::test_result(
  const std::string& name_,                                                                   
  const location& location_,
  bool success_,
  const std::string& reason_
)

Creates a new instance with the specified properties.

Methods

None of the methods throws an exception.

bool test_result::has_name() const

Whether the result object has a name.

const std::string& test_result::get_name() const

Name of the current test.

const location& test_result::get_location() const

Location of the test body within the source.

bool test_result::success() const

Success/fail status.

bool test_result::has_reason() const

Whether the result object has a description.

const std::string& test_result::get_reason() const

Description of the test result.

template <class Pred>
static test_result test_result::build(
  const location& location_,
  const std::string& name_ = std::string()
)

Builds a test_result instance by evaluating the predicate.

Operators

std::ostream& operator<<(std::ostream& o_, const test_result& result_);

Pretty-prints the test result to the stream.

[up]