File: test-coverage.sh

package info (click to toggle)
dde-qt5integration 5.7.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,528 kB
  • sloc: cpp: 12,089; xml: 154; sh: 13; makefile: 10
file content (25 lines) | stat: -rwxr-xr-x 766 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
SCRIPT_PATH=$(dirname $0)
cd $SCRIPT_PATH && cd ..

BUILD_DIR=$PWD/build
HTML_DIR=${BUILD_DIR}/html
XML_DIR=${BUILD_DIR}/report

export ASAN_OPTIONS="halt_on_error=0"

cmake -B${BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DENABLE_COV=ON

cmake --build ${BUILD_DIR} --target unit-tests -j$(nproc)

cd $BUILD_DIR

tests/unit-tests --gtest_output=xml:${XML_DIR}/report_qtintegration.xml

lcov -d ./ -c -o coverage_all.info
lcov --remove coverage_all.info "*/tests/*" "*/usr/include*" "*build/*" --output-file coverage.info
genhtml -o $HTML_DIR $BUILD_DIR/coverage.info && mv ${BUILD_DIR}/html/index.html ${BUILD_DIR}/html/cov_qtintegration.html