16 from __future__
import print_function
22 PKG =
'uuv_sensor_ros_plugins' 23 NAME =
'test_urdf_files' 26 roslib.load_manifest(PKG)
30 assert os.path.isfile(xml_file),
'Invalid XML xacro file' 31 return subprocess.check_output([
'xacro',
'--inorder', xml_file])
37 test_dir = os.path.abspath(os.path.dirname(__file__))
38 robots_dir = os.path.join(test_dir,
'..',
'urdf')
40 for item
in os.listdir(robots_dir):
41 if not os.path.isfile(os.path.join(robots_dir, item)):
43 output =
call_xacro(os.path.join(robots_dir, item))
47 'Parsing error found for file {}'.format(item))
50 'No such file or directory',
51 'Some file not found in {}'.format(item))
53 if __name__ ==
'__main__':
55 rosunit.unitrun(PKG, NAME, TestURDFFiles)