llvm::runFuzzerOnInputs

Runs a fuzz target on the inputs specified on the command line.

Synopsis

Declared in <llvm/FuzzMutate/FuzzerCLI.h>

int
runFuzzerOnInputs(
    int ArgC,
    char* ArgV[],
    FuzzerTestFun TestOne,
    FuzzerInitFun Init = [](int *, char ***) { return 0; });

Description

Useful for testing fuzz targets without linking to libFuzzer. Finds inputs in the argument list in a libFuzzer compatible way.

Return Value

Zero on success, or a non-zero exit code on initialization or I/O failure.

Parameters

NameDescription
ArgCArgument count from the process command line.
ArgVArgument vector from the process command line.
TestOneCallback invoked once per input file with its contents.
InitOptional initialization callback, run before any inputs.