Jon Test
C++ Unit Test Tool. Not for production -- sample code only
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JonTest::TestSuiteInterface Class Referenceabstract

Interface for Test Suites. More...

#include <TestSuiteInterface.h>

Inheritance diagram for JonTest::TestSuiteInterface:
Inheritance graph
Collaboration diagram for JonTest::TestSuiteInterface:
Collaboration graph

Public Member Functions

virtual ~TestSuiteInterface ()
 Destructor – does nothing.
 
virtual void setup ()
 The Test Suite runsthis prior to each test case.
 
virtual void teardown ()
 The Test Suite runs this after to each test case.
 
virtual bool isValid (const std::string &caseName) const =0
 Determine if caseName can be run in this Test Suite,.
 
virtual int listTestCases (std::ostream &out) const =0
 List available Test Cases to out.
 
virtual Count run (Logger &logger)=0
 Runs all Test Cases in this Test Suite.
 
virtual Count run (Logger &logger, const std::string &testCase)=0
 Runs the given testCase in this Test Suite.
 

Detailed Description

Interface for Test Suites.

All Test Suites call setup() before and teardown() after each test case. Since not all Test Suitess need this behavior, a default do-nothing implementation is provided for each.

All Test Suites can be run() by the TestRunner – as determined by their implementation.

Definition at line 18 of file TestSuiteInterface.h.

Constructor & Destructor Documentation

◆ ~TestSuiteInterface()

JonTest::TestSuiteInterface::~TestSuiteInterface ( )
virtual

Destructor – does nothing.

Definition at line 6 of file TestSuiteInterface.cpp.

Member Function Documentation

◆ isValid()

virtual bool JonTest::TestSuiteInterface::isValid ( const std::string &  caseName) const
pure virtual

Determine if caseName can be run in this Test Suite,.

Returns
true if caseName can be run, otherwise false

Implemented in JonTest::TestSuiteTyped< TestSuiteDerived >.

◆ listTestCases()

virtual int JonTest::TestSuiteInterface::listTestCases ( std::ostream &  out) const
pure virtual

List available Test Cases to out.

<

Returns
the number of test cases

Implemented in JonTest::TestSuiteTyped< TestSuiteDerived >.

◆ run() [1/2]

virtual Count JonTest::TestSuiteInterface::run ( Logger logger)
pure virtual

Runs all Test Cases in this Test Suite.

Returns
the Count of tests run and tests failed in this Test Suite.
Parameters
loggerto log events of running the test suite and cases

Implemented in JonTest::TestSuiteTyped< TestSuiteDerived >.

◆ run() [2/2]

virtual Count JonTest::TestSuiteInterface::run ( Logger logger,
const std::string &  testCase 
)
pure virtual

Runs the given testCase in this Test Suite.

Note
If testCase is not valid, it will result in an error, and the returned count of running 1 test, and failing 1 test.
Returns
the Count of tests run and tests failed in this Test Suite.
Parameters
loggerto log events of running the test suite and cases
testCaseto run

Implemented in JonTest::TestSuiteTyped< TestSuiteDerived >.

◆ setup()

void JonTest::TestSuiteInterface::setup ( )
virtual

The Test Suite runsthis prior to each test case.

A default do-nothing implementation is provided.

Definition at line 11 of file TestSuiteInterface.cpp.

◆ teardown()

void JonTest::TestSuiteInterface::teardown ( )
virtual

The Test Suite runs this after to each test case.

A default do-nothing implementation is provided.

Definition at line 16 of file TestSuiteInterface.cpp.


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