提交 3cedc772 编写于 作者: J JackFu123 提交者: Xiangquan Xiao

fix coverage error: can't find .gcno files

上级 6b8e3203
......@@ -417,21 +417,18 @@ function gen_coverage() {
COV_DIR=data/cov
rm -rf $COV_DIR
files=$(find bazel-out/local-dbg/bin/modules/ -iname "*.gcda" -o -iname "*.gcno" | grep -v external)
files=$(find bazel-out/local-dbg/bin/ -iname "*.gcda" -o -iname "*.gcno" | grep -v external | grep -v third_party)
for f in $files; do
target="$COV_DIR/objs/modules/${f##*modules}"
mkdir -p "$(dirname "$target")"
cp "$f" "$target"
done
files=$(find bazel-out/local-opt/bin/modules/ -iname "*.gcda" -o -iname "*.gcno" | grep -v external)
for f in $files; do
target="$COV_DIR/objs/modules/${f##*modules}"
if [ "$f" != "${f##*cyber}" ]; then
target="$COV_DIR/objs/cyber${f##*cyber}"
else
target="$COV_DIR/objs/modules${f##*modules}"
fi
mkdir -p "$(dirname "$target")"
cp "$f" "$target"
done
lcov --rc lcov_branch_coverage=1 --capture --directory "$COV_DIR/objs" --output-file "$COV_DIR/conv.info"
lcov --rc lcov_branch_coverage=1 --base-directory "/apollo/bazel-apollo" --capture --directory "$COV_DIR/objs" --output-file "$COV_DIR/conv.info"
if [ $? -ne 0 ]; then
fail 'lcov failed!'
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册