summaryrefslogtreecommitdiff
path: root/fuzz/build-coverage
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz/build-coverage')
-rwxr-xr-xfuzz/build-coverage27
1 files changed, 27 insertions, 0 deletions
diff --git a/fuzz/build-coverage b/fuzz/build-coverage
new file mode 100755
index 0000000..af9f8df
--- /dev/null
+++ b/fuzz/build-coverage
@@ -0,0 +1,27 @@
1#!/bin/bash -eux
2#
3# Copyright (c) 2019 Yubico AB. All rights reserved.
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file.
6
7LIBCBOR=$1
8LIBFIDO2=$2
9
10CC=${CC:-clang}
11PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-${LIBCBOR}/install/lib/pkgconfig}
12export CC PKG_CONFIG_PATH
13
14# Clean up.
15rm -rf ${LIBCBOR}/build ${LIBCBOR}/install ${LIBFIDO2}/build
16
17# Patch, build, and install libcbor.
18(cd ${LIBCBOR} && patch -N -l -s -p0 < ${LIBFIDO2}/fuzz/README) || true
19mkdir ${LIBCBOR}/build ${LIBCBOR}/install
20(cd ${LIBCBOR}/build && cmake -DCMAKE_INSTALL_PREFIX=${LIBCBOR}/install ..)
21make -C ${LIBCBOR}/build all install
22
23# Build libfido2.
24mkdir -p ${LIBFIDO2}/build
25(cd ${LIBFIDO2}/build && cmake -DFUZZ=1 -DLIBFUZZER=1 -DCOVERAGE=1 \
26 -DCMAKE_BUILD_TYPE=Debug ..)
27make -C ${LIBFIDO2}/build