Frobby  0.9.5
Public Member Functions | List of all members
TestVisitor Class Reference

This class is a visitor for classes derived from Test according to the Visitor Pattern. More...

#include <TestVisitor.h>

Inheritance diagram for TestVisitor:
TestQualifier TestSorter TestRunner

Public Member Functions

virtual ~TestVisitor ()
 
virtual bool visitEnter (TestSuite &testSuite)
 Returns true if the testSuite should be iterated through. More...
 
virtual bool visit (TestCase &testCase)
 Visits a testCase and returns true if visiting of any other objects should continue after the testSuite has been visited. More...
 
virtual bool visit (TestSuite &testSuite)
 The default implementation calls visitEnter and visits the added objects in forward order if the return value is true. More...
 
virtual bool visitLeave (TestSuite &)
 Returns true if visiting of any other objects should continue after the testSuite has been visited. More...
 

Detailed Description

This class is a visitor for classes derived from Test according to the Visitor Pattern.

Definition at line 26 of file TestVisitor.h.

Constructor & Destructor Documentation

◆ ~TestVisitor()

TestVisitor::~TestVisitor ( )
virtual

Definition at line 22 of file TestVisitor.cpp.

Member Function Documentation

◆ visit() [1/2]

bool TestVisitor::visit ( TestCase testCase)
virtual

Visits a testCase and returns true if visiting of any other objects should continue after the testSuite has been visited.

The visiting process will stop if return value is false, according to the default implementation of visit(TestSuite&). The default implementation always returns true.

Reimplemented in TestRunner.

Definition at line 29 of file TestVisitor.cpp.

◆ visit() [2/2]

bool TestVisitor::visit ( TestSuite testSuite)
virtual

The default implementation calls visitEnter and visits the added objects in forward order if the return value is true.

If no visit returns false, then calls visitLeave and returns its return value. Returns false and visits no more objects and does not call visitLeave if return value of any visit is false. The return value of visitEnter only governs whether to iterate through the added tests, it does not prevent calling visitLeave and it does not directly influence the return value.

Usually it will be sufficient to overload visitEnter and visitLeave, as opposed to overloading this method.

Definition at line 33 of file TestVisitor.cpp.

◆ visitEnter()

bool TestVisitor::visitEnter ( TestSuite testSuite)
virtual

Returns true if the testSuite should be iterated through.

Is called before testSuite is processed in any other way, and if return value is false, the testSuite will not be iterated through, according to the default implemenation of visit(TestCase&). The default implementation always returns true.

Reimplemented in TestSorter, and TestQualifier.

Definition at line 25 of file TestVisitor.cpp.

◆ visitLeave()

bool TestVisitor::visitLeave ( TestSuite )
virtual

Returns true if visiting of any other objects should continue after the testSuite has been visited.

Is called as last step of visiting testSuite, and the visiting process will stop if return value is false, according to the default implementation of visit(TestSuite&). The default implementation always returns true.

Reimplemented in TestQualifier.

Definition at line 44 of file TestVisitor.cpp.


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