8#include <robottestingframework/Arguments.h>
9#include <robottestingframework/TestAssert.h>
26 ::robottestingframework::
TestCase(name),
40 ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(mPriv->yarp.checkNetwork(),
41 "YARP network does not seem to be available, is the yarp server accessible?");
45 std::string strEnv = getEnvironment();
48 bool useSuiteContext = envprop.
check(
"context");
61 if(rf.
check(
"from")) {
64 ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(cfgname.size(),
65 "Empty value was set for the '--from' property");
70 bool useTestContext = rf.
check(
"context");
74 if(!useSuiteContext && !useTestContext && !cfgfile.size() && envprop.
check(
"robotname")) {
78 ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(cfgfile.size(),
79 ::robottestingframework::Asserter::format(
"Cannot find configuration file %s", cfgfile.c_str()));
80 ROBOTTESTINGFRAMEWORK_TEST_REPORT(::robottestingframework::Asserter::format(
"Loading configuration from %s", cfgfile.c_str()));
82 property.fromConfigFile(cfgfile.c_str(), envprop);
84 property.fromString(rf.
toString().c_str());
87 return setup(property);
Utilities for manipulating the YARP network, including initialization and shutdown.
A class for storing options and configuration information.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
void fromArguments(const char *arguments, bool wipe=true)
Interprets a list of command arguments as a list of properties.
Helper class for finding config files and other external resources.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
bool setDefaultContext(const std::string &contextName)
Sets the context for the current ResourceFinder object.
bool configure(int argc, char *argv[], bool skipFirstArgument=true)
Sets up the ResourceFinder.
std::string toString() const override
Return a standard text representation of the content of the object.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
std::string findFileByName(const std::string &name)
Find the full path to a file.
virtual std::string asString() const
Get string value.
The YarpTestCase is a helper class to facilitate loading the tests settings which are developed for Y...
bool setup(int argc, char **argv) override
TestCase(std::string name)