OpenChemistry / avogadrolibs

Avogadro libraries provide 3D rendering, visualization, analysis and data processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas.
https://two.avogadro.cc/
BSD 3-Clause "New" or "Revised" License
425 stars 164 forks source link

Add fuzz testing for file formats #1644

Open ghutchis opened 5 months ago

ghutchis commented 5 months ago

The latest seems to be fuzztest: https://github.com/google/fuzztest/blob/main/doc/quickstart-cmake.md https://github.com/google/fuzztest/blob/main/doc/use-cases.md

I'd suggest adding fuzz tests for all the "native" file formats, e.g:

Obvious many of the other formats should also get fuzz testing, but that's a good start.

ghutchis commented 5 months ago

Here's an example of loading files from a corpus: https://github.com/google/fuzztest/blob/main/doc/fuzz-test-macro.md#loading-seed-inputs-from-a-directory

It looks like this requires separate directories for each file type.