Fixing some rosbag test dependency issues

This commit is contained in:
Jeremy Leibs 2010-05-11 21:23:38 +00:00
parent d927a65b61
commit 9e6ca22685
14 changed files with 44 additions and 25 deletions

View File

@ -10,5 +10,9 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
rosbuild_add_pyunit(test/migrate_test.py)
rosbuild_add_rostest(test/random_record_play.xml)
rosbuild_add_rostest(test/random_record.xml)
rosbuild_add_rostest(test/random_play.xml)
ADD_DEPENDENCIES(rostest_test_random_play.xml rostest_test_random_record.xml)
rosbuild_add_rostest(test/random_play_sim.xml)
ADD_DEPENDENCIES(rostest_test_random_play_sim.xml rostest_test_random_record.xml)

View File

@ -0,0 +1,5 @@
<launch>
<test time-limit="100" test-name="02random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 1.0 0"/>
<test time-limit="100" test-name="03random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 0.5 0"/>
<test time-limit="100" test-name="04random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 2.0 0"/>
</launch>

View File

@ -0,0 +1,6 @@
<launch>
<param name="use_sim_time" value="true"/>
<test time-limit="100" test-name="05random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 1.0 1"/>
<test time-limit="100" test-name="06random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 0.5 1"/>
<test time-limit="100" test-name="07random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 2.0 1"/>
</launch>

View File

@ -100,7 +100,6 @@ class RandomRecord(unittest.TestCase):
# Keep trying to kill until it's dead instead of blocking on communicate
while (f1.poll() is None):
print "Looping?"
try:
os.kill(f1.pid, signal.SIGKILL)
except:

View File

@ -0,0 +1,3 @@
<launch>
<test time-limit="100" test-name="01random_record" pkg="test_rosbag" type="random_record.py" args="54321 10 10.0"/>
</launch>

View File

@ -1,9 +0,0 @@
<launch>
<test time-limit="100" test-name="01random_record" pkg="test_rosbag" type="random_record.py" args="54321 10 10.0"/>
<test time-limit="100" test-name="02random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 1.0 0"/>
<test time-limit="100" test-name="03random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 0.5 0"/>
<test time-limit="100" test-name="04random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 2.0 0"/>
<test time-limit="100" test-name="05random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 1.0 1"/>
<test time-limit="100" test-name="06random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 0.5 1"/>
<test time-limit="100" test-name="07random_play" pkg="test_rosbag" type="random_play.py" args="54321 10 10.0 2.0 1"/>
</launch>

View File

@ -24,14 +24,19 @@ rosbuild_genmsg()
#target_link_libraries(example ${PROJECT_NAME})
# unit tests
rosbuild_download_test_data(http://pr.willowgarage.com/data/rosrecord/rosrecord_rename_test.bag test/rosrecord_rename_test.bag 09c6e106c77b06ed3e836a5280c8a7c2)
rosbuild_download_test_data(http://pr.willowgarage.com/data/test_rosrecord/hello_world.bag test/hello_world.bag 95b2aecfd2069c4acb7a29357c7d9c41)
rosbuild_download_test_data(http://pr.willowgarage.com/data/rosrecord/rosrecord_rename_test.indexed.bag test/rosrecord_rename_test.bag 757ab53c4876d21f6d60b9a3e0efb23e)
rosbuild_download_test_data(http://pr.willowgarage.com/data/test_rosrecord/hello_world.indexed.bag test/hello_world.bag 10fa1e9a4184ddefb69d74a7d9021fc7)
rosbuild_add_pyunit(test/test_rosrecord_py.py)
#rosbuild_add_rostest(test/rename_test.xml)
rosbuild_add_rostest(test/rename_test.xml)
rosbuild_add_boost_directories()
rosbuild_add_gtest(test/test_recorder_player test/test_recorder_player.cpp)
rosbuild_link_boost(test/test_recorder_player system)
# Remove test until we resolve details of making them pass deterministically
rosbuild_add_rostest(test/random_record_play.xml)
rosbuild_add_rostest(test/random_record.xml)
rosbuild_add_rostest(test/random_play.xml)
ADD_DEPENDENCIES(rostest_test_random_play.xml rostest_test_random_record.xml)
rosbuild_add_rostest(test/random_play_sim.xml)
ADD_DEPENDENCIES(rostest_test_random_play_sim.xml rostest_test_random_record.xml)

View File

@ -62,6 +62,7 @@ class RandomPlay(unittest.TestCase):
# We know this message is coming in after a delay
nowtime -= self.start
if (not self.use_clock):
nowtime -= rospy.Duration(self.delay)

View File

@ -0,0 +1,5 @@
<launch>
<test time-limit="100" test-name="02random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 1.0 0"/>
<test time-limit="100" test-name="03random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 0.5 0"/>
<test time-limit="100" test-name="04random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 2.0 0"/>
</launch>

View File

@ -0,0 +1,6 @@
<launch>
<param name="use_sim_time" value="true"/>
<test time-limit="100" test-name="05random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 1.0 1"/>
<test time-limit="100" test-name="06random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 0.5 1"/>
<test time-limit="100" test-name="07random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 2.0 1"/>
</launch>

View File

@ -101,7 +101,6 @@ class RandomRecord(unittest.TestCase):
# Keep trying to kill until it's dead instead of blocking on communicate
while (f1.poll() is None):
print "Looping?"
try:
os.kill(f1.pid, signal.SIGKILL)
except:

View File

@ -0,0 +1,3 @@
<launch>
<test time-limit="100" test-name="01random_record" pkg="test_rosrecord" type="random_record.py" args="54321 10 10.0"/>
</launch>

View File

@ -1,9 +0,0 @@
<launch>
<test time-limit="100" test-name="01random_record" pkg="test_rosrecord" type="random_record.py" args="54321 10 10.0"/>
<test time-limit="100" test-name="02random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 1.0 0"/>
<test time-limit="100" test-name="03random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 0.5 0"/>
<test time-limit="100" test-name="04random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 2.0 0"/>
<test time-limit="100" test-name="05random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 1.0 1"/>
<test time-limit="100" test-name="06random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 0.5 1"/>
<test time-limit="100" test-name="07random_play" pkg="test_rosrecord" type="random_play.py" args="54321 10 10.0 2.0 1"/>
</launch>

View File

@ -197,6 +197,7 @@ TEST(TestSuite, record_play_latching)
int main(int argc, char **argv){
testing::InitGoogleTest(&argc, argv);
ros::init(argc, argv, "test_recorder_player");
return RUN_ALL_TESTS();
}