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
463 stars 173 forks source link

Add fuzz testing for file formats #1644

Open ghutchis opened 8 months ago

ghutchis commented 8 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 8 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.