Loading...
Searching...
No Matches
TestSuite.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_TESTSUITE_H
#define ROBOTTESTINGFRAMEWORK_TESTSUITE_H
#include <robottestingframework/FixtureManager.h>
#include <robottestingframework/Test.h>
#include <robottestingframework/TestMessage.h>
#include <robottestingframework/TestResult.h>
#include <vector>
namespace robottestingframework {
class TestSuite :
public Test,
public FixtureEvents
{
typedef std::vector<Test*> TestContainer;
typedef std::vector<Test*>::iterator TestIterator;
typedef std::vector<FixtureManager*> FixtureContainer;
typedef std::vector<FixtureManager*>::iterator FixtureIterator;
typedef std::vector<FixtureManager*>::reverse_iterator FixtureRIterator;
public:
TestSuite(std::string name);
virtual ~TestSuite();
void addTest(Test* test);
void removeTest(Test* test);
void reset();
void addFixtureManager(FixtureManager* manager);
void fixtureCollapsed(TestMessage reason) override;
void run(TestResult& rsl) override;
void interrupt() override;
bool succeeded() const override;
TestResult* getResult();
std::size_t size() const;
protected:
virtual bool setup();
virtual void tearDown();
private:
Test* current;
TestResult* result;
bool successful;
bool fixtureOK;
bool interrupted;
TestMessage fixtureMessage;
FixtureContainer fixtureManagers;
TestContainer tests;
};
} // namespace robottestingframework
#endif // ROBOTTESTINGFRAMEWORK_TESTSUITE_H
FixtureManager.h
TestMessage.h
TestResult.h
Test.h
robottestingframework::FixtureEvents
class FixtureEvents
Definition FixtureManager.h:36
robottestingframework::FixtureManager
The FixtureManager can be used to to setup any fixture which is required for the tests before executi...
Definition FixtureManager.h:64
robottestingframework::TestMessage
A formated message with details.
Definition TestMessage.h:33
robottestingframework::TestResult
The TestResult class is used to deliver the test results including any error and failures produced by...
Definition TestResult.h:44
robottestingframework::TestSuite
The TestSuite holds a group of tests.
Definition TestSuite.h:55
robottestingframework::TestSuite::FixtureRIterator
std::vector< FixtureManager * >::reverse_iterator FixtureRIterator
Definition TestSuite.h:61
robottestingframework::TestSuite::getResult
TestResult * getResult()
getResult returns an instance of TestResult if run(TestResult &result) has been already called by a T...
robottestingframework::TestSuite::successful
bool successful
Definition TestSuite.h:156
robottestingframework::TestSuite::removeTest
void removeTest(Test *test)
Remove a test.
robottestingframework::TestSuite::result
TestResult * result
Definition TestSuite.h:155
robottestingframework::TestSuite::FixtureContainer
std::vector< FixtureManager * > FixtureContainer
Definition TestSuite.h:59
robottestingframework::TestSuite::run
void run(TestResult &rsl) override
the main caller of a TestSuite inherited from Test Class.
robottestingframework::TestSuite::~TestSuite
virtual ~TestSuite()
TestSuite destructor.
robottestingframework::TestSuite::succeeded
bool succeeded() const override
succeeded
robottestingframework::TestSuite::reset
void reset()
Clear the test list.
robottestingframework::TestSuite::addTest
void addTest(Test *test)
Adding a new test.
robottestingframework::TestSuite::fixtureCollapsed
void fixtureCollapsed(TestMessage reason) override
fixtureCollapsed is called by a fixture manager (if it is already setup) to inform the test suite tha...
robottestingframework::TestSuite::addFixtureManager
void addFixtureManager(FixtureManager *manager)
addFixtureManager add a fixture manager for the current test suite.
robottestingframework::TestSuite::TestSuite
TestSuite(std::string name)
TestSuite constructor.
robottestingframework::TestSuite::interrupt
void interrupt() override
interrupt interrupts the current test run
robottestingframework::TestSuite::fixtureManagers
FixtureContainer fixtureManagers
Definition TestSuite.h:160
robottestingframework::TestSuite::fixtureMessage
TestMessage fixtureMessage
Definition TestSuite.h:159
robottestingframework::TestSuite::TestIterator
std::vector< Test * >::iterator TestIterator
Definition TestSuite.h:58
robottestingframework::TestSuite::tearDown
virtual void tearDown()
tearDown is called after the test run
robottestingframework::TestSuite::interrupted
bool interrupted
Definition TestSuite.h:158
robottestingframework::TestSuite::fixtureOK
bool fixtureOK
Definition TestSuite.h:157
robottestingframework::TestSuite::size
std::size_t size() const
returns the number of tests in this suite
robottestingframework::TestSuite::setup
virtual bool setup()
setup is called before the test run
robottestingframework::TestSuite::current
Test * current
Definition TestSuite.h:154
robottestingframework::TestSuite::TestContainer
std::vector< Test * > TestContainer
Definition TestSuite.h:57
robottestingframework::TestSuite::FixtureIterator
std::vector< FixtureManager * >::iterator FixtureIterator
Definition TestSuite.h:60
robottestingframework::TestSuite::tests
TestContainer tests
Definition TestSuite.h:161
robottestingframework::Test
The simplest form of a test unit.
Definition Test.h:35
robottestingframework
Definition Arguments.h:25