Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Member Functions
SelfTest::Test< PluginClass, TestName > Class Template Reference

The Test template class is used to define a new test. More...

Inheritance diagram for SelfTest::Test< PluginClass, TestName >:
SelfTest::TestBase

Public Member Functions

virtual void runCustom (TestResults &testResults, bool &allChecksPassedFlag) override
 Implements custom test behavior. More...
 
- Public Member Functions inherited from SelfTest::TestBase
 TestBase (const QString &name)
 
virtual ~TestBase ()
 
const QString & getName () const
 
void run (TestResults &testResults)
 Runs the test and reports any failures to the specified test results. More...
 

Protected Member Functions

 Test ()
 

Protected Attributes

bool allChecksPassedFlag {true}
 
TestResults testResults
 

Static Protected Attributes

static bool initTrigger = Test::init()
 

Static Private Member Functions

static bool init ()
 

Additional Inherited Members

- Public Types inherited from SelfTest::TestBase
using TestConstructor = std::function< TestBase *()>
 

Detailed Description

template<typename PluginClass, typename TestName>
class SelfTest::Test< PluginClass, TestName >

The Test template class is used to define a new test.

Purposefully outside of the namespace for easy access

Parameters
pluginClassthe name of the class of the current plugin. This is the class that implements the EnvisionPlugin interface.
testNamethe name of this test. This name can be used at the command line to request that this specific test be started.

Constructor & Destructor Documentation

◆ Test()

template<typename PluginClass , typename TestName >
SelfTest::Test< PluginClass, TestName >::Test
inlineprotected

Member Function Documentation

◆ init()

template<typename PluginClass , typename TestName >
bool SelfTest::Test< PluginClass, TestName >::init
inlinestaticprivate

◆ runCustom()

template<typename PluginClass , typename TestName >
void SelfTest::Test< PluginClass, TestName >::runCustom ( TestResults testResults,
bool &  passed 
)
inlineoverridevirtual

Implements custom test behavior.

This function must be implemented for each test.

Parameters
testResultsTest failures are added here.
passedmust be set to false if the test failed.

Implements SelfTest::TestBase.

Member Data Documentation

◆ allChecksPassedFlag

template<typename PluginClass , typename TestName >
bool SelfTest::Test< PluginClass, TestName >::allChecksPassedFlag {true}
protected

◆ initTrigger

template<typename PluginClass , typename TestName >
bool SelfTest::Test< PluginClass, TestName >::initTrigger = Test::init()
staticprotected

◆ testResults

template<typename PluginClass , typename TestName >
TestResults SelfTest::Test< PluginClass, TestName >::testResults
protected