Loading...
Searching...
No Matches
TestResult.h
Go to the documentation of this file.
/*
* Robot Testing Framework
*
* Copyright (C) 2015-2019 Istituto Italiano di Tecnologia (IIT)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ROBOTTESTINGFRAMEWORK_TESTRESULT_H
#define ROBOTTESTINGFRAMEWORK_TESTRESULT_H
#include <robottestingframework/Test.h>
#include <robottestingframework/TestListener.h>
#include <robottestingframework/TestMessage.h>
#include <set>
namespace robottestingframework {
class TestResult
{
typedef std::set<TestListener*> ListenerContainer;
typedef std::set<TestListener*>::iterator ListenerIterator;
public:
TestResult();
virtual ~TestResult();
void addListener(TestListener* listener);
void removeListener(TestListener* listener);
void reset();
void addReport(const Test* test, TestMessage msg);
void addError(const Test* test, TestMessage msg);
void addFailure(const Test* test, TestMessage msg);
void startTest(const Test* test);
void endTest(const Test* test);
void startTestSuite(const Test* test);
void endTestSuite(const Test* test);
void startTestRunner();
void endTestRunner();
private:
ListenerContainer listeners;
};
} // namespace robottestingframework
#endif // ROBOTTESTINGFRAMEWORK_TESTResult_H
TestListener.h
TestMessage.h
Test.h
robottestingframework::TestListener
The base class of any test result listeners.
Definition TestListener.h:34
robottestingframework::TestMessage
A formated message with details.
Definition TestMessage.h:33
robottestingframework::TestResult::endTest
void endTest(const Test *test)
This is called when a Test is finished.
robottestingframework::TestResult::endTestRunner
void endTestRunner()
This is called when the TestRunner is finished.
robottestingframework::TestResult::ListenerIterator
std::set< TestListener * >::iterator ListenerIterator
Definition TestResult.h:46
robottestingframework::TestResult::startTestRunner
void startTestRunner()
This is called when the TestRunner is started.
robottestingframework::TestResult::startTestSuite
void startTestSuite(const Test *test)
This is called when a TestSuite is started.
robottestingframework::TestResult::addListener
void addListener(TestListener *listener)
Adding a new listener.
robottestingframework::TestResult::reset
void reset()
Clear the listener list.
robottestingframework::TestResult::removeListener
void removeListener(TestListener *listener)
Remove a listener.
robottestingframework::TestResult::addFailure
void addFailure(const Test *test, TestMessage msg)
This is called when a failure occurred during test run.
robottestingframework::TestResult::TestResult
TestResult()
TestResult constructor.
robottestingframework::TestResult::~TestResult
virtual ~TestResult()
TestResult destructor.
robottestingframework::TestResult::endTestSuite
void endTestSuite(const Test *test)
This is called when a TestSuite is finished.
robottestingframework::TestResult::startTest
void startTest(const Test *test)
This is called when a Test is started.
robottestingframework::TestResult::addError
void addError(const Test *test, TestMessage msg)
This is called when an error occurred during test run.
robottestingframework::TestResult::listeners
ListenerContainer listeners
Definition TestResult.h:133
robottestingframework::TestResult::ListenerContainer
std::set< TestListener * > ListenerContainer
Definition TestResult.h:45
robottestingframework::TestResult::addReport
void addReport(const Test *test, TestMessage msg)
This is called to report any arbitrary message from tests.
robottestingframework::Test
The simplest form of a test unit.
Definition Test.h:35
robottestingframework
Definition Arguments.h:25