Skip to content

fuzztesting #3

@Tsche

Description

@Tsche

rsl::test should support fuzz tests.

minimal example:

extern "C" size_t
LLVMFuzzerMutate(uint8_t *Data, size_t Size, size_t MaxSize);

extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size,
                                          size_t MaxSize, unsigned int Seed) {
  // do custom mutations?
  return LLVMFuzzerMutate(Data, Size, MaxSize);
}

extern "C" int LLVMFuzzerRunDriver(int *argc, char ***argv,
                  int (*UserCb)(const uint8_t *Data, size_t Size));

int main(int argc, char** argv) {
  // fake argc/argv to set proper options
  LLVMFuzzerRunDriver(&argc, &argv, &test);
}

use google's fuzztest as reference. Centipede support is not desired at this point, libfuzzer is enough

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions