package documentation

Interface for using rostest from other Python code as well as running Python unittests with additional reporting mechanisms and rosbuild (CMake) integration.

Module rostest_main Undocumented
Module rostest_parent Undocumented
Module rostestutil No module docstring; 0/1 variable, 1/4 function documented
Module runner No module docstring; 0/4 variable, 2/12 functions documented

From __init__.py:

Function deprecated This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
Function get_master Get an XMLRPC handle to the Master. It is recommended to use the rosgraph.masterapi library instead, as it provides many conveniences.
Function is_publisher Predicate to check whether or not master think publisher_id publishes topic :returns: True if still register as a publisher, bool :raises: IOError If communication with master fails
Function is_subscriber Check whether or not master think subscriber_id subscribes to topic
Function rosrun Run a rostest/unittest-based integration test.
Function rostestmain Undocumented
Function unitrun Wrapper routine from running python unitttests with JUnit-compatible XML output. This is meant for unittests that do not not need a running ROS graph (i.e. offline tests only).
Constant XML_OUTPUT_FLAG Undocumented
Function _start_coverage Undocumented
Function _stop_coverage @param packages: list of packages to generate coverage reports for @type packages: [str] @param html: (optional) if not None, directory to generate html report to @type html: str
Constant _GLOBAL_CALLER_ID Undocumented
Variable _cov Undocumented
XML_OUTPUT_FLAG: str =

Undocumented

Value
'--gtest_output=xml:'
_GLOBAL_CALLER_ID: str =

Undocumented

Value
'/script'
def get_master():

Get an XMLRPC handle to the Master. It is recommended to use the rosgraph.masterapi library instead, as it provides many conveniences.

@return: XML-RPC proxy to ROS master @rtype: xmlrpclib.ServerProxy

def is_subscriber(topic, subscriber_id):

Check whether or not master think subscriber_id subscribes to topic

Returns
True if still register as a subscriber, bool
Raises
Unknown exceptionIOError If communication with master fails
def is_publisher(topic, publisher_id):

Predicate to check whether or not master think publisher_id publishes topic :returns: True if still register as a publisher, bool :raises: IOError If communication with master fails

def rosrun(package, test_name, test, sysargs=None):

Run a rostest/unittest-based integration test.

@param package: name of package that test is in @type package: str @param test_name: name of test that is being run @type test_name: str @param test: a test case instance or a name resolving to a test case or suite @type test: unittest.TestCase, or string @param sysargs: command-line args. If not specified, this defaults to sys.argv. rostest

will look for the --text and --gtest_output parameters

@type sysargs: list

def deprecated(func):

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

@deprecated
def unitrun(package, test_name, test, sysargs=None, coverage_packages=None):

Wrapper routine from running python unitttests with JUnit-compatible XML output. This is meant for unittests that do not not need a running ROS graph (i.e. offline tests only).

This enables JUnit-compatible test reporting so that test results can be reported to higher-level tools.

@param package: name of ROS package that is running the test @type package: str @param coverage_packages: list of Python package to compute coverage results for. Defaults to package @type coverage_packages: [str]

_cov =

Undocumented

def _start_coverage(packages):

Undocumented

def _stop_coverage(packages, html=None):

@param packages: list of packages to generate coverage reports for @type packages: [str] @param html: (optional) if not None, directory to generate html report to @type html: str

def rostestmain():

Undocumented