| 1 | #!/bin/bash |
| 2 | |
| 3 | # SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. |
| 4 | # |
| 5 | # SPDX-License-Identifier: GPL-3.0-only |
| 6 | |
| 7 | BUILD_DIR=build |
| 8 | REPORT_DIR=report |
| 9 | |
| 10 | cd ../../ |
| 11 | |
| 12 | rm -rf $BUILD_DIR |
| 13 | mkdir $BUILD_DIR |
| 14 | |
| 15 | cd $BUILD_DIR |
| 16 | |
| 17 | qmake ../ |
| 18 | make |
| 19 | |
| 20 | cd ../src/tests/ |
| 21 | rm -rf $BUILD_DIR |
| 22 | mkdir $BUILD_DIR |
| 23 | cd $BUILD_DIR |
| 24 | |
| 25 | qmake CONFIG+=debug ../ |
| 26 | |
| 27 | TESTARGS="--gtest_output=xml:deepin_test_report_boot_maker.xml" make check -j$(nproc) |
| 28 | |
| 29 | mv asan_loader.log* asan_dde-boot-maker.log |
| 30 | |
| 31 | [ -e asan_loader.log* ] && mv asan_loader.log* asan_dde-boot-maker.log || touch asan_dde-boot-maker.log |
| 32 | |
| 33 | lcov -d ./ -c -o coverage_all.info |
| 34 | |
| 35 | lcov --remove coverage_all.info "*/tests/*" "*/usr/include*" --output-file coverage.info |
| 36 | cd .. |
| 37 | genhtml -o $REPORT_DIR $BUILD_DIR/coverage.info |
| 38 | #rm -rf $BUILD_DIR |
| 39 | |
| 40 | exit 0 |