2020-12-16 13:30:36 +01:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
|
|
|
# This line causes an abort which breaks fuzzing:
|
|
|
|
sed -i '27d' include/valijson/utils/rapidjson_utils.hpp
|
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2020-12-16 13:32:37 +01:00
|
|
|
cmake -Dvalijson_BUILD_EXAMPLES=FALSE \
|
2020-12-16 13:30:36 +01:00
|
|
|
-Dvalijson_EXCLUDE_BOOST=TRUE \
|
|
|
|
..
|
|
|
|
|
|
|
|
make -j$(nproc)
|
|
|
|
|
|
|
|
cd ../tests/fuzzing
|
|
|
|
|
|
|
|
find ../.. -name "*.o" -exec ar rcs fuzz_lib.a {} \;
|
|
|
|
|
|
|
|
$CXX $CXXFLAGS -DVALIJSON_USE_EXCEPTIONS=1 \
|
2021-07-31 03:00:37 +02:00
|
|
|
-I/src/valijson/thirdparty/rapidjson-48fbd8c/include \
|
|
|
|
-I/src/valijson/thirdparty/rapidjson-48fbd8c/include/rapidjson \
|
2020-12-16 13:30:36 +01:00
|
|
|
-I/src/valijson/include \
|
|
|
|
-I/src/valijson/include/valijson \
|
|
|
|
-I/src/valijson/include/valijson/adapters \
|
|
|
|
-c fuzzer.cpp -o fuzzer.o
|
|
|
|
|
|
|
|
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \
|
|
|
|
-DVALIJSON_USE_EXCEPTIONS=1 \
|
|
|
|
-rdynamic fuzzer.o \
|
|
|
|
-o $OUT/fuzzer fuzz_lib.a
|
|
|
|
|
|
|
|
zip $OUT/fuzzer_seed_corpus.zip \
|
|
|
|
$SRC/valijson/doc/schema/draft-03.json
|