From a7f5450c6a4cf84513d15194e78b9e1804cb6278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BA=B7?= Date: Thu, 23 Sep 2021 19:53:06 +0800 Subject: [PATCH] fix st --- build.sh | 8 ++++++++ tests/st/CMakeLists.txt | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 586bf99..ef512f6 100644 --- a/build.sh +++ b/build.sh @@ -205,6 +205,14 @@ if [[ "X$ENABLE_PARSER_ST" = "Xon" ]]; then echo -e "\033[31m${RUN_TEST_CASE}\033[0m" exit 1; fi + echo "Generating coverage statistics, please wait..." + cd ${BASEPATH} + rm -rf ${BASEPATH}/cov + mkdir ${BASEPATH}/cov + lcov -c -d build/tests/st -o cov/tmp.info + lcov -r cov/tmp.info '*/output/*' '*/build/opensrc/*' '*/build/proto/*' '*/third_party/*' '*/tests/*' '/usr/local/*' '*/metadef/inc/*' -o cov/coverage.info + cd ${BASEPATH}/cov + genhtml coverage.info fi # generate output package in tar form, including ut/st libraries/executables diff --git a/tests/st/CMakeLists.txt b/tests/st/CMakeLists.txt index a835c25..10aa5db 100644 --- a/tests/st/CMakeLists.txt +++ b/tests/st/CMakeLists.txt @@ -14,7 +14,7 @@ # ============================================================================ project(st_parser) - +add_compile_options(-g --coverage -fprofile-arcs -fPIC -O0 -ftest-coverage) set(CMAKE_CXX_STANDARD 11) ################################################################################ @@ -98,6 +98,8 @@ set(MATEDEF_SRC_FILES "${PARSER_DIR}/metadef/graph/shape_refiner.cc" "${PARSER_DIR}/metadef/graph/tensor.cc" "${PARSER_DIR}/metadef/graph/types.cc" + "${PARSER_DIR}/metadef/graph/resource_context_mgr.cc" + "${PARSER_DIR}/metadef/graph/utils/constant_utils.cc" "${PARSER_DIR}/metadef/graph/utils/anchor_utils.cc" "${PARSER_DIR}/metadef/graph/utils/ge_ir_utils.cc" "${PARSER_DIR}/metadef/graph/utils/graph_utils.cc"