如何在Linux平台安装Lcov?
# wget http://downloads.sourceforge.net/ltp/lcov-1.9.tar.gz
# tar -zxvf lcov-1.9.tar.gz
# cd lcov-1.9
# ls
bin contrib descriptions.tests lcovrc man rpm
CHANGES COPYING example Makefile README
# make install
不需要编译,直接安装即可,lcov, gendesc, genhtml, geninfo, genpng将被安装到/usr/bin目录。
#!/bin/bash
#lcov报表
C=${BDSS_PATH}/${VERSION}/src
lcov_floder=${TESTCASEPERDAY_PATH}/${date_H}/result_dir
mkdir -p ${lcov_floder}
lcov_main=${lcov_floder}/main
mkdir -p ${lcov_main}
A=${lcov_floder}/a
export A
ls -l ${C} | awk '/^d/{print $NF}' > ${A}
for ((i=1;i<=22;i++));
do
lujin=$(sed -n "${i}p" ${A})
cd ${BDSS_PATH}/${VERSION}/src/${lujin}
if [[ -n $(find -name *.gcda) ]];then
lcov -d ./ -o ${lcov_main}/main${i}.info -b . -c
else :
fi
done
#lcov -d ${BDSS_PATH}/${VERSION} -o ${TESTCASEPERDAY_PATH}/${date_H}/result_dir/main.info -c
if [ -n $(find -name *.info) ];then
genhtml -o ${TESTCASEPERDAY_PATH}/${date_H}/result_dir ${TESTCASEPERDAY_PATH}/${date_H}/result_dir/main/*
else :
fi