From bae4faeae675cce547c83ec5f1e2941de4d6a53e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Wed, 13 Mar 2019 13:12:59 +0900 Subject: [PATCH] Fix coverage report bug (#4666) Fix coverage report bug setting SRC_PREFIX: use default value gen-coverage-report command use default variable for command Signed-off-by: Hyeongseok Oh --- scripts/command/gen-coverage-report | 12 ++++-------- scripts/standalone/docker_coverage_report.sh | 5 ----- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/scripts/command/gen-coverage-report b/scripts/command/gen-coverage-report index fa72717..f95c35b 100644 --- a/scripts/command/gen-coverage-report +++ b/scripts/command/gen-coverage-report @@ -2,14 +2,10 @@ # This file is based on https://github.sec.samsung.net/STAR/nncc/pull/80 -SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -HOST_HOME=$SCRIPT_ROOT/../.. - LCOV_PATH=$(command -v lcov) GENHTML_PATH=$(command -v genhtml) - -SRC_PREFIX=${SRC_PREFIX:-${DOCKER_HOME}} +SRC_PREFIX=${SRC_PREFIX:-${NNFW_PROJECT_PATH}} if [[ -z "${LCOV_PATH}" ]]; then echo "ERROR: 'lcov' is not found" @@ -24,7 +20,7 @@ fi OUTPUT_PATH="$1" if [[ -z "${OUTPUT_PATH}" ]]; then - OUTPUT_PATH="$HOST_HOME/coverage" + OUTPUT_PATH="$NNFW_PROJECT_PATH/coverage" fi if [[ -e "${OUTPUT_PATH}" ]]; then @@ -43,7 +39,7 @@ FINAL_COVERAGE_INFO_PATH="${OUTPUT_PATH}/coverage.info" HTML_PATH="${OUTPUT_PATH}/html" COVERTURA_PATH="${OUTPUT_PATH}/nnfw_coverage.xml" -"${LCOV_PATH}" -c -d "${HOST_HOME}" -o "${RAW_COVERAGE_INFO_PATH}" +"${LCOV_PATH}" -c -d "${NNFW_PROJECT_PATH}" -o "${RAW_COVERAGE_INFO_PATH}" "${LCOV_PATH}" -e "${RAW_COVERAGE_INFO_PATH}" -o "${LIBS_COVERAGE_INFO_PATH}" "${SRC_PREFIX}/libs/*" "${LCOV_PATH}" -e "${RAW_COVERAGE_INFO_PATH}" -o "${INCLUDE_COVERAGE_INFO_PATH}" "${SRC_PREFIX}/include/*" "${LCOV_PATH}" -e "${RAW_COVERAGE_INFO_PATH}" -o "${RUNTIMES_COVERAGE_INFO_PATH}" "${SRC_PREFIX}/runtimes/*" @@ -54,4 +50,4 @@ COVERTURA_PATH="${OUTPUT_PATH}/nnfw_coverage.xml" "${GENHTML_PATH}" "${FINAL_COVERAGE_INFO_PATH}" --output-directory "${HTML_PATH}" ${GENHTML_FLAG:-} tar -zcf "${OUTPUT_PATH}"/coverage_report.tar.gz "${HTML_PATH}" -python ${HOST_HOME}/externals/lcov-to-cobertura-xml/lcov_cobertura.py "${FINAL_COVERAGE_INFO_PATH}" -o "${COVERTURA_PATH}" +python ${NNFW_PROJECT_PATH}/externals/lcov-to-cobertura-xml/lcov_cobertura.py "${FINAL_COVERAGE_INFO_PATH}" -o "${COVERTURA_PATH}" diff --git a/scripts/standalone/docker_coverage_report.sh b/scripts/standalone/docker_coverage_report.sh index 7e3a197..89ebb28 100755 --- a/scripts/standalone/docker_coverage_report.sh +++ b/scripts/standalone/docker_coverage_report.sh @@ -6,13 +6,8 @@ ROOT_PATH="$CURRENT_PATH/../../" # docker image name if [[ -z $DOCKER_IMAGE_NAME ]]; then echo "It will use default docker image name" -else - export DOCKER_IMAGE_NAME fi -DOCKER_ENV_VARS=" -e SRC_PREFIX=$ROOT_PATH" -export DOCKER_ENV_VARS - pushd $ROOT_PATH > /dev/null source nnfw docker-run-user ./nnfw gen-coverage-report -- 2.7.4