From 4c0d0d9e5003c2a91d3f8d65b8f45851df241b9f 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: Tue, 20 Aug 2019 12:46:25 +0900 Subject: [PATCH] Use unified coverage report command (#6537) - Use unified coverage report command in docker_coverage_report.sh - Update Makefile.template to package infra - Update test_coverage.sh to archive test data and codes Signed-off-by: Hyeongseok Oh --- Makefile.template | 4 ++-- infra/command/gen-coverage-report | 4 ++++ infra/scripts/docker_coverage_report.sh | 2 +- infra/scripts/test_coverage.sh | 6 ++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile.template b/Makefile.template index 68847f2..ff15d5c 100644 --- a/Makefile.template +++ b/Makefile.template @@ -155,7 +155,7 @@ install_internal: build_test_suite: install_internal @echo "packaging test suite" @rm -rf $(INSTALL_ROOT)/test-suite.tar.gz - @tar -zcf test-suite.tar.gz tests/scripts tests/framework infra/scripts $(INSTALL_ALIAS) --dereference + @tar -zcf test-suite.tar.gz tests/scripts tests/framework infra $(INSTALL_ALIAS) --dereference @mv test-suite.tar.gz $(INSTALL_ROOT)/. build_coverage_suite: install_internal @@ -163,7 +163,7 @@ build_coverage_suite: install_internal @rm -rf $(INSTALL_ROOT)/coverage-suite.tar.gz @find Product -name "*.gcno" > include_lists.txt @pwd | grep -o '/' | wc -l > tests/scripts/build_path_depth.txt - @tar -zcf coverage-suite.tar.gz tests/scripts tests/framework infra/scripts $(INSTALL_ALIAS) --dereference -T include_lists.txt + @tar -zcf coverage-suite.tar.gz tests/scripts tests/framework infra runtimes $(INSTALL_ALIAS) --dereference -T include_lists.txt @rm -rf include_lists.txt tests/scripts/build_path_depth.txt @mv coverage-suite.tar.gz $(INSTALL_ROOT)/. diff --git a/infra/command/gen-coverage-report b/infra/command/gen-coverage-report index 691e548..5f928ec 100644 --- a/infra/command/gen-coverage-report +++ b/infra/command/gen-coverage-report @@ -40,6 +40,7 @@ RAW_TEST_COVERAGE_INFO_PATH="${OUTPUT_PATH}/coverage.test.raw.info" RAW_COVERAGE_INFO_PATH="${OUTPUT_PATH}/coverage.raw.info" EXTRACTED_COVERAGE_INFO_PATH="${OUTPUT_PATH}/coverage.extracted.info" EXCLUDED_COVERAGE_INFO_PATH="${OUTPUT_PATH}/coverage.excluded.info" +COVERAGE_INFO_PATH="${OUTPUT_PATH}/coverage.info" HTML_PATH="${OUTPUT_PATH}/html" CANDIDATES=() @@ -68,6 +69,9 @@ done "${LCOV_PATH}" -r "${EXTRACTED_COVERAGE_INFO_PATH}" -o "${EXCLUDED_COVERAGE_INFO_PATH}" \ '*.test.cpp' +# Final coverage data +cp -v ${EXCLUDED_COVERAGE_INFO_PATH} ${COVERAGE_INFO_PATH} + # Gen html "${GENHTML_PATH}" "${EXCLUDED_COVERAGE_INFO_PATH}" \ --prefix "${NNAS_PROJECT_PATH}" \ diff --git a/infra/scripts/docker_coverage_report.sh b/infra/scripts/docker_coverage_report.sh index f8794f7..c9bd9f1 100755 --- a/infra/scripts/docker_coverage_report.sh +++ b/infra/scripts/docker_coverage_report.sh @@ -14,7 +14,7 @@ set -e pushd $ROOT_PATH > /dev/null -CMD="GCOV_PATH=arm-linux-gnueabihf-gcov ./nnfw gen-coverage-report && +CMD="GCOV_PATH=arm-linux-gnueabihf-gcov NNAS_WORKSPACE=Product ./nnas gen-coverage-report runtimes && tar -zcf coverage/coverage_report.tar.gz coverage/html && python tools/lcov-to-cobertura-xml/lcov_cobertura.py coverage/coverage.info -o coverage/nnfw_coverage.xml" diff --git a/infra/scripts/test_coverage.sh b/infra/scripts/test_coverage.sh index a78367a..09963c7 100755 --- a/infra/scripts/test_coverage.sh +++ b/infra/scripts/test_coverage.sh @@ -34,7 +34,9 @@ NEURUN_LOG_ENABLE=1 GRAPH_DOT_DUMP=1 ./infra/scripts/test_arm_neurun_acl_cl.sh # Interpreter ./infra/scripts/test_neurun_interp.sh -mkdir -p gcov -find Product -type f \( -iname *.gcda -or -iname *.gcno \) -exec mv {} ./gcov/. \; +# Pack coverage test data: coverage-data.tar.gz +find Product -type f \( -iname *.gcda -or -iname *.gcno \) > include_lists.txt +tar -zcf coverage-data.tar.gz nnas nnfw infra runtimes -T include_lists.txt +rm -rf include_lists.txt popd > /dev/null -- 2.7.4