Craig Tiller | c6d6a02 | 2016-03-18 11:52:36 -0700 | [diff] [blame] | 1 | %YAML 1.2 |
| 2 | --- |
| 3 | foreach: targets |
| 4 | cond: selected.build == 'fuzzer' |
| 5 | output_name: ${selected.name}.sh |
| 6 | template: | |
| 7 | #!/bin/bash |
| 8 | # Copyright 2016, Google Inc. |
| 9 | # All rights reserved. |
| 10 | # |
| 11 | # Redistribution and use in source and binary forms, with or without |
| 12 | # modification, are permitted provided that the following conditions are |
| 13 | # met: |
| 14 | # |
| 15 | # * Redistributions of source code must retain the above copyright |
| 16 | # notice, this list of conditions and the following disclaimer. |
| 17 | # * Redistributions in binary form must reproduce the above |
| 18 | # copyright notice, this list of conditions and the following disclaimer |
| 19 | # in the documentation and/or other materials provided with the |
| 20 | # distribution. |
| 21 | # * Neither the name of Google Inc. nor the names of its |
| 22 | # contributors may be used to endorse or promote products derived from |
| 23 | # this software without specific prior written permission. |
| 24 | # |
| 25 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 26 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 27 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 28 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 29 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 30 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 31 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 32 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 33 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 34 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 35 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 36 | # |
| 37 | |
Craig Tiller | 3ecf26d | 2016-04-22 15:25:03 -0700 | [diff] [blame] | 38 | flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=${selected.maxlen} -timeout=120" |
Craig Tiller | 8d1cb3c | 2016-04-11 20:59:51 -0700 | [diff] [blame] | 39 | |
Craig Tiller | 134a6b6 | 2016-04-18 08:14:20 -0700 | [diff] [blame] | 40 | %if selected.get('dict'): |
| 41 | flags="$flags -dict=${selected.dict}" |
| 42 | %endif |
| 43 | |
Craig Tiller | 8d1cb3c | 2016-04-11 20:59:51 -0700 | [diff] [blame] | 44 | if [ "$jobs" != "1" ] |
| 45 | then |
Craig Tiller | 0d17ee3 | 2016-04-14 09:30:32 -0700 | [diff] [blame] | 46 | flags="-jobs=$jobs -workers=$jobs $flags" |
Craig Tiller | 8d1cb3c | 2016-04-11 20:59:51 -0700 | [diff] [blame] | 47 | fi |
| 48 | |
Craig Tiller | ae94594 | 2016-03-23 21:43:58 -0700 | [diff] [blame] | 49 | if [ "$config" == "asan-trace-cmp" ] |
| 50 | then |
| 51 | flags="-use_traces=1 $flags" |
| 52 | fi |
| 53 | |
| 54 | bins/$config/${selected.name} $flags fuzzer_output ${' '.join(selected.corpus_dirs)} |