1#!/usr/bin/env bash 2 3BROTLI="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" 4 5cd $BROTLI 6 7rm -rf bin 8mkdir bin 9cd bin 10 11cmake .. -B./ -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DENABLE_SANITIZER=address 12make clean 13make -j$(nproc) brotlidec 14 15c++ -c -std=c++11 ../fuzz/decode_fuzzer.cc -I./include 16ar rvs decode_fuzzer.a decode_fuzzer.o 17c++ ../fuzz/run_decode_fuzzer.cc -o run_decode_fuzzer -lasan decode_fuzzer.a ./libbrotlidec.a ./libbrotlicommon.a 18 19mkdir decode_corpora 20unzip ../java/org/brotli/integration/fuzz_data.zip -d decode_corpora 21 22for f in `ls decode_corpora` 23do 24 echo "Testing $f" 25 ./run_decode_fuzzer decode_corpora/$f 26done 27 28cd $BROTLI 29rm -rf bin 30