cleanup.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 from __future__ import print_function
00004 
00005 import unittest
00006 import rostest
00007 import subprocess
00008 import rospkg
00009 import roslib.packages
00010 
00011 PKGNAME = 'moveit_ros_planning_interface'
00012 NODENAME = 'moveit_cleanup_tests'
00013 
00014 # As issue #592 is related to a crash during program exit,
00015 # we cannot perform a standard unit test.
00016 # We have to check the return value of the called program.
00017 # As rostest doesn't do this automatically, we do it ourselves
00018 # and call the actual test program here.
00019 class CleanupTest(unittest.TestCase):
00020     def __init__(self, *args, **kwargs):
00021         super(CleanupTest, self).__init__(*args, **kwargs)
00022         self._rospack = rospkg.RosPack()
00023 
00024     def test_py(self):
00025         cmd = roslib.packages.find_node(PKGNAME, "movegroup_interface.py", self._rospack)
00026         self.assertTrue(subprocess.call(cmd) == 0)
00027 
00028     def test_cpp(self):
00029         cmd = roslib.packages.find_node(PKGNAME, "test_cleanup", self._rospack)
00030         self.assertTrue(subprocess.call(cmd) == 0)
00031 
00032 if __name__ == '__main__':
00033     rostest.rosrun(PKGNAME, NODENAME, CleanupTest)


planning_interface
Author(s): Ioan Sucan
autogenerated on Mon Apr 23 2018 10:25:54