Package rosunit :: Module core
[frames] | no frames]

Module core

source code

Functions
 
printlog(msg, *args) source code
 
printlog_bold(msg, *args) source code
 
printerrlog(msg, *args) source code
 
makedirs_with_parent_perms(p)
Create the directory using the permissions of the nearest (existing) parent directory.
source code
str
xml_results_file(test_pkg, test_name, is_rostest=False, env=None)
Returns: name of xml results file for specified test
source code
str
rostest_name_from_path(pkg_dir, test_file)
Derive name of rostest based on file name/path.
source code
 
create_xml_runner(test_pkg, test_name, results_file=None, is_rostest=False)
Create the unittest test runner with XML output
source code
Variables
  XML_OUTPUT_FLAG = '--gtest_output=xml:'
  __package__ = 'rosunit'
Function Details

makedirs_with_parent_perms(p)

source code 

Create the directory using the permissions of the nearest (existing) parent directory. This is useful for logging, where a root process sometimes has to log in the user's space.

Parameters:
  • p (str) - directory to create

xml_results_file(test_pkg, test_name, is_rostest=False, env=None)

source code 
Parameters:
  • test_pkg (str) - name of test's package
  • test_name (str), str - name of test
  • is_rostest (bool) - True if the results file is for a rostest-generated unit instance
Returns: str
name of xml results file for specified test

rostest_name_from_path(pkg_dir, test_file)

source code 

Derive name of rostest based on file name/path. rostest follows a certain convention defined above.

Returns: str
name of test

create_xml_runner(test_pkg, test_name, results_file=None, is_rostest=False)

source code 

Create the unittest test runner with XML output

Parameters:
  • test_pkg (str) - package name
  • test_name (str) - test name
  • is_rostest (bool) - if True, use naming scheme for rostest itself instead of individual unit test naming