Home | History | Annotate | Line # | Download | only in fuzz
build-coverage revision 1.1
      1  1.1  christos #!/bin/bash -eux
      2  1.1  christos #
      3  1.1  christos # Copyright (c) 2019 Yubico AB. All rights reserved.
      4  1.1  christos # Use of this source code is governed by a BSD-style
      5  1.1  christos # license that can be found in the LICENSE file.
      6  1.1  christos 
      7  1.1  christos LIBCBOR=$1
      8  1.1  christos LIBFIDO2=$2
      9  1.1  christos 
     10  1.1  christos CC=${CC:-clang}
     11  1.1  christos PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-${LIBCBOR}/install/lib/pkgconfig}
     12  1.1  christos export CC PKG_CONFIG_PATH
     13  1.1  christos 
     14  1.1  christos # Clean up.
     15  1.1  christos rm -rf ${LIBCBOR}/build ${LIBCBOR}/install ${LIBFIDO2}/build
     16  1.1  christos 
     17  1.1  christos # Patch, build, and install libcbor.
     18  1.1  christos (cd ${LIBCBOR} && patch -N -l -s -p0 < ${LIBFIDO2}/fuzz/README) || true
     19  1.1  christos mkdir ${LIBCBOR}/build ${LIBCBOR}/install
     20  1.1  christos (cd ${LIBCBOR}/build && cmake -DCMAKE_INSTALL_PREFIX=${LIBCBOR}/install ..)
     21  1.1  christos make -C ${LIBCBOR}/build all install
     22  1.1  christos 
     23  1.1  christos # Build libfido2.
     24  1.1  christos mkdir -p ${LIBFIDO2}/build
     25  1.1  christos (cd ${LIBFIDO2}/build && cmake -DFUZZ=1 -DLIBFUZZER=1 -DCOVERAGE=1 \
     26  1.1  christos 	-DCMAKE_BUILD_TYPE=Debug ..)
     27  1.1  christos make -C ${LIBFIDO2}/build
     28