aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-03-17 14:12:45 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-03-17 14:12:45 -0700
commit32173c5c3c8803ba3132452d9512437a76d857e6 (patch)
tree30466ef31608746ba54e56a3addc284c97a7d61a /templates
parent921f4b0a6e0c77f8c1d0f48b72d7087a21f5e311 (diff)
First version of json fuzzer
Diffstat (limited to 'templates')
-rw-r--r--templates/Makefile.template5
-rw-r--r--templates/tools/dockerfile/test/fuzzers.template50
-rw-r--r--templates/vsprojects/buildtests_c.sln.template2
-rw-r--r--templates/vsprojects/grpc.sln.template2
-rw-r--r--templates/vsprojects/vcxproj.template2
5 files changed, 58 insertions, 3 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template
index c54c146620..57fc146131 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -1737,7 +1737,7 @@
$(LIBDIR)/$(CONFIG)/lib${dep}.a\
% endfor
- % if tgt.language == "c++" or tgt.boringssl:
+ % if tgt.language == "c++" or tgt.boringssl or tgt.build == 'fuzzer':
## C++ targets specificies.
% if tgt.build == 'protoc':
$(E) "[HOSTLD] Linking $@"
@@ -1791,6 +1791,9 @@
% elif tgt.language == 'c++' and tgt.build == 'benchmark':
$(GTEST_LIB)\
% endif
+ % if tgt.build == 'fuzzer':
+ -lFuzzer\
+ % endif
-o $(BINDIR)/$(CONFIG)/${tgt.name}
% if tgt.build == 'protoc' or tgt.language == 'c++':
diff --git a/templates/tools/dockerfile/test/fuzzers.template b/templates/tools/dockerfile/test/fuzzers.template
new file mode 100644
index 0000000000..d9e3806191
--- /dev/null
+++ b/templates/tools/dockerfile/test/fuzzers.template
@@ -0,0 +1,50 @@
+%YAML 1.2
+---
+foreach: targets
+output_name: ${selected.name}/Dockerfile
+cond: selected.build == 'fuzzer'
+template: |
+ # Copyright 2015-2016, Google Inc.
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #
+ # * Redistributions of source code must retain the above copyright
+ # notice, this list of conditions and the following disclaimer.
+ # * Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following disclaimer
+ # in the documentation and/or other materials provided with the
+ # distribution.
+ # * Neither the name of Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ FROM debian:jessie
+
+ <%include file="../apt_get_basic.include"/>
+ <%include file="../cxx_deps.include"/>
+ RUN git clone -n -b master http://llvm.org/git/llvm.git && ${'\\'}
+ cd llvm && ${'\\'}
+ git checkout 308857f && ${'\\'}
+ cd ..
+ RUN clang++ -c -g -O2 -std=c++11 llvm/lib/Fuzzer/*.cpp -IFuzzer
+ RUN ar ruv libFuzzer.a Fuzzer*.o
+ RUN mv libFuzzer.a /usr/lib
+ RUN rm -f Fuzzer*.o
+ RUN mkdir /var/local/jenkins
+ # Define the default command.
+ CMD ["bash"]
diff --git a/templates/vsprojects/buildtests_c.sln.template b/templates/vsprojects/buildtests_c.sln.template
index a985fea64d..21312ab79a 100644
--- a/templates/vsprojects/buildtests_c.sln.template
+++ b/templates/vsprojects/buildtests_c.sln.template
@@ -2,6 +2,6 @@
--- |
<%namespace file="sln_defs.include" import="gen_solution"/>\
<%
- solution_projects = [p for p in vsprojects if p.build != 'protoc' and p.language == 'c' and not p.boringssl and not p.zlib]
+ solution_projects = [p for p in vsprojects if p.build not in ['protoc', 'fuzzer'] and p.language == 'c' and not p.boringssl and not p.zlib]
%>\
${gen_solution(solution_projects, use_dlls='yes')}
diff --git a/templates/vsprojects/grpc.sln.template b/templates/vsprojects/grpc.sln.template
index dbbb2c2ad1..ded98383da 100644
--- a/templates/vsprojects/grpc.sln.template
+++ b/templates/vsprojects/grpc.sln.template
@@ -2,6 +2,6 @@
--- |
<%namespace file="sln_defs.include" import="gen_solution"/>\
<%
- solution_projects = [p for p in vsprojects if p.build not in ['protoc', 'test'] and p.language in ['c', 'c++'] and p.vs_proj_dir == '.' and not (p.build == 'private' and p.language == 'c++')]
+ solution_projects = [p for p in vsprojects if p.build not in ['protoc', 'test', 'fuzzer'] and p.language in ['c', 'c++'] and p.vs_proj_dir == '.' and not (p.build == 'private' and p.language == 'c++')]
%>\
${gen_solution(solution_projects, use_dlls='yes')}
diff --git a/templates/vsprojects/vcxproj.template b/templates/vsprojects/vcxproj.template
index ecf113b4a8..0bb208f443 100644
--- a/templates/vsprojects/vcxproj.template
+++ b/templates/vsprojects/vcxproj.template
@@ -2,12 +2,14 @@
---
foreach: vsprojects
output_name: ${selected.vs_proj_dir}/${selected.name}/${selected.name}.vcxproj
+cond: selected.build not in ['fuzzer']
template: |
<%namespace file="vcxproj_defs.include" import="gen_project"/>\
${gen_project(selected.name, vsprojects)}
---
foreach: vsprojects
output_name: ${selected.vs_proj_dir}/${selected.name}/${selected.name}.vcxproj.filters
+cond: selected.build not in ['fuzzer']
template: |
<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters(selected.name, vsprojects)}