from comptests import (comptests_for_all, comptests_for_all_dynamic, comptests_for_all_pairs, comptests_for_all_pairs_dynamic, comptests_for_some, comptests_for_some_pairs) from example_package import (get_conftools_example_class1, get_conftools_example_class2) library_class1 = get_conftools_example_class1() library_class2 = get_conftools_example_class2() for_all_class1 = comptests_for_all(library_class1) for_some_class1 = comptests_for_some(library_class1) for_some_class1_class2 = comptests_for_some_pairs(library_class1, library_class2) for_all_class1_class2 = comptests_for_all_pairs(library_class1, library_class2) for_all_class1_dynamic = comptests_for_all_dynamic(library_class1) for_all_class1_class2_dynamic = comptests_for_all_pairs_dynamic( library_class1, library_class2)
from bootstrapping_olympics import (get_conftools_agents, get_conftools_robots, get_conftools_nuisances, get_conftools_nuisances_causal) from comptests import comptests_for_all_pairs, comptests_for_all library_agents = get_conftools_agents() library_robots = get_conftools_robots() library_nuisances = get_conftools_nuisances() library_nuisances_causal = get_conftools_nuisances_causal() for_all_robots = comptests_for_all(library_robots) for_all_agents = comptests_for_all(library_agents) for_all_nuisances = comptests_for_all(library_nuisances) for_all_nuisances_causal = comptests_for_all(library_nuisances_causal) for_all_pairs = comptests_for_all_pairs(library_agents, library_robots) for_all_robot_nuisance_pairs = comptests_for_all_pairs(library_robots, library_nuisances) # # # XXX: this is not used yet # def wrap_with_desc(function, arguments, # agent=None, robot=None, nuisance=None): # ''' Calls function with arguments, and writes debug information # if an exception is detected. ''' # # try: # function(*arguments) # except: # msg = ('Error detected when running test (%s); '
# except: # msg = ('Error detected when running test (%s); displaying debug info.' # % function.__name__) # if dynamics is not None: # msg += '\ndynamics: %s' % dynamics # # TODO: write other info # logger.error(msg) # raise for_all_dynamics = comptests_for_all(get_conftools_dynamics()) for_all_vehicles = comptests_for_all(get_conftools_vehicles()) for_all_worlds = comptests_for_all(get_conftools_worlds()) for_all_sensors = comptests_for_all(get_conftools_sensors()) for_all_skins = comptests_for_all(get_conftools_skins()) for_all_world_vehicle_pairs = comptests_for_all_pairs(get_conftools_worlds(), get_conftools_vehicles()) # # for_all_dynamics = fancy_test_decorator(lister=all_dynamics, # arguments=lambda x: (x, get_dynamics(x)), # attributes=lambda x: dict(dynamics=x)) # # for_all_worlds = fancy_test_decorator(lister=all_worlds, # arguments=lambda x: (x, get_world(x)), # attributes=lambda x: dict(world=x)) # # for_all_vehicles = fancy_test_decorator(lister=all_vehicles, # arguments=lambda x: (x, get_vehicle(x)), # attributes=lambda x: dict(vehicle=x)) # # for_all_sensors = fancy_test_decorator(lister=all_sensors,
# function(*arguments) # except: # msg = ('Error detected when running test (%s); displaying debug info.' # % function.__name__) # if dynamics is not None: # msg += '\ndynamics: %s' % dynamics # # TODO: write other info # logger.error(msg) # raise for_all_dynamics = comptests_for_all(get_conftools_dynamics()) for_all_vehicles = comptests_for_all(get_conftools_vehicles()) for_all_worlds = comptests_for_all(get_conftools_worlds()) for_all_sensors = comptests_for_all(get_conftools_sensors()) for_all_skins = comptests_for_all(get_conftools_skins()) for_all_world_vehicle_pairs = comptests_for_all_pairs(get_conftools_worlds(), get_conftools_vehicles()) # # for_all_dynamics = fancy_test_decorator(lister=all_dynamics, # arguments=lambda x: (x, get_dynamics(x)), # attributes=lambda x: dict(dynamics=x)) # # for_all_worlds = fancy_test_decorator(lister=all_worlds, # arguments=lambda x: (x, get_world(x)), # attributes=lambda x: dict(world=x)) # # for_all_vehicles = fancy_test_decorator(lister=all_vehicles, # arguments=lambda x: (x, get_vehicle(x)), # attributes=lambda x: dict(vehicle=x)) # # for_all_sensors = fancy_test_decorator(lister=all_sensors,