From d6a6f98a70393f84a96d423890b2323018035c48 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 4 Mar 2021 16:36:38 +0800 Subject: [PATCH] Script: Support local fast coverage by gcovr --- .circleci/config.yml | 2 +- trunk/auto/{coverage.sh => codecov.sh} | 0 trunk/auto/fast.sh | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) rename trunk/auto/{coverage.sh => codecov.sh} (100%) mode change 100644 => 100755 create mode 100644 trunk/auto/fast.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e8de80ba..fc1945ec4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,7 @@ jobs: - run: | echo "Build and run utest for SRS" && cd trunk && ./configure --gb28181=on --utest=on --gcov=on && make && - ./objs/srs_utest && bash auto/coverage.sh + ./objs/srs_utest && bash auto/codecov.sh run-regression-test: docker: - image: ossrs/srs:dev diff --git a/trunk/auto/coverage.sh b/trunk/auto/codecov.sh old mode 100644 new mode 100755 similarity index 100% rename from trunk/auto/coverage.sh rename to trunk/auto/codecov.sh diff --git a/trunk/auto/fast.sh b/trunk/auto/fast.sh new file mode 100644 index 000000000..0a8a183b3 --- /dev/null +++ b/trunk/auto/fast.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +IS_LINUX=yes +uname -s|grep Darwin >/dev/null && IS_DARWIN=yes && IS_LINUX=no +echo "IS_LINUX: $IS_LINUX, IS_DARWIN: $IS_DARWIN" + +echo "Clean gcda files" +find objs -name *.gcda |xargs rm -f + +echo "Build and run utest" +make -j10 && ./objs/srs_utest + +echo "Generating coverage" +mkdir -p ./objs/coverage && +gcovr -r src --html --html-details -o ./objs/coverage/srs.html objs/src && +echo "Coverage report at ./objs/coverage/srs.html" && +open ./objs/coverage/srs.html