1#!/bin/bash -eu 2# Copyright 2018 Google Inc. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16################################################################################ 17 18BUILD=$WORK/meson 19 20rm -rf $BUILD 21mkdir $BUILD 22 23meson $BUILD \ 24 -Doss_fuzz=enabled \ 25 -Db_lundef=false \ 26 -Ddefault_library=static \ 27 -Dlibmount=false 28 29ninja -C $BUILD 30 31find $BUILD/fuzzing -maxdepth 1 -executable -type f -exec cp "{}" $OUT \; 32 33find fuzzing -type f -name "*.dict" -exec cp "{}" $OUT \; 34 35for CORPUS in $(find fuzzing -type f -name "*.corpus"); do 36 BASENAME=${CORPUS##*/} 37 zip $OUT/${BASENAME%%.*}_seed_corpus.zip . -ws -r -i@$CORPUS 38done 39