From 048aab6d66c45423386d0216fd7bf445fbd1dc7f Mon Sep 17 00:00:00 2001 From: Evan Benn Date: Mon, 7 Nov 2022 14:50:35 +1100 Subject: tests: Add llvm-cov option and run target for code coverage Code coverage can be requested with -Dllvm_cov and run with ninja llvm-cov-tests or llvm-cov-cli. BUG=b:187647884 BRANCH=None TEST=meson test; ninja llvm-cov-tests TEST=ran test_build.sh with coverage enabled TEST=jenkins ran test_build.sh with coverage disabled Change-Id: Id6c73bff46e7b88d425956a80def97082b201f56 Signed-off-by: Evan Benn Reviewed-on: https://review.coreboot.org/c/flashrom/+/69268 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk --- scripts/llvm-cov | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 scripts/llvm-cov (limited to 'scripts') diff --git a/scripts/llvm-cov b/scripts/llvm-cov new file mode 100755 index 000000000..b512b3dee --- /dev/null +++ b/scripts/llvm-cov @@ -0,0 +1,6 @@ +#!/bin/sh + +cd "${MESON_BUILD_ROOT}" +llvm-profdata merge -sparse default.profraw -o default.profdata +llvm-cov show -instr-profile=default.profdata -format=html -output-dir=. "$@" +echo "file://${MESON_BUILD_ROOT}/index.html" -- cgit v1.2.3