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

#include <SpecTest.h>

Inheritance diagram for SpecsCpp::SpecTest:
SpecsCpp::ISpec SpecsCpp::SpecComponent SpecsCpp::SpecDocumented SpecsCpp::SpecHasCodeBlock SpecsCpp::ISpecComponent SpecsCpp::ISpecDocumented SpecsCpp::ISpecHasCodeBlock SpecsCpp::ISpecHasVariables SpecsCpp::ISpecComponent SpecsCpp::ISpecDocumented SpecsCpp::ISpecHasCodeBlock

Public Member Functions

 SpecTest (ISpecGroup *parent, std::string_view description, std::unique_ptr< SpecCodeBlock > codeBlock)
 
const char * full_description () const override
 
ISpecVariableCollectionvariables () const override
 
- Public Member Functions inherited from SpecsCpp::ISpec
virtual ~ISpec ()=default
 
- Public Member Functions inherited from SpecsCpp::ISpecComponent
virtual ~ISpecComponent ()=default
 
virtual ISpecGroupgroup () const =0
 
virtual void set_group (ISpecGroup *group)=0
 
virtual ISpecDataValueCollectiondata () const =0
 
virtual ISpecTagCollectiontags () const =0
 
virtual SpecComponentType type () const =0
 
virtual bool skip () const =0
 
virtual void mark_skipped (bool skip=true)=0
 
- Public Member Functions inherited from SpecsCpp::ISpecDocumented
virtual ~ISpecDocumented ()=default
 
virtual const char * description () const =0
 
virtual const char * full_description () const =0
 
- Public Member Functions inherited from SpecsCpp::ISpecHasCodeBlock
virtual ~ISpecHasCodeBlock ()=default
 
virtual ISpecCodeBlockcode_block () const =0
 
- Public Member Functions inherited from SpecsCpp::ISpecHasVariables
virtual ~ISpecHasVariables ()=default
 
virtual ISpecVariableCollectionvariables () const =0
 
ISpecVariableCollectionvars () const
 
bool has_var (const char *name) const
 
IVoidPointer * var (const char *name) const
 
template<typename T >
var (const char *name) const
 
template<typename T >
T * var (const char *name, T *value, bool destructable=true)
 
template<typename T >
void var (const char *name, T &&value, bool destructable=true)
 
template<typename T >
T * managed_var (const char *name, T *value)
 
template<typename T >
void managed_var (const char *name, T &&value)
 
template<typename T >
T * unmanaged_var (const char *name, T *value)
 
template<typename T >
void unmanaged_var (const char *name, T &&value)
 
const char * var_text (const char *name)
 
const char * var_text (const char *name, const char *value)
 
- Public Member Functions inherited from SpecsCpp::SpecComponent
 SpecComponent (SpecComponentType type, ISpecGroup *parentGroup, bool skip=false)
 
ISpecGroupgroup () const override
 
void set_group (ISpecGroup *group) override
 
ISpecDataValueCollectiondata () const override
 
ISpecTagCollectiontags () const override
 
SpecComponentType type () const override
 
bool skip () const override
 
void mark_skipped (bool skip=true) override
 
- Public Member Functions inherited from SpecsCpp::SpecDocumented
 SpecDocumented (std::string_view description)
 
const char * description () const override
 
- Public Member Functions inherited from SpecsCpp::SpecHasCodeBlock
 SpecHasCodeBlock (std::unique_ptr< SpecCodeBlock > codeBlock)
 
ISpecCodeBlockcode_block () const override
 

Detailed Description

Definition at line 18 of file SpecTest.h.

Constructor & Destructor Documentation

◆ SpecTest()

SpecsCpp::SpecTest::SpecTest ( ISpecGroup parent,
std::string_view  description,
std::unique_ptr< SpecCodeBlock codeBlock 
)
inline

Definition at line 27 of file SpecTest.h.

33 SpecHasCodeBlock(std::move(codeBlock)) {
34 if (parent == nullptr || strlen(parent->full_description()) == 0)
35 _fullDescription = description;
36 else
37 _fullDescription =
38 string_format("{} > {}", parent->full_description(), description);
39 }
SpecComponent(SpecComponentType type, ISpecGroup *parentGroup, bool skip=false)
SpecDocumented(std::string_view description)
const char * description() const override
SpecHasCodeBlock(std::unique_ptr< SpecCodeBlock > codeBlock)

Member Function Documentation

◆ full_description()

const char * SpecsCpp::SpecTest::full_description ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecDocumented.

Definition at line 41 of file SpecTest.h.

41{ return _fullDescription.c_str(); }

◆ variables()

ISpecVariableCollection * SpecsCpp::SpecTest::variables ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecHasVariables.

Definition at line 43 of file SpecTest.h.

43{ return _variables.get(); }

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