1
2
3
4
5
6
7
8
9
10
11 from __future__ import print_function
12
13 import roslaunch
14
15
16
17
18
19
21 '''
22 Drop in replacement for ROSTestLaunchParent that lets us manage
23 the run id ourselves.
24 '''
25
26 - def __init__(self, run_id, config, roslaunch_files, port):
27 if config is None:
28 raise Exception("config not initialized")
29
30
31
32 super(RoconTestLaunchParent, self).__init__(run_id, roslaunch_files, is_core=False, port=port, is_rostest=True)
33 self.config = config
34
38
40 """
41 initializes self.config and xmlrpc infrastructure
42 """
43 self._start_infrastructure()
44 self._init_runner()
45
51
53 """
54 perform launch of nodes, does not launch tests. rostest_parent
55 follows a different pattern of init/run than the normal
56 roslaunch, which is why it does not reuse start()/spin()
57 """
58 if self.runner is not None:
59 return self.runner.launch()
60 else:
61 raise Exception("no runner to launch")
62
64 """
65 run the test, blocks until completion
66 """
67 if self.runner is not None:
68
69 return self.runner.run_test(test)
70 else:
71 raise Exception("no runner")
72