| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | builddir=build |
| 3 | reportdir=build-ut |
| 4 | rmscip-shell system . . rm. -r $builddir |
| 5 | rmscip-shell system . . rm. -r ../$builddir |
| 6 | rmscip-shell system . . rm. -r $reportdir |
| 7 | rmscip-shell system . . rm. -r ../$reportdir |
| 8 | mkdirscip-shell system . . mkdir. ../$builddir |
| 9 | mkdirscip-shell system . . mkdir. ../$reportdir |
| 10 | cd ../$builddir |
| 11 | #编译 |
| 12 | cmakescip-shell system . . cmake. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_ON" .. |
| 13 | makescip-shell system . . make. -j8 |
| 14 | #生成asan日志和ut测试xml结果 |
| 15 | ./tests/deepin-log-viewer-test --gtest_output=xml:./report/report_deepin-log-viewer.xml |
| 16 | ./tests/deepin-log-viewer-plugin-test --gtest_output=xml:./report/report_deepin-log-viewer-plugin.xml |
| 17 | |
| 18 | workdir=$(cd ../$(dirnamescip-shell system . . dirname. $0)/$builddir; pwdscip-shell system . . pwd.) |
| 19 | |
| 20 | mkdirscip-shell system . . mkdir. -p report |
| 21 | #统计代码覆盖率并生成html报告 |
| 22 | lcov -d $workdir -c -o ./coverage.info |
| 23 | |
| 24 | lcov --extract ./coverage.info '*/application/*' '*/logViewerAuth/*' '*/logViewerService/*' '*/logViewerTruncate/*' -o ./coverage.info |
| 25 | |
| 26 | lcov --remove ./coverage.info '*/tests/*' -o ./coverage.info |
| 27 | |
| 28 | genhtml -o ./html ./coverage.info |
| 29 | |
| 30 | mvscip-shell system . . mv. ./html/index.html ./html/cov_deepin-log-viewer.html |
| 31 | #对asan、ut、代码覆盖率结果收集至指定文件夹 |
| 32 | cpscip-shell system . . cp. -r html ../$reportdir/ |
| 33 | cpscip-shell system . . cp. -r report ../$reportdir/ |
| 34 | cpscip-shell system . . cp. -r asan*.log* ../$reportdir/asan_deepin-log-viewer.log |
| 35 | |
| 36 | exit 0 |