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

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

test: check asan available
#!/bin/bash #!/bin/bash
set -e
function usage() { function usage() {
echo "$0" echo "$0"
...@@ -69,7 +70,7 @@ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan ...@@ -69,7 +70,7 @@ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan
date date
docker run \ docker run \
-v $REP_MOUNT_PARAM \ -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 mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan
......
...@@ -17,10 +17,10 @@ fi ...@@ -17,10 +17,10 @@ fi
TAOS_DIR=`pwd` TAOS_DIR=`pwd`
LOG_DIR=$TAOS_DIR/sim/tsim/asan LOG_DIR=$TAOS_DIR/sim/tsim/asan
error_num=`cat ${LOG_DIR}/tsim.asan | grep "ERROR" | wc -l` error_num=`cat ${LOG_DIR}/*.asan | grep "ERROR" | wc -l`
memory_leak=`cat ${LOG_DIR}/tsim.asan | grep "Direct leak" | wc -l` memory_leak=`cat ${LOG_DIR}/*.asan | grep "Direct leak" | wc -l`
indirect_leak=`cat ${LOG_DIR}/tsim.asan | grep "Indirect leak" | wc -l` indirect_leak=`cat ${LOG_DIR}/*.asan | grep "Indirect leak" | wc -l`
runtime_error=`cat ${LOG_DIR}/tsim.asan | grep "runtime error" | 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 error_num: $error_num"\033[0m"
echo -e "\033[44;32;1m"asan memory_leak: $memory_leak"\033[0m" echo -e "\033[44;32;1m"asan memory_leak: $memory_leak"\033[0m"
...@@ -34,6 +34,6 @@ if [ $errors -eq 0 ]; then ...@@ -34,6 +34,6 @@ if [ $errors -eq 0 ]; then
exit 0 exit 0
else else
echo -e "\033[44;31;1m"asan total errors: $errors"\033[0m" echo -e "\033[44;31;1m"asan total errors: $errors"\033[0m"
cat ${LOG_DIR}/tsim.asan cat ${LOG_DIR}/*.asan
exit 1 exit 1
fi fi
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册