Test doesn't get back to the prompt after "catkin_make run_tests"

Hello,
after executing the test script on compilation by using “catkin_make run_tests”, it doesn’t get back to the prompt after test completed.
For solving this, can I normally use CTRL-Z or is there any risk that compilation will not finish?

Hello @luigiscarfonexxvi,

Yes, you can use Ctrl+Z since this will put the process in the background (not terminate it).

1 Like

This is still a problem. There is no hint that you might need to do this in the Unit Testing with ROS course.

The test complete and looks like the same output as the example on the side, but the prompt is unusable no matter what I tried, until I found this. Still, putting it into a background process with Ctrl-Z when it seems it should have completed and returned to a command prompt seems like masking another problem.

1 Like

Hello @DanielKorsah ,

You are totally right. I’ve fixed this issue by adding shutting down the ROS node after the test finishes, like this:

class TestRobotControl(unittest.TestCase):

    def setUp(self):
        self.rc = RobotControl()

    # only functions with 'test_'-prefix will be run!
    def test_deg_rad_conversion(self):

        speed, angle = self.rc.convert_degree_to_rad(60, 90)
        self.assertEquals(angle, 1.57, "1.57!=1.57")
        self.rc.shutdownhook()
2 Likes