|
PSCF v1.3.3
|
A TestRunner comprised of one or more child TestRunners. More...
#include <CompositeTestRunner.h>
Public Member Functions | |
| virtual | ~CompositeTestRunner () |
| Destructor. | |
| void | addChild (TestRunner &child) |
| Add an existing TestRunner as a child. | |
| void | addChild (TestRunner *childPtr) |
| Add a TestRunner as a child, and accept ownership. | |
| void | addChild (TestRunner *childPtr, const std::string &prefix) |
| Add a TestRunner as a child, accept ownership, and initialize filePrefix. | |
| virtual void | addFilePrefix (const std::string &prefix) |
| Prepend argument prefix to existing filePrefix. | |
| virtual int | run () |
| Run all children in sequence, using depth-first recursion. | |
| Public Member Functions inherited from TestRunner | |
| TestRunner () | |
| Constructor. | |
| virtual | ~TestRunner () |
| Destructor. | |
| void | recordFailure () |
| Increment counter for failed tests, and that of parent (if any). | |
| void | recordSuccess () |
| Increment counter for successful tests, and that of parent (if any). | |
| void | setParent (TestRunner &parent) |
| Set another TestRunner as the parent. | |
| TestRunner & | parent () |
| Return the parent object, if any. | |
| bool | hasParent () const |
| Does this object have a parent? | |
| int | nSuccess () const |
| Return number of successful tests run. | |
| int | nFailure () const |
| Return number of failed tests run. | |
| void | report () const |
| If this object has no parent, report success and failure counters. | |
| bool | isIoProcessor () const |
| Is this the IO processor of an MPI communicator? | |
| const std::string & | filePrefix () const |
| Return file prefix by const reference. | |
Additional Inherited Members | |
| Protected Attributes inherited from TestRunner | |
| std::string | filePrefix_ |
| Prefix added to file names. | |
A TestRunner comprised of one or more child TestRunners.
Definition at line 19 of file CompositeTestRunner.h.
|
virtual |
Destructor.
Definition at line 97 of file CompositeTestRunner.h.
| void CompositeTestRunner::addChild | ( | TestRunner & | child | ) |
Add an existing TestRunner as a child.
Children added by this method are not destroyed by the parent CompositeTestRunner destructor.
| child | enclosed TestRunner object |
Definition at line 108 of file CompositeTestRunner.h.
References TestRunner::setParent(), and TestRunner::TestRunner().
Referenced by addChild(), and pscfpp.param.Composite::read().
| void CompositeTestRunner::addChild | ( | TestRunner * | childPtr | ) |
Add a TestRunner as a child, and accept ownership.
Children added by this method are owned by the parent CompositeTestRunner, and so are destroyed by its destructor.
| childPtr | pointer to child TestRunner |
Definition at line 117 of file CompositeTestRunner.h.
References TestRunner::setParent(), and TestRunner::TestRunner().
Referenced by pscfpp.param.Composite::read().
| void CompositeTestRunner::addChild | ( | TestRunner * | childPtr, |
| const std::string & | prefix ) |
Add a TestRunner as a child, accept ownership, and initialize filePrefix.
Children added by this method are owned by the parent CompositeTestRunner, and so are destroyed by its destructor. The file prefix argument should normally be a path for a particular child defined relative to any common prefix used by all tests in this composite. The common prefix can then be prepended by calling addFilePrefix at run time.
| childPtr | pointer to child TestRunner |
| prefix | prefix to append to file names in all descendants |
Definition at line 127 of file CompositeTestRunner.h.
References addChild(), TestRunner::addFilePrefix(), and TestRunner::TestRunner().
Referenced by pscfpp.param.Composite::read().
|
virtual |
Prepend argument prefix to existing filePrefix.
This function also prepends prefix to all children. If this function is called at run-time for the highest level composite in a hierarchy, the prefix is thus propagated to all TestRunners in the hierarchy, and thus also used in the methods of UnitTest that are used to open files.
| prefix | string to prepend to existing filePrefix. |
Reimplemented from TestRunner.
Definition at line 137 of file CompositeTestRunner.h.
References TestRunner::addFilePrefix().
|
virtual |
Run all children in sequence, using depth-first recursion.
Implements TestRunner.
Definition at line 148 of file CompositeTestRunner.h.
References TestRunner::nFailure(), and TestRunner::report().