|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
11 #include <robottestingframework/Arguments.h>
12 #include <robottestingframework/TestAssert.h>
29 ::robottestingframework::
TestCase(name),
43 ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(mPriv->yarp.checkNetwork(),
44 "YARP network does not seem to be available, is the yarp server accessible?");
51 bool useSuiteContext = envprop.
check(
"context");
64 if(rf.
check(
"from")) {
67 ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(cfgname.size(),
68 "Empty value was set for the '--from' property");
73 bool useTestContext = rf.
check(
"context");
77 if(!useSuiteContext && !useTestContext && !cfgfile.size() && envprop.
check(
"robotname")) {
81 ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(cfgfile.size(),
82 ::robottestingframework::Asserter::format(
"Cannot find configuration file %s", cfgfile.c_str()));
83 ROBOTTESTINGFRAMEWORK_TEST_REPORT(::robottestingframework::Asserter::format(
"Loading configuration from %s", cfgfile.c_str()));
85 property.fromConfigFile(cfgfile.c_str(), envprop);
87 property.fromString(rf.
toString().c_str());
90 return setup(property);
The YarpTestCase is a helper class to facilitate loading the tests settings which are developed for Y...
std::string getEnvironment(const char *key, bool *found=nullptr)
Read a variable from the environment.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
void fromArguments(const char *arguments, bool wipe=true)
Interprets a list of command arguments as a list of properties.
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.
virtual std::string asString() const
Get string value.
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.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
TestCase(std::string name)
Utilities for manipulating the YARP network, including initialization and shutdown.
bool setup(int argc, char **argv) override
std::string findFileByName(const std::string &name)
Find the full path to a file.
A class for storing options and configuration information.
std::string toString() const override
Return a standard text representation of the content of the object.
Helper class for finding config files and other external resources.