Use unified coverage report command (#6537)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 20 Aug 2019 03:46:25 +0000 (12:46 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 20 Aug 2019 03:46:25 +0000 (12:46 +0900)
- 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 <hseok82.oh@samsung.com>
Makefile.template
infra/command/gen-coverage-report
infra/scripts/docker_coverage_report.sh
infra/scripts/test_coverage.sh

index 68847f2..ff15d5c 100644 (file)
@@ -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)/.
 
index 691e548..5f928ec 100644 (file)
@@ -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}" \
index f8794f7..c9bd9f1 100755 (executable)
@@ -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"
 
index a78367a..09963c7 100755 (executable)
@@ -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