1# Copyright 2020 Google Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15function compile_fuzzer {
16  fuzzer=$(basename $1)
17
18  compile_go_fuzzer "github.com/dvyukov/go-fuzz-corpus/$fuzzer" Fuzz $fuzzer
19
20  # Pack the seed corpus
21  zip -r $OUT/fuzzer-${fuzzer}_seed_corpus.zip \
22      $GOPATH/src/github.com/dvyukov/go-fuzz-corpus/$fuzzer/corpus
23}
24
25export -f compile_fuzzer
26
27# Use this to attempt to compile all
28#find $SRC/go-fuzz-corpus -mindepth 1 -maxdepth 1 -type d -exec bash -c 'compile_fuzzer "$@"' bash {} \;
29
30compile_fuzzer asn1
31#compile_fuzzer bzip2
32compile_fuzzer csv
33compile_fuzzer elliptic
34compile_fuzzer flate
35compile_fuzzer fmt
36#compile_fuzzer gif
37compile_fuzzer gzip
38compile_fuzzer httpreq
39compile_fuzzer httpresp
40compile_fuzzer jpeg
41compile_fuzzer json
42compile_fuzzer lzw
43compile_fuzzer mime
44compile_fuzzer multipart
45compile_fuzzer png
46compile_fuzzer tar
47compile_fuzzer time
48#compile_fuzzer url
49compile_fuzzer xml
50compile_fuzzer zip
51compile_fuzzer zlib
52
53