aboutsummaryrefslogtreecommitdiff
path: root/projects/wget2
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2017-10-30 23:33:02 +0100
committerOliver Chang <oliverchang@users.noreply.github.com>2017-10-31 09:33:02 +1100
commitceaa1f2433f6644ae4dd99ddcdd494ff541c2d1c (patch)
treef9b1361985698d7b20112091ebbaaacca8140493 /projects/wget2
parent61a5763b4e2fcbc96e8423484bfd5133d231eda2 (diff)
downloadoss-fuzz-ceaa1f2433f6644ae4dd99ddcdd494ff541c2d1c.tar.gz
[wget2] Prepare for new fuzzers, don't execute network tests (#930)
Diffstat (limited to 'projects/wget2')
-rw-r--r--projects/wget2/Dockerfile2
-rwxr-xr-xprojects/wget2/build.sh33
2 files changed, 22 insertions, 13 deletions
diff --git a/projects/wget2/Dockerfile b/projects/wget2/Dockerfile
index 8dbe425e2..545dc9bbf 100644
--- a/projects/wget2/Dockerfile
+++ b/projects/wget2/Dockerfile
@@ -44,7 +44,7 @@ RUN git clone --depth=1 https://git.lysator.liu.se/nettle/nettle.git
RUN git clone --depth=1 https://gitlab.com/gnutls/gnutls.git
RUN git clone --depth=1 --recursive https://gnunet.org/git/libmicrohttpd.git
-RUN git clone --depth=1 --recursive https://gitlab.com/gnuwget/wget2.git
+RUN git clone --recursive https://gitlab.com/gnuwget/wget2.git
WORKDIR wget2
COPY build.sh $SRC/
diff --git a/projects/wget2/build.sh b/projects/wget2/build.sh
index 9cf2fca11..972adc3eb 100755
--- a/projects/wget2/build.sh
+++ b/projects/wget2/build.sh
@@ -84,24 +84,33 @@ export ASAN_OPTIONS=detect_leaks=0
cd $SRC/wget2
./bootstrap
+
+# build and run non-networking tests
+LIBS="-lgnutls -lnettle -lhogweed -lidn2 -lunistring" \
+ ./configure -C --enable-static --disable-shared --disable-doc --without-plugin-support
+make clean
+make -j$(nproc)
+make -j$(nproc) -C unit-tests check
+make -j$(nproc) -C fuzz check
+
+# build for fuzzing
LIBS="-lgnutls -lnettle -lhogweed -lidn2 -lunistring" \
-./configure --enable-static --disable-shared --disable-doc --without-plugin-support
+ ./configure -C --enable-fuzzing --enable-static --disable-shared --disable-doc --without-plugin-support
make clean
-make -j$(nproc) all check
+make -j$(nproc) -C lib
+make -j$(nproc) -C include
+make -j$(nproc) -C libwget
+make -j$(nproc) -C src
+# build fuzzers
cd fuzz
CXXFLAGS="$CXXFLAGS -L$WGET2_DEPS_PATH/lib/" make oss-fuzz
+
+find . -name '*_fuzzer' -exec cp -v '{}' $OUT ';'
find . -name '*_fuzzer.dict' -exec cp -v '{}' $OUT ';'
find . -name '*_fuzzer.options' -exec cp -v '{}' $OUT ';'
-for fuzzer in *_fuzzer; do
- cp -p "${fuzzer}" "$OUT"
-
- if [ -f "$SRC/${fuzzer}_seed_corpus.zip" ]; then
- cp "$SRC/${fuzzer}_seed_corpus.zip" "$OUT/"
- fi
-
- if [ -d "${fuzzer}.in/" ]; then
- zip -rj "$OUT/${fuzzer}_seed_corpus.zip" "${fuzzer}.in/"
- fi
+for dir in *_fuzzer.in; do
+ fuzzer=$(basename $dir .in)
+ zip -rj "$OUT/${fuzzer}_seed_corpus.zip" "${dir}/"
done