Can I run a command before a rostest when using catkin run_tests?

asked 2020-10-21 03:53:23 -0500

alcedine gravatar image

I have a node with a persistence mechanism (it reads some state from a file on startup, and writes to that same file afterwards).

I would like to test this node using rostest. To do that, I need to be in control of what the state of the persistence file is when the node is started (its contents, permissions, whether it exists at all, etc.). So I need to be able to execute some command before I start up the node.

Assuming I want to use catkin run_tests, can I make some command execute prior to each rostest?

I can kludge it by using a different file for each rostest and configuring them before the catkin run_tests command, but would prefer not to.

edit retag flag offensive close merge delete