未验证 提交 03a66e64 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #18029 from taosdata/fix/TD-20317

test: check asan available
#!/bin/bash
set -e
function usage() {
echo "$0"
......@@ -69,7 +70,7 @@ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan
date
docker run \
-v $REP_MOUNT_PARAM \
--rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DSANITIZER=true;make -j $THREAD_COUNT || exit 1 "
--rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DTOOLS_BUILD_TYPE=Debug;make -j $THREAD_COUNT || exit 1 "
mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan
......
......@@ -17,10 +17,10 @@ fi
TAOS_DIR=`pwd`
LOG_DIR=$TAOS_DIR/sim/tsim/asan
error_num=`cat ${LOG_DIR}/tsim.asan | grep "ERROR" | wc -l`
memory_leak=`cat ${LOG_DIR}/tsim.asan | grep "Direct leak" | wc -l`
indirect_leak=`cat ${LOG_DIR}/tsim.asan | grep "Indirect leak" | wc -l`
runtime_error=`cat ${LOG_DIR}/tsim.asan | grep "runtime error" | wc -l`
error_num=`cat ${LOG_DIR}/*.asan | grep "ERROR" | wc -l`
memory_leak=`cat ${LOG_DIR}/*.asan | grep "Direct leak" | wc -l`
indirect_leak=`cat ${LOG_DIR}/*.asan | grep "Indirect leak" | wc -l`
runtime_error=`cat ${LOG_DIR}/*.asan | grep "runtime error" | wc -l`
echo -e "\033[44;32;1m"asan error_num: $error_num"\033[0m"
echo -e "\033[44;32;1m"asan memory_leak: $memory_leak"\033[0m"
......@@ -34,6 +34,6 @@ if [ $errors -eq 0 ]; then
exit 0
else
echo -e "\033[44;31;1m"asan total errors: $errors"\033[0m"
cat ${LOG_DIR}/tsim.asan
cat ${LOG_DIR}/*.asan
exit 1
fi
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册