mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-25 13:43:31 +00:00
Adapt lcov.sh to multiple source directories
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
4cd797e7fb
commit
4802aaab56
@ -51,8 +51,8 @@ lcov_library_report () {
|
|||||||
# Ubuntu 16.04 is affected, 18.04 and above are not.
|
# Ubuntu 16.04 is affected, 18.04 and above are not.
|
||||||
# https://github.com/linux-test-project/lcov/commit/632c25a0d1f5e4d2f4fd5b28ce7c8b86d388c91f
|
# https://github.com/linux-test-project/lcov/commit/632c25a0d1f5e4d2f4fd5b28ce7c8b86d388c91f
|
||||||
COVTMP=$PWD/Coverage/tmp
|
COVTMP=$PWD/Coverage/tmp
|
||||||
lcov --capture --initial --directory $library_dir -o "$COVTMP/files.info"
|
lcov --capture --initial ${lcov_dirs} -o "$COVTMP/files.info"
|
||||||
lcov --rc lcov_branch_coverage=1 --capture --directory $library_dir -o "$COVTMP/tests.info"
|
lcov --rc lcov_branch_coverage=1 --capture ${lcov_dirs} -o "$COVTMP/tests.info"
|
||||||
lcov --rc lcov_branch_coverage=1 --add-tracefile "$COVTMP/files.info" --add-tracefile "$COVTMP/tests.info" -o "$COVTMP/all.info"
|
lcov --rc lcov_branch_coverage=1 --add-tracefile "$COVTMP/files.info" --add-tracefile "$COVTMP/tests.info" -o "$COVTMP/all.info"
|
||||||
lcov --rc lcov_branch_coverage=1 --remove "$COVTMP/all.info" -o "$COVTMP/final.info" '*.h'
|
lcov --rc lcov_branch_coverage=1 --remove "$COVTMP/all.info" -o "$COVTMP/final.info" '*.h'
|
||||||
gendesc tests/Descriptions.txt -o "$COVTMP/descriptions"
|
gendesc tests/Descriptions.txt -o "$COVTMP/descriptions"
|
||||||
@ -64,9 +64,13 @@ lcov_library_report () {
|
|||||||
# Reset the traces to 0.
|
# Reset the traces to 0.
|
||||||
lcov_reset_traces () {
|
lcov_reset_traces () {
|
||||||
# Location with plain make
|
# Location with plain make
|
||||||
rm -f $library_dir/*.gcda
|
for dir in ${library_dirs}; do
|
||||||
|
rm -f ${dir}/*.gcda
|
||||||
|
done
|
||||||
# Location with CMake
|
# Location with CMake
|
||||||
rm -f $library_dir/CMakeFiles/*.dir/*.gcda
|
for dir in ${library_dirs}; do
|
||||||
|
rm -f ${dir}/CMakeFiles/*.dir/*.gcda
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -gt 0 ] && [ "$1" = "--help" ]; then
|
if [ $# -gt 0 ] && [ "$1" = "--help" ]; then
|
||||||
@ -75,13 +79,18 @@ if [ $# -gt 0 ] && [ "$1" = "--help" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if in_mbedtls_repo; then
|
if in_mbedtls_repo; then
|
||||||
library_dir='library'
|
library_dirs='library tf-psa-crypto/core tf-psa-crypto/drivers/builtin'
|
||||||
title='Mbed TLS'
|
title='Mbed TLS'
|
||||||
else
|
else
|
||||||
library_dir='core'
|
library_dirs='core drivers/builtin'
|
||||||
title='TF-PSA-Crypto'
|
title='TF-PSA-Crypto'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
lcov_dirs=""
|
||||||
|
for dir in ${library_dirs}; do
|
||||||
|
lcov_dirs="${lcov_dirs} --directory ${dir}"
|
||||||
|
done
|
||||||
|
|
||||||
main=lcov_library_report
|
main=lcov_library_report
|
||||||
while getopts r OPTLET; do
|
while getopts r OPTLET; do
|
||||||
case $OPTLET in
|
case $OPTLET in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user