Skip to content

Commit d834533

Browse files
committed
move OSS fuzz build script into the repo
1 parent 509a8b8 commit d834533

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

fuzz/oss_fuzz_build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -eu
2+
3+
# build and install cgif
4+
meson setup -Dfuzzer=true --prefix=$WORK --libdir=lib --default-library=static build
5+
meson install -C build
6+
# run tests:
7+
# This is going to generate the seed corpus from all the tests
8+
meson test -C build
9+
10+
cp "build/fuzz/cgif_fuzzer_seed_corpus.zip" $OUT/.
11+
cp "build/fuzz/cgif_file_fuzzer_seed_corpus.zip" $OUT/.
12+
cp "build/fuzz/cgif_rgb_fuzzer_seed_corpus.zip" $OUT/.
13+
14+
# build cgif's fuzz targets
15+
$CXX $CXXFLAGS -o "$OUT/cgif_fuzzer" -I"$WORK/include" \
16+
$LIB_FUZZING_ENGINE fuzz/cgif_fuzzer.c "$WORK/lib/libcgif.a"
17+
18+
$CXX $CXXFLAGS -o "$OUT/cgif_file_fuzzer" -I"$WORK/include" \
19+
$LIB_FUZZING_ENGINE fuzz/cgif_file_fuzzer.c "$WORK/lib/libcgif.a"
20+
21+
$CXX $CXXFLAGS -o "$OUT/cgif_rgb_fuzzer" -I"$WORK/include" \
22+
$LIB_FUZZING_ENGINE fuzz/cgif_rgb_fuzzer.c "$WORK/lib/libcgif.a"

0 commit comments

Comments
 (0)