Files
harfbuzz/test/fuzzing
Skef IterumandClaude Sonnet 4.6 075535160c [depend] Group test-generation utilities by purpose with section headers
Split the former "test generation infrastructure" section into three
labelled subsections:

  - Random sampling utilities  (rng_range / rng_select_distinct / rng_select_from_set)
  - Font and input queries     (get_gsub_features / parse_unicodes / parse_gids / parse_features)
  - Test parameter generation  (test_params / generate_test_from_explicit / generate_test_from_seed)

get_gsub_features was previously stranded between the RNG helpers and the
parsers; the new header makes clear it belongs with the input queries.
No logic changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 15:09:12 -07:00
..
2023-05-27 01:16:46 +02:00
2025-04-06 02:34:48 -06:00

Security Fuzzers

To build the fuzzers with libFuzzer to perform actual fuzzing, build with:

CXX=clang++ CXXFLAGS="-fsanitize=address,fuzzer-no-link" meson fuzzbuild --default-library=static -Dfuzzer_ldflags="-fsanitize=address,fuzzer"

ninja -Cfuzzbuild

Then, run the fuzzer like this:

fuzzbuild/test/fuzzing/hb-{shape,raster,vector,subset,repacker,depend}-fuzzer [-max_len=2048] [CORPUS_DIR]

Where max_len specifies the maximal length of font files to handle. The smaller the faster.

Note: The depend fuzzer requires -Ddepend_api=true meson option.

For more details consult the following locations:

Depend Closure Parity Test

The hb-depend-closure-parity test is distinct from the security fuzzers. While security fuzzers test robustness against malformed input, the closure parity test validates correctness by emulating the glyph closure calculation used for subsetting with one generated from the dependency graph to avoid implementation divergence. It should only be run on valid fonts.