2021-02-01 18:07:31 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2023-08-14 17:01:22 +08:00
|
|
|
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
|
2022-08-11 13:02:07 +08:00
|
|
|
#
|
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
2023-08-14 17:01:22 +08:00
|
|
|
set -ex
|
2022-08-11 13:02:07 +08:00
|
|
|
|
2022-08-29 16:12:51 +08:00
|
|
|
BUILD_DIR=`pwd`/../build/tests/
|
|
|
|
|
HTML_DIR=${BUILD_DIR}/html
|
|
|
|
|
XML_DIR=${BUILD_DIR}/report
|
|
|
|
|
|
|
|
|
|
export ASAN_OPTIONS="halt_on_error=0"
|
|
|
|
|
|
|
|
|
|
# back to project directroy
|
|
|
|
|
cd ..
|
|
|
|
|
|
2023-09-19 11:56:53 +08:00
|
|
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DEnableCov=ON -DDSYSINFO_PREFIX=/tmp
|
2023-08-14 17:01:22 +08:00
|
|
|
|
|
|
|
|
cmake --build build -j$(nproc)
|
2022-08-29 16:12:51 +08:00
|
|
|
|
|
|
|
|
cd $BUILD_DIR
|
|
|
|
|
|
2022-09-02 15:56:30 +08:00
|
|
|
./ut-DtkCore --gtest_output=xml:${XML_DIR}/report_dtkcore.xml
|
2021-02-01 18:07:31 +08:00
|
|
|
|
2023-08-14 17:01:22 +08:00
|
|
|
# find *.gcda from build dir
|
|
|
|
|
lcov -d ../ -c -o coverage_all.info
|
2022-03-04 16:14:51 +08:00
|
|
|
lcov --remove coverage_all.info "*/tests/*" "*/usr/include*" "*build/src*" "*build-ut/src*" --output-file coverage.info
|
2021-02-01 18:07:31 +08:00
|
|
|
cd ..
|
2022-03-04 16:14:51 +08:00
|
|
|
genhtml -o $HTML_DIR $BUILD_DIR/coverage.info && mv ${BUILD_DIR}/html/index.html ${BUILD_DIR}/html/cov_dtkcore.html
|
2021-02-01 18:07:31 +08:00
|
|
|
|
2022-03-04 16:14:51 +08:00
|
|
|
test -e ${BUILD_DIR}/asan.log* && mv ${BUILD_DIR}/asan.log* ${BUILD_DIR}/asan_dtkcore.log || touch ${BUILD_DIR}/asan.log
|
2021-06-21 14:25:36 +08:00
|
|
|
|