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

The TestManager class manages test registrations and execution for each plug-in. More...

Static Public Member Functions

static void add (TestBase::TestConstructor test, const QString &name)
 Adds a new test to the list of tests. More...
 
static TestResults runAllTests ()
 Runs all tests registered for this plug-in. More...
 
static TestResults runTest (const QString &name)
 Runs the specified test for this plug-in. More...
 

Private Member Functions

 TestManager ()
 This is a static class. More...
 

Static Private Attributes

static QMap< QString, TestBase::TestConstructor > * testConstructors = nullptr
 A list of all test constructors. More...
 

Detailed Description

template<typename T>
class SelfTest::TestManager< T >

The TestManager class manages test registrations and execution for each plug-in.

Parameters
TThe plug-in class for this plug-in. This is the class that implements the EnvisionPlugin interface. It is necessary that each plug-in has its own instantiation of the TestManager, since this manager contains a list of all test cases that the plug-in has.

Constructor & Destructor Documentation

◆ TestManager()

template<typename T >
SelfTest::TestManager< T >::TestManager
inlineprivate

This is a static class.

Object of this class can not be created.

Member Function Documentation

◆ add()

template<typename T >
void SelfTest::TestManager< T >::add ( TestBase::TestConstructor  test,
const QString &  name 
)
inlinestatic

Adds a new test to the list of tests.

Parameters
testThe constructor of the test class that implements this test.
nameThe name of this test.

◆ runAllTests()

template<typename T >
TestResults SelfTest::TestManager< T >::runAllTests
inlinestatic

Runs all tests registered for this plug-in.

◆ runTest()

template<typename T >
TestResults SelfTest::TestManager< T >::runTest ( const QString &  name)
inlinestatic

Runs the specified test for this plug-in.

Parameters
nameThe string id of the test to run.

Member Data Documentation

◆ testConstructors

template<typename T >
QMap< QString, TestBase::TestConstructor > * SelfTest::TestManager< T >::testConstructors = nullptr
staticprivate

A list of all test constructors.

Test classes are not created unless requested.