Loading...
Searching...
No Matches
Test.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_TEST_H
#define ROBOTTESTINGFRAMEWORK_TEST_H
#include <string>
namespace robottestingframework {
class TestResult;
class Test
{
public:
Test(std::string name,
std::string description = "") :
strName(name),
strDescription(description)
{
}
virtual ~Test()
{
}
const std::string getName() const
{
return strName;
}
const std::string getDescription() const
{
return strDescription;
}
void setDescription(const std::string description)
{
strDescription = description;
}
virtual void run(TestResult& result) = 0;
virtual void interrupt()
{
}
virtual bool succeeded() const = 0;
protected:
void setName(std::string name)
{
strName = name;
}
private:
std::string strName;
std::string strDescription;
};
} // namespace robottestingframework
#endif // ROBOTTESTINGFRAMEWORK_TEST_H
robottestingframework::TestResult
The TestResult class is used to deliver the test results including any error and failures produced by...
Definition TestResult.h:44
robottestingframework::Test::getName
const std::string getName() const
getName Getting test name.
Definition Test.h:61
robottestingframework::Test::setName
void setName(std::string name)
setName setting the test name
Definition Test.h:111
robottestingframework::Test::succeeded
virtual bool succeeded() const =0
succeeded
robottestingframework::Test::setDescription
void setDescription(const std::string description)
setDescription Sets an optional string which describes the test.
Definition Test.h:80
robottestingframework::Test::~Test
virtual ~Test()
Test destructor.
Definition Test.h:53
robottestingframework::Test::run
virtual void run(TestResult &result)=0
the main caller of a test.
robottestingframework::Test::Test
Test(std::string name, std::string description="")
Test constructor.
Definition Test.h:43
robottestingframework::Test::interrupt
virtual void interrupt()
interrupt interrupts the current test run
Definition Test.h:95
robottestingframework::Test::strDescription
std::string strDescription
Definition Test.h:118
robottestingframework::Test::strName
std::string strName
Definition Test.h:117
robottestingframework::Test::getDescription
const std::string getDescription() const
getDescription Getting test description
Definition Test.h:70
robottestingframework
Definition Arguments.h:25