MCPcopy Create free account
hub / github.com/ElementsProject/elements / merge_inputs

Function merge_inputs

test/fuzz/test_runner.py:221–251  ·  view source on GitHub ↗
(*, fuzz_pool, corpus, test_list, src_dir, build_dir, merge_dir)

Source from the content-addressed store, hash-verified

219
220
221def merge_inputs(*, fuzz_pool, corpus, test_list, src_dir, build_dir, merge_dir):
222 logging.info("Merge the inputs from the passed dir into the corpus_dir. Passed dir {}".format(merge_dir))
223 jobs = []
224 for t in test_list:
225 args = [
226 os.path.join(build_dir, 'src', 'test', 'fuzz', 'fuzz'),
227 '-merge=1',
228 '-shuffle=0',
229 '-prefer_small=1',
230 '-use_value_profile=1', # Also done by oss-fuzz https://github.com/google/oss-fuzz/issues/1406#issuecomment-387790487
231 os.path.join(corpus, t),
232 os.path.join(merge_dir, t),
233 ]
234 os.makedirs(os.path.join(corpus, t), exist_ok=True)
235 os.makedirs(os.path.join(merge_dir, t), exist_ok=True)
236
237 def job(t, args):
238 output = 'Run {} with args {}\n'.format(t, " ".join(args))
239 output += subprocess.run(
240 args,
241 env=get_fuzz_env(target=t, source_dir=src_dir),
242 check=True,
243 stderr=subprocess.PIPE,
244 universal_newlines=True,
245 ).stderr
246 logging.debug(output)
247
248 jobs.append(fuzz_pool.submit(job, t, args))
249
250 for future in as_completed(jobs):
251 future.result()
252
253
254def run_once(*, fuzz_pool, corpus, test_list, src_dir, build_dir, use_valgrind):

Callers 1

mainFunction · 0.85

Calls 3

infoMethod · 0.80
formatMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected