def get_oss_fuzz_builder_hash(benchmark): """Get the specified hash of the OSS-Fuzz builder for the OSS-Fuzz project used by |benchmark|.""" if is_oss_fuzz(benchmark): return oss_fuzz.get_config(benchmark)['oss_fuzz_builder_hash'] raise ValueError('Can only get project on OSS-Fuzz benchmarks.')
def get_project(benchmark): """Returns the OSS-Fuzz project of |benchmark| if it is based on an OSS-Fuzz project, otherwise raises ValueError.""" if is_oss_fuzz(benchmark): return oss_fuzz.get_config(benchmark)['project'] raise ValueError('Can only get project on OSS-Fuzz benchmarks.')
def get_fuzz_target(benchmark): """Returns the fuzz target of |benchmark|""" if is_oss_fuzz(benchmark): return oss_fuzz.get_config(benchmark)['fuzz_target'] return fuzzer_utils.DEFAULT_FUZZ_TARGET_NAME
def test_get_config(oss_fuzz_benchmark): """Test that we can get the configuration of an OSS-Fuzz benchmark.""" assert oss_fuzz.get_config(conftest.OSS_FUZZ_BENCHMARK_NAME) == ( conftest.OSS_FUZZ_BENCHMARK_CONFIG)