1#!/bin/sh
2
3# Copyright (c) 2022 Eriptic Technologies. See the COPYRIGHT
4# file at the top-level directory of this distribution.
5
6# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9# option. This file may not be copied, modified, or distributed
10# except according to those terms.
11
12# This script generates a code coverage report.
13# For more information see: https://docs.zephyrproject.org/latest/develop/test/coverage.html#coverage-reports-using-the-posix-architecture
14
15cd ../test
16rm -rf build/
17rm -rf ../build/
18rm -rf lcov_html/
19rm lcov.info
20west build -b native_posix -- -DCONFIG_COVERAGE=y
21west build -t run
22lcov --capture --directory ./ --output-file lcov.info -q --rc lcov_branch_coverage=1
23genhtml lcov.info --output-directory lcov_html -q --ignore-errors source --branch-coverage --highlight --legend