tfel
Loading...
Searching...
No Matches
tfel::tests::TestResult Struct Reference

structure describing the result of a test or a test suite More...

#include </home/runner/work/tfel/tfel/include/TFEL/Tests/TestResult.hxx>

Public Types

using const_iterator = std::vector<TestResult>::const_iterator
 a simple alias

Public Member Functions

 TestResult ()
 default onstructor
 TestResult (const bool)
 constructor
 TestResult (const bool, const std::string_view, const std::string_view=std::string_view{})
 constructor
 TestResult (const TestResult &)
 copy constructor
 TestResult (TestResult &&) noexcept
 copy constructor
TestResult & operator= (TestResult &&) noexcept
 assignement operator
TestResult & operator= (const TestResult &)
 assignement operator
bool success () const
 report success
const std::string & getDescription () const
const std::string & getFailureDescription () const
const_iterator begin () const
const_iterator end () const
void append (const TestResult &)
 This is a typical stack operation. The function creates an element at the end of the vector and assigns the given data to it. Due to the nature of a vector this operation can be done in constant time if the vector has preallocated space available.
void setTestDuration (const double)
 set test duration
double duration () const
 ~TestResult ()
 destructor

Detailed Description

structure describing the result of a test or a test suite

Constructor & Destructor Documentation

◆ TestResult() [1/2]

tfel::tests::TestResult::TestResult ( const bool )
explicit

constructor

Parameters
[in]btells if the test is a success

◆ TestResult() [2/2]

tfel::tests::TestResult::TestResult ( const bool ,
const std::string_view ,
const std::string_view = std::string_view{} )

constructor

Parameters
[in]btells if the test is a success
[in]cdescription of the test
[in]edescription of why the test failed

Member Function Documentation

◆ append()

void tfel::tests::TestResult::append ( const TestResult & )

This is a typical stack operation. The function creates an element at the end of the vector and assigns the given data to it. Due to the nature of a vector this operation can be done in constant time if the vector has preallocated space available.

Parameters
[in]r: result to be appended

◆ begin()

const_iterator tfel::tests::TestResult::begin ( ) const
nodiscard
Returns
a read-only (constant) iterator that points to the first element in the vector.

◆ duration()

double tfel::tests::TestResult::duration ( ) const
nodiscard
Returns
the test duration

◆ end()

const_iterator tfel::tests::TestResult::end ( ) const
nodiscard
Returns
an iterator that points one past the last element in the vector

◆ getDescription()

const std::string & tfel::tests::TestResult::getDescription ( ) const
nodiscard
Returns
a description of the test

◆ getFailureDescription()

const std::string & tfel::tests::TestResult::getFailureDescription ( ) const
nodiscard
Returns
a description of why the test fails

◆ setTestDuration()

void tfel::tests::TestResult::setTestDuration ( const double )

set test duration

Parameters
[in]dtest duration

The documentation for this struct was generated from the following file: