Package rostest

Package rostest

source code

Submodules

Functions
bool
is_publisher(topic, publisher_id)
Predicate to check whether or not master think publisher_id publishes topic.
source code
bool
is_subscriber(topic, subscriber_id)
Predicate to check whether or not master think subscriber_id subscribes to topic.
source code
 
rosrun(package, test_name, test, sysargs=None)
Run a rostest/unittest-based integration test.
source code
 
rostestmain() source code
 
run(package, test_name, test, sysargs=None)
Run a rostest/unittest-based integration test.
source code
 
unitrun(package, test_name, test, sysargs=None, coverage_packages=None)
Wrapper routine from running python unitttests with JUnit-compatible XML output.
source code
Variables
  XML_OUTPUT_FLAG = '--gtest_output=xml:'
  __package__ = 'rostest'
Function Details

is_publisher(topic, publisher_id)

source code 

Predicate to check whether or not master think publisher_id publishes topic.

Returns: bool
True if still register as a publisher

is_subscriber(topic, subscriber_id)

source code 

Predicate to check whether or not master think subscriber_id subscribes to topic.

Returns: bool
True if still register as a subscriber

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

source code 

Run a rostest/unittest-based integration test.

Parameters:
  • package (str) - name of package that test is in
  • test_name (str) - name of test that is being run
  • test (unittest.TestCase) - test class
  • sysargs (list) - command-line args. If not specified, this defaults to sys.argv. rostest will look for the --text and --gtest_output parameters

run(package, test_name, test, sysargs=None)

source code 

Run a rostest/unittest-based integration test.

Parameters:
  • package (str) - name of package that test is in
  • test_name (str) - name of test that is being run
  • test (unittest.TestCase) - test class
  • sysargs (list) - command-line args. If not specified, this defaults to sys.argv. rostest will look for the --text and --gtest_output parameters

unitrun(package, test_name, test, sysargs=None, coverage_packages=None)

source code 

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.

Parameters:
  • package (str) - name of ROS package that is running the test
  • coverage_packages ([str]) - list of Python package to compute coverage results for. Defaults to package