93 virtual int run() = 0;
206{
return *parentPtr_; }
212{
return (parentPtr_ != 0); }
237{
return isIoProcessor_; }
240inline int TestRunner::mpiRank()
const
243inline int TestRunner::mpiSize()
const
263 isIoProcessor_ =
true;
265 mpiRank_ = MPI::COMM_WORLD.Get_rank();
266 mpiSize_ = MPI::COMM_WORLD.Get_size();
268 isIoProcessor_ =
true;
270 isIoProcessor_ =
false;
313 std::cout << std::endl;
314 std::cout << nSuccess_ <<
" successful tests " << std::endl;
315 std::cout << nFailure_ <<
" failed tests " << std::endl;
316 std::cout << std::endl;
325 std::string newPrefix = prefix;
Abstract base class for classes that run tests.
bool hasParent() const
Does this object have a parent?
virtual ~TestRunner()
Destructor.
bool isIoProcessor() const
Is this the IO processor of an MPI communicator?
virtual int run()=0
Run all tests.
TestRunner & parent()
Return the parent object, if any.
int nSuccess() const
Return number of successful tests run.
const std::string & filePrefix() const
Return file prefix by const reference.
void recordFailure()
Increment counter for failed tests, and that of parent (if any).
std::string filePrefix_
Prefix added to file names.
void recordSuccess()
Increment counter for successful tests, and that of parent (if any).
int nFailure() const
Return number of failed tests run.
virtual void addFilePrefix(const std::string &prefix)
Prepend argument prefix to existing filePrefix.
void report() const
If this object has no parent, report success and failure counters.
void setParent(TestRunner &parent)
Set another TestRunner as the parent.