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

#include <SpecEnvironment.h>

Inheritance diagram for SpecsCpp::SpecEnvironment:
SpecsCpp::ISpecEnvironment

Public Member Functions

 SpecEnvironment ()
 
ISpecGrouproot_group () const override
 
ISpecOutputstandard_output () const override
 
void set_standard_output (ISpecOutput *output) override
 
ISpecOutputerror_output () const override
 
void set_error_output (ISpecOutput *output) override
 
ILocalSpecExceptionHandlerCollectionlocal_exception_handlers () const override
 
ISpecRunnerCollectionrunners () const override
 
ISpecReporterCollectionreporters () const override
 
void run (ISpecRunner *runner, ISpecReporterCollection *reporters, ISpecRunOptions *options, ISpecSuiteRunResultCallbackFn *callback) override
 
- Public Member Functions inherited from SpecsCpp::ISpecEnvironment
virtual ~ISpecEnvironment ()=default
 
virtual ISpecOutputstandard_output () const =0
 
virtual void set_standard_output (ISpecOutput *)=0
 
virtual ISpecOutputerror_output () const =0
 
virtual void set_error_output (ISpecOutput *)=0
 
virtual ISpecGrouproot_group () const =0
 
virtual ILocalSpecExceptionHandlerCollectionlocal_exception_handlers () const =0
 
virtual ISpecRunnerCollectionrunners () const =0
 
virtual ISpecReporterCollectionreporters () const =0
 
virtual void run (ISpecRunner *, ISpecReporterCollection *, ISpecRunOptions *, ISpecSuiteRunResultCallbackFn *)=0
 

Detailed Description

Definition at line 14 of file SpecEnvironment.h.

Constructor & Destructor Documentation

◆ SpecEnvironment()

SpecsCpp::SpecEnvironment::SpecEnvironment ( )
inline

Definition at line 23 of file SpecEnvironment.h.

24 : _root_group(std::make_unique<SpecGroup>()),
25 _reporters(std::make_unique<SpecReporterCollection>()),
26 _runners(std::make_unique<SpecRunnerCollection>()),
27 _local_exception_handlers(std::make_unique<LocalSpecExceptionHandlerCollection>()) {}

Member Function Documentation

◆ error_output()

ISpecOutput * SpecsCpp::SpecEnvironment::error_output ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 34 of file SpecEnvironment.h.

34{ return _error_output; }

◆ local_exception_handlers()

ILocalSpecExceptionHandlerCollection * SpecsCpp::SpecEnvironment::local_exception_handlers ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 37 of file SpecEnvironment.h.

37 {
38 return _local_exception_handlers.get();
39 }

Referenced by SpecsCpp::Entrypoint::main().

◆ reporters()

ISpecReporterCollection * SpecsCpp::SpecEnvironment::reporters ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 43 of file SpecEnvironment.h.

43{ return _reporters.get(); }

Referenced by run().

◆ root_group()

ISpecGroup * SpecsCpp::SpecEnvironment::root_group ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 29 of file SpecEnvironment.h.

29{ return _root_group.get(); }

Referenced by SpecsCpp::Entrypoint::main(), and run().

◆ run()

void SpecsCpp::SpecEnvironment::run ( ISpecRunner runner,
ISpecReporterCollection reporters,
ISpecRunOptions options,
ISpecSuiteRunResultCallbackFn callback 
)
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 45 of file SpecEnvironment.h.

48 {
49 runner->run(root_group(), reporters, options, callback);
50 }
ISpecGroup * root_group() const override
ISpecReporterCollection * reporters() const override

◆ runners()

ISpecRunnerCollection * SpecsCpp::SpecEnvironment::runners ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 41 of file SpecEnvironment.h.

41{ return _runners.get(); }

◆ set_error_output()

void SpecsCpp::SpecEnvironment::set_error_output ( ISpecOutput output)
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 35 of file SpecEnvironment.h.

35{ _error_output = output; }

◆ set_standard_output()

void SpecsCpp::SpecEnvironment::set_standard_output ( ISpecOutput output)
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 32 of file SpecEnvironment.h.

32{ _standard_output = output; }

◆ standard_output()

ISpecOutput * SpecsCpp::SpecEnvironment::standard_output ( ) const
inlineoverridevirtual

Implements SpecsCpp::ISpecEnvironment.

Definition at line 31 of file SpecEnvironment.h.

31{ return _standard_output; }

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