From 353e222e5c3f6129a62f1e28c6cebf9131aec226 Mon Sep 17 00:00:00 2001 From: hongtao Date: Fri, 24 Mar 2023 15:34:44 +0800 Subject: [PATCH] add lldb unittest pass judge to ci Signed-off-by: hongtao --- llvm_test_script/run_docker.sh | 47 +++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/llvm_test_script/run_docker.sh b/llvm_test_script/run_docker.sh index 55e1262..95215cc 100755 --- a/llvm_test_script/run_docker.sh +++ b/llvm_test_script/run_docker.sh @@ -72,21 +72,54 @@ llvmts_logdir="${WORK_DIR}/llvmts-log/${time_dir}" # make log mkdir -p ${llvmts_logdir} - -#llvmts -pushd ${WORK_DIR}/llvmts_scripts -bash run_x86_test.sh 2>&1 | tee ${llvmts_logdir}/x86_64-linux-hos_${TIME}.txt -bash run_x86_O2-test.sh 2>&1 | tee ${llvmts_logdir}/x86_64_linux-gnu-O2_${TIME}.txt -popd - # run lldb unit shell api tests export LD_LIBRARY_PATH="${WORK_DIR}/llvm/out/llvm_make/lib" +apt-get install libc++1 +sleep 10 +echo y pushd ${WORK_DIR}/llvm/out/llvm_make ../../prebuilts/cmake/linux-x86/bin/ninja check-lldb-unit | tee ${llvmts_logdir}/lldb_unit_${TIME}.txt ./bin/llvm-lit -sv tools/lldb/test/Shell/ --max-time 300 | tee ${llvmts_logdir}/lldb_shell_${TIME}.txt ./bin/llvm-lit -sv tools/lldb/test/API/ --max-time 300 | tee ${llvmts_logdir}/lldb_api_${TIME}.txt popd +unit=1 +if [ -e ${llvmts_logdir}/lldb_unit_${TIME}.txt ]; then + unit="$(grep -E "Failed:" ${llvmts_logdir}/lldb_unit_${TIME}.txt | tr -d [A-Z][a-z]' ':)" +fi + +shell=1 +if [ -e ${llvmts_logdir}/lldb_shell_${TIME}.txt ]; then + shell=0 + shell_unsupported="$(grep -E "Unsupported+\s+:" ${llvmts_logdir}/lldb_shell_${TIME}.txt | tr -d [A-Z][a-z]' ':)" + shell_expe_fail="$(grep -E "Expectedly Failed:" ${llvmts_logdir}/lldb_shell_${TIME}.txt | tr -d [A-Z][a-z]' ':)" + shell_failed="$(grep -E "Failed+\s+:" ${llvmts_logdir}/lldb_shell_${TIME}.txt | tr -d [A-Z][a-z]' ':)" + if [[ (-n "$shell_unsupported" && $shell_unsupported -gt 96) || (-n "$shell_expe_fail" && $shell_expe_fail -gt 6) || (-n "$shell_failed" && $shell_failed -gt 0) ]]; then + shell=1 + fi +fi + +api=1 +if [ -e ${llvmts_logdir}/lldb_api_${TIME}.txt ]; then + api=0 + api_unsupported="$(grep -E "Unsupported:" ${llvmts_logdir}/lldb_api_${TIME}.txt | tr -d [A-Z][a-z]' ':)" + api_expe_fail="$(grep -E "Expectedly Failed:" ${llvmts_logdir}/lldb_shell_${TIME}.txt | tr -d [A-Z][a-z]' ':)" + api_failed="$(grep -E "Failed+\s+:" ${llvmts_logdir}/lldb_api_${TIME}.txt | tr -d [A-Z][a-z]' ':)" + if [[ (-n "$api_unsupported" && $api_unsupported -gt 282) || (-n "$api_expe_fail" && $api_expe_fail -gt 5) || (-n "$api_failed" && $api_failed -gt 2) ]]; then + api=1 + fi +fi + +if [[ (-n "$unit" && $unit -gt 0) || $shell -eq 1 || $api -eq 1 ]]; then + exit 1 +fi + +#llvmts +pushd ${WORK_DIR}/llvmts_scripts +bash run_x86_test.sh 2>&1 | tee ${llvmts_logdir}/x86_64-linux-hos_${TIME}.txt +bash run_x86_O2-test.sh 2>&1 | tee ${llvmts_logdir}/x86_64_linux-gnu-O2_${TIME}.txt +popd + # 正则会出来结果会是 Failed : x,通过tr - 去除字母字符保留数字 X86=1 X86_O2=1 -- Gitee