def test_library(logger, solution, censor, test_type): """ Pulls each solution from the solution library and tests it against it's corresponding censor to confirm the censor wins. """ if censor == "dummy": pytest.skip("Skipping dummy censor test.") fitness = common.run_test(logger, solution, censor, test_type, log_on_success=True) # If the fitness was less than 0, the strategy failed to beat the censor if fitness > 0: pytest.fail("Fitness was %d - strategy beat censor." % fitness)
def test_one_library(logger): """ Runs a test using one solution from the library as a quick litmus test for code health. """ solution = "\/ [TCP:dataofs:5]-drop-|" censor = "censor2" test_type = "echo" fitness = common.run_test(logger, solution, censor, test_type, log_on_fail=True) # If the fitness was less than 0, the strategy failed to beat the censor if fitness < 0: pytest.fail("Fitness was %d - censor beat strategy." % fitness)
def test_library(logger, solution, censor, test_type): """ Pulls each solution from the solution library and tests it against it's corresponding censor to confirm the solution works. """ docker_censors = censors.censor_driver.get_censors() if censor not in docker_censors: pytest.skip("Censor %s is disabled." % censor) fitness = common.run_test(logger, solution, censor, test_type, log_on_fail=True) # If the fitness was less than 0, the strategy failed to beat the censor if fitness <= 0: pytest.fail("Fitness was %d - strategy failed to beat censor." % fitness)
def main(): common.run_test(taco_barnes_hut, "Barnes Hut") return
def main(): common.run_test(taco_barnes_hut, "FMM") return
def test_parameters(config, numofproc): run_test(parameters, config, numofproc) check_close_logger_call()
def main(): common.run_test(taco_compute, "Direct") return
def test_convert(config): run_test(convert, config) check_close_logger_call()