This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 4b9be0d9cb4bb3fdf332109483ffb00ce173b767
Author: chunping <[email protected]>
AuthorDate: Wed Aug 30 10:21:32 2023 +0800

    [Improvement](test) compute be full coverage (#23618)
---
 env.sh       | 19 +++++++++++++++++++
 run-be-ut.sh |  9 +++++++++
 2 files changed, 28 insertions(+)

diff --git a/env.sh b/env.sh
index 1a832d3a5b..a7fe915316 100755
--- a/env.sh
+++ b/env.sh
@@ -144,6 +144,25 @@ elif [[ "${DORIS_TOOLCHAIN}" == "clang" ]]; then
     if [[ -f "${DORIS_CLANG_HOME}/bin/llvm-symbolizer" ]]; then
         export ASAN_SYMBOLIZER_PATH="${DORIS_CLANG_HOME}/bin/llvm-symbolizer"
     fi
+
+    covs=()
+    while IFS='' read -r line; do covs+=("${line}"); done < <(find 
"${DORIS_CLANG_HOME}" -name "llvm-cov*")
+    if [[ ${#covs[@]} -ge 1 ]]; then
+        LLVM_COV="${covs[0]}"
+    else
+        LLVM_COV="$(command -v llvm-cov)"
+    fi
+    export LLVM_COV
+
+    profdatas=()
+    while IFS='' read -r line; do profdatas+=("${line}"); done < <(find 
"${DORIS_CLANG_HOME}" -name "llvm-profdata*")
+    if [[ ${#profdatas[@]} -ge 1 ]]; then
+        LLVM_PROFDATA="${profdatas[0]}"
+    else
+        LLVM_PROFDATA="$(command -v llvm-profdata)"
+    fi
+    export LLVM_PROFDATA
+
     if [[ -z "${ENABLE_PCH}" ]]; then
         ENABLE_PCH='ON'
     fi
diff --git a/run-be-ut.sh b/run-be-ut.sh
index 02fe5f368e..36e62c6644 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -381,11 +381,20 @@ export JAVA_OPTS="-Xmx1024m 
-DlogPath=${DORIS_HOME}/log/jni.log -Xloggc:${DORIS_
 # find all executable test files
 test="${DORIS_TEST_BINARY_DIR}/doris_be_test"
 profraw=${DORIS_TEST_BINARY_DIR}/doris_be_test.profraw
+profdata=${DORIS_TEST_BINARY_DIR}/doris_be_test.profdata
 
 file_name="${test##*/}"
 if [[ -f "${test}" ]]; then
     if [[ "_${DENABLE_CLANG_COVERAGE}" == "_ON" ]]; then
         LLVM_PROFILE_FILE="${profraw}" "${test}" 
--gtest_output="xml:${GTEST_OUTPUT_DIR}/${file_name}.xml" 
--gtest_print_time=true "${FILTER}"
+        if [[ -d "${DORIS_TEST_BINARY_DIR}"/report ]]; then
+            rm -rf "${DORIS_TEST_BINARY_DIR}"/report
+        fi
+        "${LLVM_PROFDATA} merge -o ${profdata} ${profraw}"
+        "${LLVM_COV} show -output-dir=${DORIS_TEST_BINARY_DIR}/report 
-format=html \
+            
-ignore-filename-regex='(.*gensrc/.*)|(.*_test\.cpp$)|(.*be/test.*)|(.*apache-orc/.*)|(.*clucene/.*)'
 \
+            -instr-profile=${profdata} \
+            -object=${test}"
     else
         "${test}" --gtest_output="xml:${GTEST_OUTPUT_DIR}/${file_name}.xml" 
--gtest_print_time=true "${FILTER}"
     fi


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to