File tree 3 files changed +45
-0
lines changed
3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,7 @@ project(ros_rust)
3
3
4
4
catkin_package()
5
5
6
+ if (CATKIN_ENABLE_TESTING)
7
+ find_package (rostest REQUIRED)
8
+ add_rostest(test /empty.test )
9
+ endif ()
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ import re
3
+ import sys
4
+
5
+ filename_out = None
6
+ f = open ('/tmp/foo' , 'w+' )
7
+ f .write (str (sys .argv ))
8
+ for arg in sys .argv [1 :]:
9
+ m = re .match ('--gtest_output=xml:(.+.xml)' , arg )
10
+ if m is not None :
11
+ print >> f , m .groups ()[0 ]
12
+ filename_out = m .groups ()[0 ]
13
+ f .close ()
14
+
15
+ output = '''\
16
+ <?xml version="1.0" encoding="UTF-8"?>
17
+ <testsuites tests="3" failures="1" errors="0" time="35" name="AllTests">
18
+ <testsuite name="MathTest" tests="2" failures="1" errors="0" time="15">
19
+ <testcase name="Addition" status="run" time="7" classname="">
20
+ <failure message="Value of: add(1, 1)
 Actual: 3
Expected: 2" type=""/>
21
+ <failure message="Value of: add(1, -1)
 Actual: 1
Expected: 0" type=""/>
22
+ </testcase>
23
+ <testcase name="Subtraction" status="run" time="5" classname="">
24
+ </testcase>
25
+ </testsuite>
26
+ <testsuite name="LogicTest" tests="1" failures="0" errors="0" time="5">
27
+ <testcase name="NonContradiction" status="run" time="5" classname="">
28
+ </testcase>
29
+ </testsuite>
30
+ </testsuites>
31
+ '''
32
+
33
+ if filename_out is not None :
34
+ f_out = open (filename_out , 'w+' )
35
+ f_out .write (output )
36
+ f_out .close ()
37
+
38
+
Original file line number Diff line number Diff line change
1
+ <launch>
2
+ <test test-name="test_empty_node" pkg="ros_rust" type="test_empty" />
3
+ </launch>
You can’t perform that action at this time.
0 commit comments