Added prints to see what test is running and added wait before starting sync mode

This commit is contained in:
doterop 2020-07-31 16:17:00 +02:00 committed by bernat
parent 7726382734
commit a4fa5a82dd
9 changed files with 19 additions and 5 deletions

View File

@ -11,6 +11,7 @@ from . import SmokeTest
class TestBlueprintLibrary(SmokeTest): class TestBlueprintLibrary(SmokeTest):
def test_blueprint_ids(self): def test_blueprint_ids(self):
print("TestBlueprintLibrary.test_blueprint_ids")
library = self.client.get_world().get_blueprint_library() library = self.client.get_world().get_blueprint_library()
self.assertTrue([x for x in library]) self.assertTrue([x for x in library])
self.assertTrue([x for x in library.filter('sensor.*')]) self.assertTrue([x for x in library.filter('sensor.*')])

View File

@ -10,4 +10,5 @@ from . import SmokeTest
class TestClient(SmokeTest): class TestClient(SmokeTest):
def test_version(self): def test_version(self):
print("TestClient.test_version")
self.assertEqual(self.client.get_client_version(), self.client.get_server_version()) self.assertEqual(self.client.get_client_version(), self.client.get_server_version())

View File

@ -12,11 +12,13 @@ from . import SmokeTest
class TestMap(SmokeTest): class TestMap(SmokeTest):
def test_reload_world(self): def test_reload_world(self):
print("TestMap.test_reload_world")
map_name = self.client.get_world().get_map().name map_name = self.client.get_world().get_map().name
world = self.client.reload_world() world = self.client.reload_world()
self.assertEqual(map_name, world.get_map().name) self.assertEqual(map_name, world.get_map().name)
def test_load_all_maps(self): def test_load_all_maps(self):
print("TestMap.test_load_all_maps")
map_names = list(self.client.get_available_maps()) map_names = list(self.client.get_available_maps())
random.shuffle(map_names) random.shuffle(map_names)
for map_name in map_names: for map_name in map_names:

View File

@ -12,6 +12,7 @@ from . import SmokeTest
class TestPropsLoading(SmokeTest): class TestPropsLoading(SmokeTest):
def test_spawn_loaded_props(self): def test_spawn_loaded_props(self):
print("TestPropsLoading.test_spawn_loaded_props")
client = self.client client = self.client
world = client.get_world() world = client.get_world()

View File

@ -12,6 +12,7 @@ from . import SyncSmokeTest
class TestSnapshot(SyncSmokeTest): class TestSnapshot(SyncSmokeTest):
def test_spawn_points(self): def test_spawn_points(self):
print("TestSnapshot.test_spawn_points")
self.world = self.client.reload_world() self.world = self.client.reload_world()
# Check why the world settings aren't applied after a reload # Check why the world settings aren't applied after a reload

View File

@ -11,18 +11,18 @@ from . import SyncSmokeTest
class TestSpawnpoints(SyncSmokeTest): class TestSpawnpoints(SyncSmokeTest):
def test_spawn_points(self): def test_spawn_points(self):
print("TestSpawnpoints.test_spawn_points")
self.world = self.client.get_world() self.world = self.client.get_world()
blueprints = self.world.get_blueprint_library().filter("vehicle.*") blueprints = self.world.get_blueprint_library().filter("vehicle.*")
# get all available maps # get all available maps
maps = self.client.get_available_maps() maps = self.client.get_available_maps()
for m in maps: for m in maps:
# load the map # load the map
self.client.load_world(m) self.client.load_world(m)
self.world = self.client.get_world() self.world = self.client.get_world()
# get all spawn points # get all spawn points
spawn_points = self.world.get_map().get_spawn_points() spawn_points = self.world.get_map().get_spawn_points()
@ -61,6 +61,6 @@ class TestSpawnpoints(SyncSmokeTest):
self.assertAlmostEqual(t0.rotation.pitch, t1.rotation.pitch, places=2) self.assertAlmostEqual(t0.rotation.pitch, t1.rotation.pitch, places=2)
self.assertAlmostEqual(t0.rotation.yaw, t1.rotation.yaw, places=2) self.assertAlmostEqual(t0.rotation.yaw, t1.rotation.yaw, places=2)
self.assertAlmostEqual(t0.rotation.roll, t1.rotation.roll, places=2) self.assertAlmostEqual(t0.rotation.roll, t1.rotation.roll, places=2)
self.client.apply_batch_sync([carla.command.DestroyActor(x) for x in ids], True) self.client.apply_batch_sync([carla.command.DestroyActor(x) for x in ids], True)
frame = self.world.tick() frame = self.world.tick()

View File

@ -40,6 +40,7 @@ class TestStreamming(SmokeTest):
def test_multistream(self): def test_multistream(self):
print("TestStreamming.test_multistream")
# create the sensor # create the sensor
world = self.client.get_world() world = self.client.get_world()
bp = world.get_blueprint_library().find('sensor.other.gnss') bp = world.get_blueprint_library().find('sensor.other.gnss')

View File

@ -7,6 +7,7 @@
from . import SyncSmokeTest from . import SyncSmokeTest
import carla import carla
import time
try: try:
import queue import queue
@ -16,6 +17,7 @@ except ImportError:
class TestSynchronousMode(SyncSmokeTest): class TestSynchronousMode(SyncSmokeTest):
def test_reloading_map(self): def test_reloading_map(self):
print("TestSynchronousMode.test_reloading_map")
settings = carla.WorldSettings( settings = carla.WorldSettings(
no_rendering_mode=False, no_rendering_mode=False,
synchronous_mode=True, synchronous_mode=True,
@ -25,6 +27,10 @@ class TestSynchronousMode(SyncSmokeTest):
self.world.apply_settings(settings) self.world.apply_settings(settings)
def test_camera_on_synchronous_mode(self): def test_camera_on_synchronous_mode(self):
print("TestSynchronousMode.test_camera_on_synchronous_mode")
time.sleep(10.0)
cam_bp = self.world.get_blueprint_library().find('sensor.camera.rgb') cam_bp = self.world.get_blueprint_library().find('sensor.camera.rgb')
t = carla.Transform(carla.Location(z=10)) t = carla.Transform(carla.Location(z=10))
camera = self.world.spawn_actor(cam_bp, t) camera = self.world.spawn_actor(cam_bp, t)

View File

@ -10,6 +10,7 @@ from . import SmokeTest
class TestWorld(SmokeTest): class TestWorld(SmokeTest):
def test_fixed_delta_seconds(self): def test_fixed_delta_seconds(self):
print("TestWorld.test_fixed_delta_seconds")
world = self.client.get_world() world = self.client.get_world()
settings = world.get_settings() settings = world.get_settings()
self.assertFalse(settings.synchronous_mode) self.assertFalse(settings.synchronous_mode)