Specs
Beautiful C++ Test Framework
Loading...
Searching...
No Matches
SpecsCpp::SpecRunResult Class Reference

#include <SpecRunResult.h>

Inheritance diagram for SpecsCpp::SpecRunResult:
SpecsCpp::ISpecRunResult

Public Member Functions

 SpecRunResult (ISpecComponent *component, ISpecGroup *group, ISpec *spec, RunResultStatus status, std::string_view message="")
 
RunResultStatus status () const override
 
const char * message () const override
 
ISpecComponentcomponent () const override
 
ISpecspec () const override
 
ISpecGroupgroup () const override
 
ISpecRunResultcopy () const override
 
- Public Member Functions inherited from SpecsCpp::ISpecRunResult
virtual ~ISpecRunResult ()=default
 
virtual ISpecComponentcomponent () const =0
 
virtual ISpecGroupgroup () const =0
 
virtual ISpecspec () const =0
 
virtual RunResultStatus status () const =0
 
virtual const char * message () const =0
 
virtual ISpecRunResultcopy () const =0
 
virtual const char * status_as_string () const
 

Static Public Member Functions

static std::unique_ptr< SpecRunResultpassed (ISpecComponent *component, ISpecGroup *group, ISpec *spec)
 
static std::unique_ptr< SpecRunResultfailed (ISpecComponent *component, ISpecGroup *group, ISpec *spec, std::string_view message="")
 
static std::unique_ptr< SpecRunResultnot_run (ISpecComponent *component, ISpecGroup *group, ISpec *spec)
 
static std::unique_ptr< SpecRunResulttimeout (ISpecComponent *component, ISpecGroup *group, ISpec *spec)
 

Detailed Description

Definition at line 11 of file SpecRunResult.h.

Constructor & Destructor Documentation

◆ SpecRunResult()

SpecsCpp::SpecRunResult::SpecRunResult ( ISpecComponent component,
ISpecGroup group,
ISpec spec,
RunResultStatus  status,
std::string_view  message = "" 
)
inline

Definition at line 19 of file SpecRunResult.h.

23 : _component(component),
24 _group(group),
25 _spec(spec),
26 _status(status),
27 _message(message) {}
const char * message() const override
ISpecComponent * component() const override
ISpecGroup * group() const override
ISpec * spec() const override
RunResultStatus status() const override

Member Function Documentation

◆ component()

ISpecComponent * SpecsCpp::SpecRunResult::component ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecRunResult.

Definition at line 31 of file SpecRunResult.h.

31{ return _component; }

Referenced by failed(), not_run(), passed(), and timeout().

◆ copy()

ISpecRunResult * SpecsCpp::SpecRunResult::copy ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecRunResult.

Definition at line 35 of file SpecRunResult.h.

35 {
36 return new SpecRunResult(_component, _group, _spec, _status, _message);
37 }
SpecRunResult(ISpecComponent *component, ISpecGroup *group, ISpec *spec, RunResultStatus status, std::string_view message="")

◆ failed()

static std::unique_ptr< SpecRunResult > SpecsCpp::SpecRunResult::failed ( ISpecComponent component,
ISpecGroup group,
ISpec spec,
std::string_view  message = "" 
)
inlinestatic

Definition at line 45 of file SpecRunResult.h.

47 {
48 return std::make_unique<SpecRunResult>(
50 );
51 }

Referenced by SpecsCpp::SpecCodeBlock::run().

◆ group()

ISpecGroup * SpecsCpp::SpecRunResult::group ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecRunResult.

Definition at line 33 of file SpecRunResult.h.

33{ return _group; }

Referenced by failed(), not_run(), passed(), and timeout().

◆ message()

const char * SpecsCpp::SpecRunResult::message ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecRunResult.

Definition at line 30 of file SpecRunResult.h.

30{ return _message.c_str(); }

Referenced by failed().

◆ not_run()

static std::unique_ptr< SpecRunResult > SpecsCpp::SpecRunResult::not_run ( ISpecComponent component,
ISpecGroup group,
ISpec spec 
)
inlinestatic

Definition at line 53 of file SpecRunResult.h.

55 {
56 return std::make_unique<SpecRunResult>(component, group, spec, RunResultStatus::NotRun);
57 }

◆ passed()

static std::unique_ptr< SpecRunResult > SpecsCpp::SpecRunResult::passed ( ISpecComponent component,
ISpecGroup group,
ISpec spec 
)
inlinestatic

Definition at line 39 of file SpecRunResult.h.

41 {
42 return std::make_unique<SpecRunResult>(component, group, spec, RunResultStatus::Passed);
43 }

Referenced by SpecsCpp::SpecCodeBlock::run().

◆ spec()

ISpec * SpecsCpp::SpecRunResult::spec ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecRunResult.

Definition at line 32 of file SpecRunResult.h.

32{ return _spec; }

Referenced by failed(), not_run(), passed(), and timeout().

◆ status()

RunResultStatus SpecsCpp::SpecRunResult::status ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecRunResult.

Definition at line 29 of file SpecRunResult.h.

29{ return _status; }

◆ timeout()

static std::unique_ptr< SpecRunResult > SpecsCpp::SpecRunResult::timeout ( ISpecComponent component,
ISpecGroup group,
ISpec spec 
)
inlinestatic

Definition at line 59 of file SpecRunResult.h.

61 {
62 return std::make_unique<SpecRunResult>(
64 );
65 }

Referenced by SpecsCpp::SpecCodeBlock::run().


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